diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 2ab5b86e2b..34de771fb8 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -109,7 +109,6 @@ type SimulatedBackend struct { func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.GenesisAlloc, gasLimit uint64) *SimulatedBackend { copyConfig := *params.TestChainConfig copyConfig.ChainID = big.NewInt(1337) - copyConfig.FeeConfig.GasLimit = big.NewInt(int64(gasLimit)) genesis := core.Genesis{ Config: ©Config, GasLimit: gasLimit, diff --git a/core/bench_test.go b/core/bench_test.go index f4d73ed29c..4f3cc2e97f 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -166,9 +166,8 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *BlockGen)) { // Generate a chain of b.N blocks using the supplied block // generator function. gspec := &Genesis{ - Config: params.TestChainConfig, - Alloc: GenesisAlloc{benchRootAddr: {Balance: benchRootFunds}}, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + Config: params.TestChainConfig, + Alloc: GenesisAlloc{benchRootAddr: {Balance: benchRootFunds}}, } _, chain, _, _ := GenerateChainWithGenesis(gspec, dummy.NewCoinbaseFaker(), b.N, 10, gen) diff --git a/core/blockchain_log_test.go b/core/blockchain_log_test.go index d915fdfc47..d5bfe2a19c 100644 --- a/core/blockchain_log_test.go +++ b/core/blockchain_log_test.go @@ -40,10 +40,9 @@ func TestEmitLogsCorrectness(t *testing.T) { addr1 = crypto.PubkeyToAddress(key1.PublicKey) funds = new(big.Int).Mul(big.NewInt(100), big.NewInt(params.Ether)) gspec = &Genesis{ - Config: params.TestChainConfig, - Alloc: GenesisAlloc{addr1: {Balance: funds}}, - BaseFee: big.NewInt(params.TestInitialBaseFee), - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + Config: params.TestChainConfig, + Alloc: GenesisAlloc{addr1: {Balance: funds}}, + BaseFee: big.NewInt(params.TestInitialBaseFee), } contractAddress = crypto.CreateAddress(addr1, 0) signer = types.LatestSigner(gspec.Config) diff --git a/core/blockchain_repair_test.go b/core/blockchain_repair_test.go index 7f7c3052cc..c1b72856db 100644 --- a/core/blockchain_repair_test.go +++ b/core/blockchain_repair_test.go @@ -519,9 +519,8 @@ func testRepair(t *testing.T, tt *rewindTest, snapshots bool) { // Initialize a fresh chain var ( gspec = &Genesis{ - BaseFee: big.NewInt(params.TestInitialBaseFee), - Config: params.TestChainConfig, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + BaseFee: big.NewInt(params.TestInitialBaseFee), + Config: params.TestChainConfig, } engine = dummy.NewFullFaker() config = &CacheConfig{ diff --git a/core/blockchain_snapshot_test.go b/core/blockchain_snapshot_test.go index 6ca5a5610d..b4deac33a2 100644 --- a/core/blockchain_snapshot_test.go +++ b/core/blockchain_snapshot_test.go @@ -79,9 +79,8 @@ func (basic *snapshotTestBasic) prepare(t *testing.T) (*BlockChain, []*types.Blo // Initialize a fresh chain var ( gspec = &Genesis{ - BaseFee: big.NewInt(params.TestInitialBaseFee), - Config: params.TestChainConfig, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + BaseFee: big.NewInt(params.TestInitialBaseFee), + Config: params.TestChainConfig, } engine = dummy.NewFullFaker() diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 2f2d1391c8..3937501451 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -403,9 +403,8 @@ func testRepopulateMissingTriesParallel(t *testing.T, parallelism int) { // Ensure that key1 has some funds in the genesis block. genesisBalance := big.NewInt(1000000) gspec := &Genesis{ - Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig}, - Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, - GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(), + Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig}, + Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, } blockchain, err := createBlockChain(chainDB, pruningConfig, gspec, common.Hash{}) @@ -514,9 +513,8 @@ func TestUngracefulAsyncShutdown(t *testing.T) { // Ensure that key1 has some funds in the genesis block. genesisBalance := big.NewInt(1000000) gspec := &Genesis{ - Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig}, - Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, - GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(), + Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig}, + Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, } blockchain, err := create(chainDB, gspec, common.Hash{}) @@ -780,10 +778,9 @@ func TestCanonicalHashMarker(t *testing.T) { for _, c := range cases { var ( gspec = &Genesis{ - Config: params.TestChainConfig, - Alloc: GenesisAlloc{}, - BaseFee: big.NewInt(params.TestInitialBaseFee), - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + Config: params.TestChainConfig, + Alloc: GenesisAlloc{}, + BaseFee: big.NewInt(params.TestInitialBaseFee), } engine = dummy.NewCoinbaseFaker() ) @@ -924,7 +921,6 @@ func testCreateThenDelete(t *testing.T, config *params.ChainConfig) { Alloc: GenesisAlloc{ address: {Balance: funds}, }, - GasLimit: config.FeeConfig.GasLimit.Uint64(), } nonce := uint64(0) signer := types.HomesteadSigner{} @@ -1012,7 +1008,6 @@ func TestTransientStorageReset(t *testing.T) { Alloc: GenesisAlloc{ address: {Balance: funds}, }, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), } nonce := uint64(0) signer := types.HomesteadSigner{} @@ -1107,7 +1102,6 @@ func TestEIP3651(t *testing.T) { Balance: big.NewInt(0), }, }, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), } ) diff --git a/core/headerchain_test.go b/core/headerchain_test.go index 72721c3f79..8cdcf18447 100644 --- a/core/headerchain_test.go +++ b/core/headerchain_test.go @@ -75,9 +75,8 @@ func TestHeaderInsertion(t *testing.T) { var ( db = rawdb.NewMemoryDatabase() gspec = &Genesis{ - BaseFee: big.NewInt(params.TestInitialBaseFee), - Config: params.TestChainConfig, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + BaseFee: big.NewInt(params.TestInitialBaseFee), + Config: params.TestChainConfig, } ) genesis := gspec.ToBlock() diff --git a/core/state_processor_test.go b/core/state_processor_test.go index a206be7315..48a17618ee 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -218,6 +218,7 @@ func TestStateProcessorErrors(t *testing.T) { gspec = &Genesis{ Config: ¶ms.ChainConfig{ ChainID: big.NewInt(1), + FeeConfig: params.DefaultFeeConfig, HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP150Hash: common.Hash{}, @@ -235,6 +236,7 @@ func TestStateProcessorErrors(t *testing.T) { Nonce: 0, }, }, + GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), } blockchain, _ = NewBlockChain(db, DefaultCacheConfig, gspec, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false) ) diff --git a/core/test_blockchain.go b/core/test_blockchain.go index 991c796a61..284b46816d 100644 --- a/core/test_blockchain.go +++ b/core/test_blockchain.go @@ -1275,9 +1275,8 @@ func TestGenerateChainInvalidBlockFee(t *testing.T, create func(db ethdb.Databas // Ensure that key1 has some funds in the genesis block. genesisBalance := new(big.Int).Mul(big.NewInt(1000000), big.NewInt(params.Ether)) gspec := &Genesis{ - Config: params.TestChainConfig, - Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + Config: params.TestChainConfig, + Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, } blockchain, err := create(chainDB, gspec, common.Hash{}) @@ -1325,9 +1324,8 @@ func TestInsertChainInvalidBlockFee(t *testing.T, create func(db ethdb.Database, // Ensure that key1 has some funds in the genesis block. genesisBalance := new(big.Int).Mul(big.NewInt(1000000), big.NewInt(params.Ether)) gspec := &Genesis{ - Config: params.TestChainConfig, - Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + Config: params.TestChainConfig, + Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, } blockchain, err := create(chainDB, gspec, common.Hash{}) @@ -1382,9 +1380,8 @@ func TestInsertChainValidBlockFee(t *testing.T, create func(db ethdb.Database, g // Ensure that key1 has some funds in the genesis block. genesisBalance := new(big.Int).Mul(big.NewInt(1000000), big.NewInt(params.Ether)) gspec := &Genesis{ - Config: params.TestChainConfig, - Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), + Config: params.TestChainConfig, + Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, } blockchain, err := create(chainDB, gspec, common.Hash{}) @@ -1479,9 +1476,8 @@ func TestStatefulPrecompiles(t *testing.T, create func(db ethdb.Database, gspec feemanager.ConfigKey: feemanager.NewConfig(utils.NewUint64(0), []common.Address{addr1}, nil, nil), } gspec := &Genesis{ - Config: &config, - Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, - GasLimit: config.FeeConfig.GasLimit.Uint64(), + Config: &config, + Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, } blockchain, err := create(chainDB, gspec, common.Hash{}) diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index e66de42906..cd5279a76b 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -100,9 +100,8 @@ func (b *testBackend) teardown() { func newTestBackendFakerEngine(t *testing.T, config *params.ChainConfig, numBlocks int, genBlocks func(i int, b *core.BlockGen)) *testBackend { var gspec = &core.Genesis{ - Config: config, - Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}}, - GasLimit: config.FeeConfig.GasLimit.Uint64(), + Config: config, + Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}}, } engine := dummy.NewETHFaker() @@ -128,9 +127,8 @@ func newTestBackendFakerEngine(t *testing.T, config *params.ChainConfig, numBloc // after use, otherwise the blockchain instance will mem-leak via goroutines. func newTestBackend(t *testing.T, config *params.ChainConfig, numBlocks int, genBlocks func(i int, b *core.BlockGen)) *testBackend { var gspec = &core.Genesis{ - Config: config, - Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}}, - GasLimit: config.FeeConfig.GasLimit.Uint64(), + Config: config, + Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}}, } engine := dummy.NewFaker() diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index 2b99cacfc0..856e9236f1 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -217,7 +217,6 @@ func TestTraceCall(t *testing.T) { accounts[1].addr: {Balance: big.NewInt(params.Ether)}, accounts[2].addr: {Balance: big.NewInt(params.Ether)}, }, - GasLimit: params.TestSubnetEVMConfig.FeeConfig.GasLimit.Uint64(), } genBlocks := 10 signer := types.HomesteadSigner{} @@ -352,7 +351,6 @@ func TestTraceTransaction(t *testing.T) { accounts[0].addr: {Balance: big.NewInt(params.Ether)}, accounts[1].addr: {Balance: big.NewInt(params.Ether)}, }, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), } target := common.Hash{} signer := types.HomesteadSigner{} @@ -403,7 +401,6 @@ func TestTraceBlock(t *testing.T) { accounts[1].addr: {Balance: big.NewInt(params.Ether)}, accounts[2].addr: {Balance: big.NewInt(params.Ether)}, }, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), } genBlocks := 10 signer := types.HomesteadSigner{} @@ -493,7 +490,6 @@ func TestTracingWithOverrides(t *testing.T) { }, }, }, - GasLimit: params.TestSubnetEVMConfig.FeeConfig.GasLimit.Uint64(), } genBlocks := 10 signer := types.HomesteadSigner{} @@ -855,7 +851,6 @@ func TestTraceChain(t *testing.T) { accounts[1].addr: {Balance: big.NewInt(5 * params.Ether)}, accounts[2].addr: {Balance: big.NewInt(5 * params.Ether)}, }, - GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), } genBlocks := 50 signer := types.HomesteadSigner{}