diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index e0bd1dd38..08a1da706 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -122,9 +122,11 @@ func TestCreation(t *testing.T) { params.SepoliaChainConfig, params.SepoliaGenesisHash, []testcase{ - {0, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block - {1735370, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last London block - {1735371, 0, ID{Hash: checksumToBytes(0xb96cbd13), Next: 0}}, // First MergeNetsplit block + {0, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block + {1735370, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last London block + {1735371, 0, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // First MergeNetsplit block + {1735372, 1677557087, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // Last MergeNetsplit block + {1735372, 1677557088, ID{Hash: checksumToBytes(0xf7f9bc08), Next: 0}}, // First Shanghai block }, }, // Temporary timestamped test cases diff --git a/params/config.go b/params/config.go index 5d217ef70..701a7269f 100644 --- a/params/config.go +++ b/params/config.go @@ -50,6 +50,8 @@ var CheckpointOracles = map[common.Hash]*CheckpointOracleConfig{ GoerliGenesisHash: GoerliCheckpointOracle, } +func newUint64(val uint64) *uint64 { return &val } + var ( MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0) @@ -117,6 +119,7 @@ var ( TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000), TerminalTotalDifficultyPassed: true, MergeNetsplitBlock: big.NewInt(1735371), + ShanghaiTime: newUint64(1677557088), Ethash: new(EthashConfig), } diff --git a/params/config_test.go b/params/config_test.go index f3911f433..5634569e2 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -25,8 +25,6 @@ import ( "github.com/ethereum/go-ethereum/common/math" ) -func u64(val uint64) *uint64 { return &val } - func TestCheckCompatible(t *testing.T) { type test struct { stored, new *ChainConfig @@ -95,19 +93,19 @@ func TestCheckCompatible(t *testing.T) { }, }, { - stored: &ChainConfig{ShanghaiTime: u64(10)}, - new: &ChainConfig{ShanghaiTime: u64(20)}, + stored: &ChainConfig{ShanghaiTime: newUint64(10)}, + new: &ChainConfig{ShanghaiTime: newUint64(20)}, headTimestamp: 9, wantErr: nil, }, { - stored: &ChainConfig{ShanghaiTime: u64(10)}, - new: &ChainConfig{ShanghaiTime: u64(20)}, + stored: &ChainConfig{ShanghaiTime: newUint64(10)}, + new: &ChainConfig{ShanghaiTime: newUint64(20)}, headTimestamp: 25, wantErr: &ConfigCompatError{ What: "Shanghai fork timestamp", - StoredTime: u64(10), - NewTime: u64(20), + StoredTime: newUint64(10), + NewTime: newUint64(20), RewindToTime: 9, }, }, @@ -123,7 +121,7 @@ func TestCheckCompatible(t *testing.T) { func TestConfigRules(t *testing.T) { c := &ChainConfig{ - ShanghaiTime: u64(500), + ShanghaiTime: newUint64(500), } var stamp uint64 if r := c.Rules(big.NewInt(0), true, stamp); r.IsShanghai {