diff --git a/core/blockchain_test.go b/core/blockchain_test.go index dd3641b1ed..cffceec6eb 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -4672,6 +4672,9 @@ func TestEIP3651(t *testing.T) { gspec.Config.TerminalTotalDifficulty = common.Big0 gspec.Config.TerminalTotalDifficultyPassed = true gspec.Config.ShanghaiBlock = common.Big0 + gspec.Config.CancunBlock = common.Big0 + gspec.Config.PragueBlock = common.Big0 + gspec.Config.VerkleBlock = common.Big0 signer := types.LatestSigner(gspec.Config) _, blocks, _ := GenerateChainWithGenesis(gspec, engine, 1, func(i int, b *BlockGen) { diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go index 5202c23f24..83ddfcf1f2 100644 --- a/core/chain_makers_test.go +++ b/core/chain_makers_test.go @@ -57,6 +57,9 @@ func TestGenerateWithdrawalChain(t *testing.T) { config.TerminalTotalDifficultyPassed = true config.TerminalTotalDifficulty = common.Big0 config.ShanghaiBlock = common.Big0 + gspec.Config.CancunBlock = common.Big0 + gspec.Config.PragueBlock = common.Big0 + gspec.Config.VerkleBlock = common.Big0 // init 0xaa with some storage elements storage := make(map[common.Hash]common.Hash) diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index 4bd602b72b..a3a082d98b 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -109,6 +109,9 @@ func TestValidation(t *testing.T) { // Config that has not timestamp enabled legacyConfig := *params.MainnetChainConfig legacyConfig.ShanghaiBlock = nil + legacyConfig.CancunBlock = nil + legacyConfig.PragueBlock = nil + legacyConfig.VerkleBlock = nil tests := []struct { config *params.ChainConfig diff --git a/core/state_processor_test.go b/core/state_processor_test.go index e5ae467642..fdc52281a5 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -65,6 +65,8 @@ func TestStateProcessorErrors(t *testing.T) { TerminalTotalDifficultyPassed: true, ShanghaiBlock: big.NewInt(0), CancunBlock: big.NewInt(0), + PragueBlock: big.NewInt(0), + VerkleBlock: big.NewInt(0), Bor: ¶ms.BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}}, } signer = types.LatestSigner(config) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index fbbcc114ad..84dd9a8cf8 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -1416,5 +1416,10 @@ func overrideConfig(original *params.ChainConfig, override *params.ChainConfig) canon = false } + if timestamp := override.VerkleBlock; timestamp != nil { + chainConfigCopy.VerkleBlock = timestamp + canon = false + } + return chainConfigCopy, canon } diff --git a/params/config_test.go b/params/config_test.go index da80516ad2..739fc2b8ad 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -115,6 +115,9 @@ func TestConfigRules(t *testing.T) { c := &ChainConfig{ LondonBlock: new(big.Int), ShanghaiBlock: big.NewInt(10), + CancunBlock: big.NewInt(20), + PragueBlock: big.NewInt(30), + VerkleBlock: big.NewInt(40), } block := new(big.Int) @@ -129,6 +132,24 @@ func TestConfigRules(t *testing.T) { t.Errorf("expected %v to be shanghai", 0) } + block.SetInt64(20) + + if r := c.Rules(block, true, 0); !r.IsCancun { + t.Errorf("expected %v to be cancun", 0) + } + + block.SetInt64(30) + + if r := c.Rules(block, true, 0); !r.IsPrague { + t.Errorf("expected %v to be prague", 0) + } + + block.SetInt64(40) + + if r := c.Rules(block, true, 0); !r.IsVerkle { + t.Errorf("expected %v to be verkle", 0) + } + block = block.SetInt64(math.MaxInt64) if r := c.Rules(block, true, 0); !r.IsShanghai {