Skip to content

Commit 241cf62

Browse files
params: schedule shanghai fork on sepolia (#26662)
* params: schedule shanghai fork on sepolia * params: u64 -> newUint64
1 parent 0ea65d4 commit 241cf62

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

core/forkid/forkid_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ func TestCreation(t *testing.T) {
122122
params.SepoliaChainConfig,
123123
params.SepoliaGenesisHash,
124124
[]testcase{
125-
{0, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
126-
{1735370, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last London block
127-
{1735371, 0, ID{Hash: checksumToBytes(0xb96cbd13), Next: 0}}, // First MergeNetsplit block
125+
{0, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
126+
{1735370, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last London block
127+
{1735371, 0, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // First MergeNetsplit block
128+
{1735372, 1677557087, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // Last MergeNetsplit block
129+
{1735372, 1677557088, ID{Hash: checksumToBytes(0xf7f9bc08), Next: 0}}, // First Shanghai block
128130
},
129131
},
130132
// Temporary timestamped test cases

params/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ var CheckpointOracles = map[common.Hash]*CheckpointOracleConfig{
5050
GoerliGenesisHash: GoerliCheckpointOracle,
5151
}
5252

53+
func newUint64(val uint64) *uint64 { return &val }
54+
5355
var (
5456
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)
5557

@@ -117,6 +119,7 @@ var (
117119
TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000),
118120
TerminalTotalDifficultyPassed: true,
119121
MergeNetsplitBlock: big.NewInt(1735371),
122+
ShanghaiTime: newUint64(1677557088),
120123
Ethash: new(EthashConfig),
121124
}
122125

params/config_test.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import (
2525
"github.com/ethereum/go-ethereum/common/math"
2626
)
2727

28-
func u64(val uint64) *uint64 { return &val }
29-
3028
func TestCheckCompatible(t *testing.T) {
3129
type test struct {
3230
stored, new *ChainConfig
@@ -95,19 +93,19 @@ func TestCheckCompatible(t *testing.T) {
9593
},
9694
},
9795
{
98-
stored: &ChainConfig{ShanghaiTime: u64(10)},
99-
new: &ChainConfig{ShanghaiTime: u64(20)},
96+
stored: &ChainConfig{ShanghaiTime: newUint64(10)},
97+
new: &ChainConfig{ShanghaiTime: newUint64(20)},
10098
headTimestamp: 9,
10199
wantErr: nil,
102100
},
103101
{
104-
stored: &ChainConfig{ShanghaiTime: u64(10)},
105-
new: &ChainConfig{ShanghaiTime: u64(20)},
102+
stored: &ChainConfig{ShanghaiTime: newUint64(10)},
103+
new: &ChainConfig{ShanghaiTime: newUint64(20)},
106104
headTimestamp: 25,
107105
wantErr: &ConfigCompatError{
108106
What: "Shanghai fork timestamp",
109-
StoredTime: u64(10),
110-
NewTime: u64(20),
107+
StoredTime: newUint64(10),
108+
NewTime: newUint64(20),
111109
RewindToTime: 9,
112110
},
113111
},
@@ -123,7 +121,7 @@ func TestCheckCompatible(t *testing.T) {
123121

124122
func TestConfigRules(t *testing.T) {
125123
c := &ChainConfig{
126-
ShanghaiTime: u64(500),
124+
ShanghaiTime: newUint64(500),
127125
}
128126
var stamp uint64
129127
if r := c.Rules(big.NewInt(0), true, stamp); r.IsShanghai {

0 commit comments

Comments
 (0)