From 97f4226171c7110ed663a5cd74b1d8a26c1a2939 Mon Sep 17 00:00:00 2001 From: jangko Date: Wed, 12 May 2021 17:24:27 +0700 Subject: [PATCH] update berlin fork number in config.nim also update test_forkid because of berlin changes --- nimbus/config.nim | 12 ++++++------ tests/test_forkid.nim | 24 ++++++++++++++++-------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/nimbus/config.nim b/nimbus/config.nim index 36f6bbde9..cda9add9e 100644 --- a/nimbus/config.nim +++ b/nimbus/config.nim @@ -260,7 +260,7 @@ proc publicChainConfig*(id: PublicNetwork): ChainConfig = petersburgBlock:7_280_000.toBlockNumber, # 28/02/2019 07:52:04 istanbulBlock: 9_069_000.toBlockNumber, # 08/12/2019 12:25:09 muirGlacierBlock: 9_200_000.toBlockNumber, # 02/01/2020 08:30:49 - berlinBlock: high(BlockNumber).toBlockNumber + berlinBlock: 12_244_000.toBlockNumber # 15/04/2021 10:07:03 ) of RopstenNet: ChainConfig( @@ -276,7 +276,7 @@ proc publicChainConfig*(id: PublicNetwork): ChainConfig = petersburgBlock:4_939_394.toBlockNumber, istanbulBlock: 6_485_846.toBlockNumber, muirGlacierBlock: 7_117_117.toBlockNumber, - berlinBlock: high(BlockNumber).toBlockNumber + berlinBlock: 9_812_189.toBlockNumber ) of RinkebyNet: ChainConfig( @@ -291,8 +291,8 @@ proc publicChainConfig*(id: PublicNetwork): ChainConfig = constantinopleBlock: 3_660_663.toBlockNumber, petersburgBlock:4_321_234.toBlockNumber, istanbulBlock: 5_435_345.toBlockNumber, - muirGlacierBlock: high(BlockNumber).toBlockNumber, - berlinBlock: high(BlockNumber).toBlockNumber + muirGlacierBlock: 8_290_928.toBlockNumber, # never occured in rinkeby network + berlinBlock: 8_290_928.toBlockNumber ) of GoerliNet: ChainConfig( @@ -307,8 +307,8 @@ proc publicChainConfig*(id: PublicNetwork): ChainConfig = constantinopleBlock: 0.toBlockNumber, petersburgBlock: 0.toBlockNumber, istanbulBlock: 1_561_651.toBlockNumber, - muirGlacierBlock: high(BlockNumber).toBlockNumber, - berlinBlock: high(BlockNumber).toBlockNumber + muirGlacierBlock: 4_460_644.toBlockNumber, # never occured in goerli network + berlinBlock: 4_460_644.toBlockNumber ) of CustomNet: privateChainConfig() diff --git a/tests/test_forkid.nim b/tests/test_forkid.nim index 7b88ac0c1..3f7d1edff 100644 --- a/tests/test_forkid.nim +++ b/tests/test_forkid.nim @@ -22,8 +22,10 @@ const (blockNumber: 9068999'u64, id: (crc: 0x668db0af'u32, nextFork: 9069000'u64)), # Last Petersburg block (blockNumber: 9069000'u64, id: (crc: 0x879D6E30'u32, nextFork: 9200000'u64)), # First Istanbul block (blockNumber: 9199999'u64, id: (crc: 0x879D6E30'u32, nextFork: 9200000'u64)), # Last Istanbul block - (blockNumber: 9200000'u64, id: (crc: 0xE029E991'u32, nextFork: 0'u64)) , # First MuirGlacier block - (blockNumber: 10000000'u64, id: (crc: 0xE029E991'u32, nextFork: 0'u64)) , # Past MuirGlacier block + (blockNumber: 9200000'u64, id: (crc: 0xE029E991'u32, nextFork: 12244000'u64)), # First MuirGlacier block + (blockNumber: 12243999'u64, id: (crc: 0xE029E991'u32, nextFork: 12244000'u64)), # Last MuirGlacier block + (blockNumber: 12244000'u64, id: (crc: 0x0eb440f6'u32, nextFork: 0'u64)), # First Berlin block + (blockNumber: 20000000'u64, id: (crc: 0x0eb440f6'u32, nextFork: 0'u64)), # Future Berlin block ] RopstenNetIDs = [ @@ -39,8 +41,10 @@ const (blockNumber: 6485845'u64, id: (crc: 0xd6e2149b'u32, nextFork: 6485846'u64)), # Last Petersburg block (blockNumber: 6485846'u64, id: (crc: 0x4bc66396'u32, nextFork: 7117117'u64)), # First Istanbul block (blockNumber: 7117116'u64, id: (crc: 0x4bc66396'u32, nextFork: 7117117'u64)), # Last Istanbul block - (blockNumber: 7117117'u64, id: (crc: 0x6727EF90'u32, nextFork: 0'u64)), # First MuirGlacier block - (blockNumber: 7500000'u64, id: (crc: 0x6727EF90'u32, nextFork: 0'u64)), # Future MuirGlacier block + (blockNumber: 7117117'u64, id: (crc: 0x6727EF90'u32, nextFork: 9812189'u64)), # First MuirGlacier block + (blockNumber: 9812188'u64, id: (crc: 0x6727EF90'u32, nextFork: 9812189'u64)), # Last MuirGlacier block + (blockNumber: 9812189'u64, id: (crc: 0xa157d377'u32, nextFork: 0'u64)), # First Berlin block + (blockNumber: 10000000'u64, id: (crc: 0xa157d377'u32, nextFork: 0'u64)), # Future Berlin block ] RinkebyNetIDs = [ @@ -55,15 +59,19 @@ const (blockNumber: 4321233'u64, id: (crc: 0xe49cab14'u32, nextFork: 4321234'u64)), # Last Constantinople block (blockNumber: 4321234'u64, id: (crc: 0xafec6b27'u32, nextFork: 5435345'u64)), # First Petersburg block (blockNumber: 5435344'u64, id: (crc: 0xafec6b27'u32, nextFork: 5435345'u64)), # Last Petersburg block - (blockNumber: 5435345'u64, id: (crc: 0xcbdb8838'u32, nextFork: 0'u64)), # First Istanbul block - (blockNumber: 6000000'u64, id: (crc: 0xcbdb8838'u32, nextFork: 0'u64)), # Future Istanbul block + (blockNumber: 5435345'u64, id: (crc: 0xcbdb8838'u32, nextFork: 8290928'u64)), # First Istanbul block + (blockNumber: 8290927'u64, id: (crc: 0xcbdb8838'u32, nextFork: 8290928'u64)), # Last Istanbul block + (blockNumber: 8290928'u64, id: (crc: 0x6910c8bd'u32, nextFork: 0'u64)), # First Berlin block + (blockNumber: 10000000'u64, id: (crc: 0x6910c8bd'u32, nextFork: 0'u64)), # Future Berlin block ] GoerliNetIDs = [ (blockNumber: 0'u64, id: (crc: 0xa3f5ab08'u32, nextFork: 1561651'u64)), # Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block (blockNumber: 1561650'u64, id: (crc: 0xa3f5ab08'u32, nextFork: 1561651'u64)), # Last Petersburg block - (blockNumber: 1561651'u64, id: (crc: 0xc25efa5c'u32, nextFork: 0'u64)), # First Istanbul block - (blockNumber: 2000000'u64, id: (crc: 0xc25efa5c'u32, nextFork: 0'u64)), # Future Istanbul block + (blockNumber: 1561651'u64, id: (crc: 0xc25efa5c'u32, nextFork: 4460644'u64)), # First Istanbul block + (blockNumber: 4460643'u64, id: (crc: 0xc25efa5c'u32, nextFork: 4460644'u64)), # Future Istanbul block + (blockNumber: 4460644'u64, id: (crc: 0x757a1c47'u32, nextFork: 0'u64)), # First Berlin block + (blockNumber: 5000000'u64, id: (crc: 0x757a1c47'u32, nextFork: 0'u64)), # Future Berlin block ] template runTest(network: PublicNetwork) =