@@ -76,8 +76,10 @@ func TestCreation(t *testing.T) {
7676 {20000000 , 1681338454 , ID {Hash : checksumToBytes (0xf0afd0e3 ), Next : 1681338455 }}, // Last Gray Glacier block
7777 {20000000 , 1681338455 , ID {Hash : checksumToBytes (0xdce96c2d ), Next : 1710338135 }}, // First Shanghai block
7878 {30000000 , 1710338134 , ID {Hash : checksumToBytes (0xdce96c2d ), Next : 1710338135 }}, // Last Shanghai block
79- {40000000 , 1710338135 , ID {Hash : checksumToBytes (0x9f3d2254 ), Next : 0 }}, // First Cancun block
80- {50000000 , 2000000000 , ID {Hash : checksumToBytes (0x9f3d2254 ), Next : 0 }}, // Future Cancun block
79+ {40000000 , 1710338135 , ID {Hash : checksumToBytes (0x9f3d2254 ), Next : 1746612311 }}, // First Cancun block
80+ {30000000 , 1746022486 , ID {Hash : checksumToBytes (0x9f3d2254 ), Next : 1746612311 }}, // Last Cancun block
81+ {30000000 , 1746612311 , ID {Hash : checksumToBytes (0xc376cf8b ), Next : 0 }}, // First Prague block
82+ {50000000 , 2000000000 , ID {Hash : checksumToBytes (0xc376cf8b ), Next : 0 }}, // Future Prague block
8183 },
8284 },
8385 // Sepolia test cases
@@ -137,9 +139,11 @@ func TestCreation(t *testing.T) {
137139// fork ID.
138140func TestValidation (t * testing.T ) {
139141 // Config that has not timestamp enabled
142+ // TODO(lightclient): this always needs to be updated when a mainnet timestamp is set.
140143 legacyConfig := * params .MainnetChainConfig
141144 legacyConfig .ShanghaiTime = nil
142145 legacyConfig .CancunTime = nil
146+ legacyConfig .PragueTime = nil
143147
144148 tests := []struct {
145149 config * params.ChainConfig
@@ -314,18 +318,15 @@ func TestValidation(t *testing.T) {
314318
315319 // Local is mainnet Prague, remote announces Shanghai + knowledge about Cancun. Remote
316320 // is definitely out of sync. It may or may not need the Prague update, we don't know yet.
317- //
318- // TODO(karalabe): Enable this when Cancun **and** Prague is specced, update all the numbers
319- //{params.MainnetChainConfig, 0, 0, ID{Hash: checksumToBytes(0x3edd5b10), Next: 4370000}, nil},
321+ {params .MainnetChainConfig , 0 , 0 , ID {Hash : checksumToBytes (0x3edd5b10 ), Next : 1710338135 }, nil },
320322
321323 // Local is mainnet Shanghai, remote announces Cancun. Local is out of sync, accept.
322324 {params .MainnetChainConfig , 21000000 , 1700000000 , ID {Hash : checksumToBytes (0x9f3d2254 ), Next : 0 }, nil },
323325
324326 // Local is mainnet Shanghai, remote announces Cancun, but is not aware of Prague. Local
325327 // out of sync. Local also knows about a future fork, but that is uncertain yet.
326328 //
327- // TODO(karalabe): Enable this when Cancun **and** Prague is specced, update remote checksum
328- //{params.MainnetChainConfig, 21000000, 1678000000, ID{Hash: checksumToBytes(0x00000000), Next: 0}, nil},
329+ {params .MainnetChainConfig , 21000000 , 1678000000 , ID {Hash : checksumToBytes (0xc376cf8b ), Next : 0 }, nil },
329330
330331 // Local is mainnet Cancun. remote announces Shanghai but is not aware of further forks.
331332 // Remote needs software update.
@@ -342,11 +343,11 @@ func TestValidation(t *testing.T) {
342343 // Local is mainnet Shanghai, remote is random Shanghai.
343344 {params .MainnetChainConfig , 20000000 , 1681338455 , ID {Hash : checksumToBytes (0x12345678 ), Next : 0 }, ErrLocalIncompatibleOrStale },
344345
345- // Local is mainnet Cancun , far in the future. Remote announces Gopherium (non existing fork)
346+ // Local is mainnet Prague , far in the future. Remote announces Gopherium (non existing fork)
346347 // at some future timestamp 8888888888, for itself, but past block for local. Local is incompatible.
347348 //
348349 // This case detects non-upgraded nodes with majority hash power (typical Ropsten mess).
349- {params .MainnetChainConfig , 88888888 , 8888888888 , ID {Hash : checksumToBytes (0x9f3d2254 ), Next : 8888888888 }, ErrLocalIncompatibleOrStale },
350+ {params .MainnetChainConfig , 88888888 , 8888888888 , ID {Hash : checksumToBytes (0xc376cf8b ), Next : 8888888888 }, ErrLocalIncompatibleOrStale },
350351
351352 // Local is mainnet Shanghai. Remote is also in Shanghai, but announces Gopherium (non existing
352353 // fork) at timestamp 1668000000, before Cancun. Local is incompatible.
0 commit comments