diff --git a/consensus/misc/dao.go b/consensus/misc/dao.go index b31c9c78..969fadbc 100644 --- a/consensus/misc/dao.go +++ b/consensus/misc/dao.go @@ -23,7 +23,7 @@ import ( "github.com/mapprotocol/atlas/core/state" "github.com/mapprotocol/atlas/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/mapprotocol/atlas/params" ) var ( @@ -40,10 +40,11 @@ var ( // ensure it conforms to DAO hard-fork rules. // // DAO hard-fork extension to the header validity: -// a) if the node is no-fork, do not accept blocks in the [fork, fork+10) range -// with the fork specific extra-data set -// b) if the node is pro-fork, require blocks in the specific range to have the -// unique extra-data set. +// +// a) if the node is no-fork, do not accept blocks in the [fork, fork+10) range +// with the fork specific extra-data set +// b) if the node is pro-fork, require blocks in the specific range to have the +// unique extra-data set. func VerifyDAOHeaderExtraData(config *params.ChainConfig, header *types.Header) error { // Short circuit validation if the node doesn't care about the DAO fork if config.DAOForkBlock == nil { diff --git a/consensus/misc/eip1559.go b/consensus/misc/eip1559.go index cf9d9a3d..f56a7c17 100644 --- a/consensus/misc/eip1559.go +++ b/consensus/misc/eip1559.go @@ -22,7 +22,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" - ethparams "github.com/ethereum/go-ethereum/params" "github.com/mapprotocol/atlas/core/types" "github.com/mapprotocol/atlas/params" @@ -35,7 +34,7 @@ func VerifyEip1559Header(config *params.ChainConfig, parent, header *types.Heade // Verify that the gas limit remains within allowed bounds parentGasLimit := parent.GasLimit if !config.IsLondon(parent.Number) { - parentGasLimit = parent.GasLimit * ethparams.ElasticityMultiplier + parentGasLimit = parent.GasLimit * params.ElasticityMultiplier } if err := VerifyGaslimit(parentGasLimit, header.GasLimit); err != nil { return err @@ -57,12 +56,12 @@ func VerifyEip1559Header(config *params.ChainConfig, parent, header *types.Heade func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int { // If the current block is the first EIP-1559 block, return the InitialBaseFee. if !config.IsLondon(parent.Number) { - return new(big.Int).SetUint64(ethparams.InitialBaseFee) + return new(big.Int).SetUint64(params.InitialBaseFee) } var ( - parentGasTarget = parent.GasLimit / ethparams.ElasticityMultiplier + parentGasTarget = parent.GasLimit / params.ElasticityMultiplier parentGasTargetBig = new(big.Int).SetUint64(parentGasTarget) - baseFeeChangeDenominator = new(big.Int).SetUint64(ethparams.BaseFeeChangeDenominator) + baseFeeChangeDenominator = new(big.Int).SetUint64(params.BaseFeeChangeDenominator) newBaseFee = big.NewInt(0) ) // If the parent gasUsed is the same as the target, the baseFee remains unchanged. diff --git a/consensus/misc/forks.go b/consensus/misc/forks.go index 8cb0b31b..b7bd66a8 100644 --- a/consensus/misc/forks.go +++ b/consensus/misc/forks.go @@ -21,7 +21,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/mapprotocol/atlas/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/mapprotocol/atlas/params" ) // VerifyForkHashes verifies that blocks conforming to network hard-forks do have diff --git a/consensus/misc/gaslimit.go b/consensus/misc/gaslimit.go index 25f35300..7f0737a3 100644 --- a/consensus/misc/gaslimit.go +++ b/consensus/misc/gaslimit.go @@ -20,7 +20,7 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/params" + "github.com/mapprotocol/atlas/params" ) // VerifyGaslimit verifies the header gas limit according increase/decrease diff --git a/core/bench_test.go b/core/bench_test.go index b2d1374a..9e179c15 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -18,19 +18,19 @@ package core import ( "crypto/ecdsa" - "github.com/mapprotocol/atlas/consensus/consensustest" - "github.com/mapprotocol/atlas/core/chain" - params2 "github.com/mapprotocol/atlas/params" "io/ioutil" "math/big" "os" "testing" + "github.com/mapprotocol/atlas/consensus/consensustest" + "github.com/mapprotocol/atlas/core/chain" + "github.com/mapprotocol/atlas/params" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" "github.com/mapprotocol/atlas/core/rawdb" "github.com/mapprotocol/atlas/core/types" "github.com/mapprotocol/atlas/core/vm" @@ -169,7 +169,7 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *chain.BlockGen)) { // Generate a chain of b.N blocks using the supplied block // generator function. gspec := chain.Genesis{ - Config: params2.TestChainConfig, + Config: params.TestChainConfig, Alloc: chain.GenesisAlloc{benchRootAddr: {Balance: benchRootFunds}}, } genesis := gspec.MustCommit(db) @@ -287,7 +287,7 @@ func benchReadChain(b *testing.B, full bool, count uint64) { if err != nil { b.Fatalf("error opening database at %v: %v", dir, err) } - chain, err := chain.NewBlockChain(db, nil, params2.TestChainConfig, consensustest.NewFaker(), vm.Config{}, nil, nil) + chain, err := chain.NewBlockChain(db, nil, params.TestChainConfig, consensustest.NewFaker(), vm.Config{}, nil, nil) if err != nil { b.Fatalf("error creating chain: %v", err) }