Skip to content

Commit 2a50935

Browse files
yperbasisfiniteops
authored andcommitted
Schedule Shanghai fork on Sepolia (erigontech#6835)
See ethereum/execution-specs#716
1 parent c98f50f commit 2a50935

File tree

2 files changed

+74
-70
lines changed

2 files changed

+74
-70
lines changed

core/forkid/forkid_test.go

+73-70
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
func TestCreation(t *testing.T) {
3636
type testcase struct {
3737
head uint64
38+
time uint64
3839
want ID
3940
}
4041
tests := []struct {
@@ -47,116 +48,118 @@ func TestCreation(t *testing.T) {
4748
params.MainnetChainConfig,
4849
params.MainnetGenesisHash,
4950
[]testcase{
50-
{0, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Unsynced
51-
{1149999, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Last Frontier block
52-
{1150000, ID{Hash: checksumToBytes(0x97c2c34c), Next: 1920000}}, // First Homestead block
53-
{1919999, ID{Hash: checksumToBytes(0x97c2c34c), Next: 1920000}}, // Last Homestead block
54-
{1920000, ID{Hash: checksumToBytes(0x91d1f948), Next: 2463000}}, // First DAO block
55-
{2462999, ID{Hash: checksumToBytes(0x91d1f948), Next: 2463000}}, // Last DAO block
56-
{2463000, ID{Hash: checksumToBytes(0x7a64da13), Next: 2675000}}, // First Tangerine block
57-
{2674999, ID{Hash: checksumToBytes(0x7a64da13), Next: 2675000}}, // Last Tangerine block
58-
{2675000, ID{Hash: checksumToBytes(0x3edd5b10), Next: 4370000}}, // First Spurious block
59-
{4369999, ID{Hash: checksumToBytes(0x3edd5b10), Next: 4370000}}, // Last Spurious block
60-
{4370000, ID{Hash: checksumToBytes(0xa00bc324), Next: 7280000}}, // First Byzantium block
61-
{7279999, ID{Hash: checksumToBytes(0xa00bc324), Next: 7280000}}, // Last Byzantium block
62-
{7280000, ID{Hash: checksumToBytes(0x668db0af), Next: 9069000}}, // First and last Constantinople, first Petersburg block
63-
{9068999, ID{Hash: checksumToBytes(0x668db0af), Next: 9069000}}, // Last Petersburg block
64-
{9069000, ID{Hash: checksumToBytes(0x879d6e30), Next: 9200000}}, // First Istanbul block
65-
{9199999, ID{Hash: checksumToBytes(0x879d6e30), Next: 9200000}}, // Last Istanbul block
66-
{9200000, ID{Hash: checksumToBytes(0xe029e991), Next: 12244000}}, // First Muir Glacier block
67-
{12243999, ID{Hash: checksumToBytes(0xe029e991), Next: 12244000}}, // Last Muir Glacier block
68-
{12244000, ID{Hash: checksumToBytes(0x0eb440f6), Next: 12965000}}, // First Berlin block
69-
{12964999, ID{Hash: checksumToBytes(0x0eb440f6), Next: 12965000}}, // Last Berlin block
70-
{12965000, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // First London block
71-
{13772999, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // Last London block
72-
{13773000, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // First Arrow Glacier block
73-
{15049999, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // Last Arrow Glacier block
74-
{15050000, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 0}}, // First Gray Glacier block
75-
{20000000, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 0}}, // Future Gray Glacier block
51+
{0, 0, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Unsynced
52+
{1149999, 0, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Last Frontier block
53+
{1150000, 0, ID{Hash: checksumToBytes(0x97c2c34c), Next: 1920000}}, // First Homestead block
54+
{1919999, 0, ID{Hash: checksumToBytes(0x97c2c34c), Next: 1920000}}, // Last Homestead block
55+
{1920000, 0, ID{Hash: checksumToBytes(0x91d1f948), Next: 2463000}}, // First DAO block
56+
{2462999, 0, ID{Hash: checksumToBytes(0x91d1f948), Next: 2463000}}, // Last DAO block
57+
{2463000, 0, ID{Hash: checksumToBytes(0x7a64da13), Next: 2675000}}, // First Tangerine block
58+
{2674999, 0, ID{Hash: checksumToBytes(0x7a64da13), Next: 2675000}}, // Last Tangerine block
59+
{2675000, 0, ID{Hash: checksumToBytes(0x3edd5b10), Next: 4370000}}, // First Spurious block
60+
{4369999, 0, ID{Hash: checksumToBytes(0x3edd5b10), Next: 4370000}}, // Last Spurious block
61+
{4370000, 0, ID{Hash: checksumToBytes(0xa00bc324), Next: 7280000}}, // First Byzantium block
62+
{7279999, 0, ID{Hash: checksumToBytes(0xa00bc324), Next: 7280000}}, // Last Byzantium block
63+
{7280000, 0, ID{Hash: checksumToBytes(0x668db0af), Next: 9069000}}, // First and last Constantinople, first Petersburg block
64+
{9068999, 0, ID{Hash: checksumToBytes(0x668db0af), Next: 9069000}}, // Last Petersburg block
65+
{9069000, 0, ID{Hash: checksumToBytes(0x879d6e30), Next: 9200000}}, // First Istanbul block
66+
{9199999, 0, ID{Hash: checksumToBytes(0x879d6e30), Next: 9200000}}, // Last Istanbul block
67+
{9200000, 0, ID{Hash: checksumToBytes(0xe029e991), Next: 12244000}}, // First Muir Glacier block
68+
{12243999, 0, ID{Hash: checksumToBytes(0xe029e991), Next: 12244000}}, // Last Muir Glacier block
69+
{12244000, 0, ID{Hash: checksumToBytes(0x0eb440f6), Next: 12965000}}, // First Berlin block
70+
{12964999, 0, ID{Hash: checksumToBytes(0x0eb440f6), Next: 12965000}}, // Last Berlin block
71+
{12965000, 0, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // First London block
72+
{13772999, 0, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // Last London block
73+
{13773000, 0, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // First Arrow Glacier block
74+
{15049999, 0, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // Last Arrow Glacier block
75+
{15050000, 0, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 0}}, // First Gray Glacier block
76+
{20000000, 0, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 0}}, // Future Gray Glacier block
7677
},
7778
},
7879
// Rinkeby test cases
7980
{
8081
params.RinkebyChainConfig,
8182
params.RinkebyGenesisHash,
8283
[]testcase{
83-
{0, ID{Hash: checksumToBytes(0x3b8e0691), Next: 1}}, // Unsynced, last Frontier block
84-
{1, ID{Hash: checksumToBytes(0x60949295), Next: 2}}, // First and last Homestead block
85-
{2, ID{Hash: checksumToBytes(0x8bde40dd), Next: 3}}, // First and last Tangerine block
86-
{3, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // First Spurious block
87-
{1035300, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // Last Spurious block
88-
{1035301, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // First Byzantium block
89-
{3660662, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // Last Byzantium block
90-
{3660663, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // First Constantinople block
91-
{4321233, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // Last Constantinople block
92-
{4321234, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // First Petersburg block
93-
{5435344, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // Last Petersburg block
94-
{5435345, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // First Istanbul block
95-
{8290927, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // Last Istanbul block
96-
{8290928, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // First Berlin block
97-
{8897987, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // Last Berlin block
98-
{8897988, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // First London block
99-
{10000000, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // Future London block
84+
{0, 0, ID{Hash: checksumToBytes(0x3b8e0691), Next: 1}}, // Unsynced, last Frontier block
85+
{1, 0, ID{Hash: checksumToBytes(0x60949295), Next: 2}}, // First and last Homestead block
86+
{2, 0, ID{Hash: checksumToBytes(0x8bde40dd), Next: 3}}, // First and last Tangerine block
87+
{3, 0, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // First Spurious block
88+
{1035300, 0, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // Last Spurious block
89+
{1035301, 0, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // First Byzantium block
90+
{3660662, 0, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // Last Byzantium block
91+
{3660663, 0, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // First Constantinople block
92+
{4321233, 0, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // Last Constantinople block
93+
{4321234, 0, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // First Petersburg block
94+
{5435344, 0, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // Last Petersburg block
95+
{5435345, 0, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // First Istanbul block
96+
{8290927, 0, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // Last Istanbul block
97+
{8290928, 0, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // First Berlin block
98+
{8897987, 0, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // Last Berlin block
99+
{8897988, 0, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // First London block
100+
{10000000, 0, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // Future London block
100101
},
101102
},
102103
// Goerli test cases
103104
{
104105
params.GoerliChainConfig,
105106
params.GoerliGenesisHash,
106107
[]testcase{
107-
{0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block
108-
{1561650, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Last Petersburg block
109-
{1561651, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // First Istanbul block
110-
{4460643, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // Last Istanbul block
111-
{4460644, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // First Berlin block
112-
{5000000, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // Last Berlin block
113-
{5062605, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // First London block
114-
{6000000, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // Future London block
108+
{0, 0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block
109+
{1561650, 0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Last Petersburg block
110+
{1561651, 0, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // First Istanbul block
111+
{4460643, 0, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // Last Istanbul block
112+
{4460644, 0, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // First Berlin block
113+
{5000000, 0, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // Last Berlin block
114+
{5062605, 0, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // First London block
115+
{6000000, 0, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // Future London block
115116
},
116117
},
117118
// Sepolia test cases
118119
{
119120
params.SepoliaChainConfig,
120121
params.SepoliaGenesisHash,
121122
[]testcase{
122-
{0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
123-
{1735370, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last pre-MergeNetsplit block
124-
{1735371, ID{Hash: checksumToBytes(0xb96cbd13), Next: 0}}, // First MergeNetsplit block
123+
{0, 1633267481, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
124+
{1735370, 1661130096, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last pre-MergeNetsplit block
125+
{1735371, 1661130108, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // First MergeNetsplit block
126+
{2999999, 1677557076, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // Last pre-Shanghai block (approx height)
127+
{3000000, 1677557088, ID{Hash: checksumToBytes(0xf7f9bc08), Next: 0}}, // First Shanghai block (approx height)
125128
},
126129
},
127130
// Gnosis test cases
128131
{
129132
params.GnosisChainConfig,
130133
params.GnosisGenesisHash,
131134
[]testcase{
132-
{0, ID{Hash: checksumToBytes(0xf64909b1), Next: 1604400}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium
133-
{1604399, ID{Hash: checksumToBytes(0xf64909b1), Next: 1604400}}, // Last Byzantium block
134-
{1604400, ID{Hash: checksumToBytes(0xfde2d083), Next: 2508800}}, // First Constantinople block
135-
{2508799, ID{Hash: checksumToBytes(0xfde2d083), Next: 2508800}}, // Last Constantinople block
136-
{2508800, ID{Hash: checksumToBytes(0xfc1d8f2f), Next: 7298030}}, // First Petersburg block
137-
{7298029, ID{Hash: checksumToBytes(0xfc1d8f2f), Next: 7298030}}, // Last Petersburg block
138-
{7298030, ID{Hash: checksumToBytes(0x54d05e6c), Next: 9186425}}, // First Istanbul block
139-
{9186424, ID{Hash: checksumToBytes(0x54d05e6c), Next: 9186425}}, // Last Istanbul block
140-
{9186425, ID{Hash: checksumToBytes(0xb6e6cd81), Next: 16101500}}, // First POSDAO Activation block
141-
{16101499, ID{Hash: checksumToBytes(0xb6e6cd81), Next: 16101500}}, // Last POSDAO Activation block
142-
{16101500, ID{Hash: checksumToBytes(0x069a83d9), Next: 19040000}}, // First Berlin block
143-
{19039999, ID{Hash: checksumToBytes(0x069a83d9), Next: 19040000}}, // Last Berlin block
144-
{19040000, ID{Hash: checksumToBytes(0x018479d3), Next: 0}}, // First London block
145-
{21735000, ID{Hash: checksumToBytes(0x018479d3), Next: 0}}, // First GIP-31 block
135+
{0, 0, ID{Hash: checksumToBytes(0xf64909b1), Next: 1604400}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium
136+
{1604399, 0, ID{Hash: checksumToBytes(0xf64909b1), Next: 1604400}}, // Last Byzantium block
137+
{1604400, 0, ID{Hash: checksumToBytes(0xfde2d083), Next: 2508800}}, // First Constantinople block
138+
{2508799, 0, ID{Hash: checksumToBytes(0xfde2d083), Next: 2508800}}, // Last Constantinople block
139+
{2508800, 0, ID{Hash: checksumToBytes(0xfc1d8f2f), Next: 7298030}}, // First Petersburg block
140+
{7298029, 0, ID{Hash: checksumToBytes(0xfc1d8f2f), Next: 7298030}}, // Last Petersburg block
141+
{7298030, 0, ID{Hash: checksumToBytes(0x54d05e6c), Next: 9186425}}, // First Istanbul block
142+
{9186424, 0, ID{Hash: checksumToBytes(0x54d05e6c), Next: 9186425}}, // Last Istanbul block
143+
{9186425, 0, ID{Hash: checksumToBytes(0xb6e6cd81), Next: 16101500}}, // First POSDAO Activation block
144+
{16101499, 0, ID{Hash: checksumToBytes(0xb6e6cd81), Next: 16101500}}, // Last POSDAO Activation block
145+
{16101500, 0, ID{Hash: checksumToBytes(0x069a83d9), Next: 19040000}}, // First Berlin block
146+
{19039999, 0, ID{Hash: checksumToBytes(0x069a83d9), Next: 19040000}}, // Last Berlin block
147+
{19040000, 0, ID{Hash: checksumToBytes(0x018479d3), Next: 0}}, // First London block
148+
{21735000, 0, ID{Hash: checksumToBytes(0x018479d3), Next: 0}}, // First GIP-31 block
146149
},
147150
},
148151
// Chiado test cases
149152
{
150153
params.ChiadoChainConfig,
151154
params.ChiadoGenesisHash,
152155
[]testcase{
153-
{0, ID{Hash: checksumToBytes(0x50d39d7b), Next: 0}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
156+
{0, 0, ID{Hash: checksumToBytes(0x50d39d7b), Next: 0}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
154157
},
155158
},
156159
}
157160
for i, tt := range tests {
158161
for j, ttt := range tt.cases {
159-
if have := NewID(tt.config, tt.genesis, ttt.head, 0); have != ttt.want {
162+
if have := NewID(tt.config, tt.genesis, ttt.head, ttt.time); have != ttt.want {
160163
t.Errorf("test %d, case %d: fork ID mismatch: have %x, want %x", i, j, have, ttt.want)
161164
}
162165
}

params/chainspecs/sepolia.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"terminalTotalDifficulty": 17000000000000000,
1818
"terminalTotalDifficultyPassed": true,
1919
"mergeNetsplitBlock": 1735371,
20+
"shanghaiTime": 1677557088,
2021
"ethash": {}
2122
}

0 commit comments

Comments
 (0)