From 31d9109e57a05e8a0e4e2d3236f6cc2dfaf674e2 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Wed, 23 Aug 2023 18:01:23 +0200 Subject: [PATCH 1/4] genesis/common: add Holesky testnet [no ci] --- packages/blockchain/test/index.spec.ts | 4 + packages/common/src/chains.ts | 118 +++++++ packages/common/src/enums.ts | 5 + packages/genesis/src/genesisStates/holesky.ts | 320 ++++++++++++++++++ packages/genesis/src/index.ts | 3 + packages/genesis/test/index.spec.ts | 1 + 6 files changed, 451 insertions(+) create mode 100644 packages/genesis/src/genesisStates/holesky.ts diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index 51ab0a9f69..92b5e964de 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -38,6 +38,10 @@ describe('blockchain test', () => { 'chainstart', 'correct HF setting with hardforkByHeadBlockNumber option' ) + + // TODO add hash test for Holesky + //const holeskyHash = '0xff9006519a8ce843ac9c28549d24211420b546e12ce2d170c77a8cca7964f23d' + assert.fail() }) it('should initialize correctly with Blockchain.fromBlocksData()', async () => { diff --git a/packages/common/src/chains.ts b/packages/common/src/chains.ts index 337d11a96f..5a1c4fbd34 100644 --- a/packages/common/src/chains.ts +++ b/packages/common/src/chains.ts @@ -448,4 +448,122 @@ export const chains: ChainsDict = { 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net', ], }, + holesky: { + name: 'holesky', + chainId: 17000, + networkId: 17000, + defaultHardfork: 'paris', + consensus: { + type: 'pos', + algorithm: 'casper', + }, + comment: 'PoS test network to replace Goerli', + url: 'https://github.com/eth-clients/holesky/', + genesis: { + baseFeePerGas: '0x3B9ACA00', + difficulty: '0x01', + extraData: '0x686f77206d7563682069732074686520666973683f', + gasLimit: '0x17D7840', + nonce: '0x1234', + timestamp: '1694786100', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xfe3366e7', // TODO edit fork hashes + }, + { + name: 'homestead', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'istanbul', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'muirGlacier', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'berlin', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'london', + block: 0, + forkHash: '0xfe3366e7', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://sepolia.etherscan.io/block/1450408 + name: 'merge', + ttd: '0', + block: 0, + forkHash: '0xfe3366e7', + }, + { + name: 'mergeForkIdTransition', + block: 0, + forkHash: '0xb96cbd13', + }, + { + name: 'shanghai', + block: null, + timestamp: '1694790240', + forkHash: '0xf7f9bc08', + }, + { + name: 'cancun', + block: null, + timestamp: '2000000000', + forkHash: null, + }, + ], + bootstrapNodes: [ + { + ip: '146.190.13.128', + port: 30303, + id: 'ac906289e4b7f12df423d654c5a962b6ebe5b3a74cc9e06292a85221f9a64a6f1cfdd6b714ed6dacef51578f92b34c60ee91e9ede9c7f8fadc4d347326d95e2b', + location: '', + comment: 'bootnode 1', + }, + { + ip: '178.128.136.233', + port: 30303, + id: 'a3435a0155a3e837c02f5e7f5662a2f1fbc25b48e4dc232016e1c51b544cb5b4510ef633ea3278c0e970fa8ad8141e2d4d0f9f95456c537ff05fdf9b31c15072', + location: '', + comment: 'bootnode 2', + }, + ], + }, } diff --git a/packages/common/src/enums.ts b/packages/common/src/enums.ts index a052f8de8b..e35061c4a6 100644 --- a/packages/common/src/enums.ts +++ b/packages/common/src/enums.ts @@ -4,6 +4,7 @@ export enum Chain { Mainnet = 1, Goerli = 5, Sepolia = 11155111, + Holesky = 17000, } /** @@ -33,6 +34,10 @@ export const ChainGenesis: Record = { blockNumber: BigInt(0), stateRoot: hexToBytes('0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494'), }, + [Chain.Holesky]: { + blockNumber: BigInt(0), + stateRoot: hexToBytes('0x69d8c9d72f6fa4ad42d4702b433707212f90db395eb54dc20bc85de253788783'), + }, } export enum Hardfork { diff --git a/packages/genesis/src/genesisStates/holesky.ts b/packages/genesis/src/genesisStates/holesky.ts new file mode 100644 index 0000000000..72c2925865 --- /dev/null +++ b/packages/genesis/src/genesisStates/holesky.ts @@ -0,0 +1,320 @@ +import type { GenesisState } from '@ethereumjs/util' + +export const holeskyGenesis: GenesisState = { + '0x0000000000000000000000000000000000000000': '0x1', + '0x0000000000000000000000000000000000000001': '0x1', + '0x0000000000000000000000000000000000000002': '0x1', + '0x0000000000000000000000000000000000000003': '0x1', + '0x0000000000000000000000000000000000000004': '0x1', + '0x0000000000000000000000000000000000000005': '0x1', + '0x0000000000000000000000000000000000000006': '0x1', + '0x0000000000000000000000000000000000000007': '0x1', + '0x0000000000000000000000000000000000000008': '0x1', + '0x0000000000000000000000000000000000000009': '0x1', + '0x000000000000000000000000000000000000000a': '0x1', + '0x000000000000000000000000000000000000000b': '0x1', + '0x000000000000000000000000000000000000000c': '0x1', + '0x000000000000000000000000000000000000000d': '0x1', + '0x000000000000000000000000000000000000000e': '0x1', + '0x000000000000000000000000000000000000000f': '0x1', + '0x0000000000000000000000000000000000000010': '0x1', + '0x0000000000000000000000000000000000000011': '0x1', + '0x0000000000000000000000000000000000000012': '0x1', + '0x0000000000000000000000000000000000000013': '0x1', + '0x0000000000000000000000000000000000000014': '0x1', + '0x0000000000000000000000000000000000000015': '0x1', + '0x0000000000000000000000000000000000000016': '0x1', + '0x0000000000000000000000000000000000000017': '0x1', + '0x0000000000000000000000000000000000000018': '0x1', + '0x0000000000000000000000000000000000000019': '0x1', + '0x000000000000000000000000000000000000001a': '0x1', + '0x000000000000000000000000000000000000001b': '0x1', + '0x000000000000000000000000000000000000001c': '0x1', + '0x000000000000000000000000000000000000001d': '0x1', + '0x000000000000000000000000000000000000001e': '0x1', + '0x000000000000000000000000000000000000001f': '0x1', + '0x0000000000000000000000000000000000000020': '0x1', + '0x0000000000000000000000000000000000000021': '0x1', + '0x0000000000000000000000000000000000000022': '0x1', + '0x0000000000000000000000000000000000000023': '0x1', + '0x0000000000000000000000000000000000000024': '0x1', + '0x0000000000000000000000000000000000000025': '0x1', + '0x0000000000000000000000000000000000000026': '0x1', + '0x0000000000000000000000000000000000000027': '0x1', + '0x0000000000000000000000000000000000000028': '0x1', + '0x0000000000000000000000000000000000000029': '0x1', + '0x000000000000000000000000000000000000002a': '0x1', + '0x000000000000000000000000000000000000002b': '0x1', + '0x000000000000000000000000000000000000002c': '0x1', + '0x000000000000000000000000000000000000002d': '0x1', + '0x000000000000000000000000000000000000002e': '0x1', + '0x000000000000000000000000000000000000002f': '0x1', + '0x0000000000000000000000000000000000000030': '0x1', + '0x0000000000000000000000000000000000000031': '0x1', + '0x0000000000000000000000000000000000000032': '0x1', + '0x0000000000000000000000000000000000000033': '0x1', + '0x0000000000000000000000000000000000000034': '0x1', + '0x0000000000000000000000000000000000000035': '0x1', + '0x0000000000000000000000000000000000000036': '0x1', + '0x0000000000000000000000000000000000000037': '0x1', + '0x0000000000000000000000000000000000000038': '0x1', + '0x0000000000000000000000000000000000000039': '0x1', + '0x000000000000000000000000000000000000003a': '0x1', + '0x000000000000000000000000000000000000003b': '0x1', + '0x000000000000000000000000000000000000003c': '0x1', + '0x000000000000000000000000000000000000003d': '0x1', + '0x000000000000000000000000000000000000003e': '0x1', + '0x000000000000000000000000000000000000003f': '0x1', + '0x0000000000000000000000000000000000000040': '0x1', + '0x0000000000000000000000000000000000000041': '0x1', + '0x0000000000000000000000000000000000000042': '0x1', + '0x0000000000000000000000000000000000000043': '0x1', + '0x0000000000000000000000000000000000000044': '0x1', + '0x0000000000000000000000000000000000000045': '0x1', + '0x0000000000000000000000000000000000000046': '0x1', + '0x0000000000000000000000000000000000000047': '0x1', + '0x0000000000000000000000000000000000000048': '0x1', + '0x0000000000000000000000000000000000000049': '0x1', + '0x000000000000000000000000000000000000004a': '0x1', + '0x000000000000000000000000000000000000004b': '0x1', + '0x000000000000000000000000000000000000004c': '0x1', + '0x000000000000000000000000000000000000004d': '0x1', + '0x000000000000000000000000000000000000004e': '0x1', + '0x000000000000000000000000000000000000004f': '0x1', + '0x0000000000000000000000000000000000000050': '0x1', + '0x0000000000000000000000000000000000000051': '0x1', + '0x0000000000000000000000000000000000000052': '0x1', + '0x0000000000000000000000000000000000000053': '0x1', + '0x0000000000000000000000000000000000000054': '0x1', + '0x0000000000000000000000000000000000000055': '0x1', + '0x0000000000000000000000000000000000000056': '0x1', + '0x0000000000000000000000000000000000000057': '0x1', + '0x0000000000000000000000000000000000000058': '0x1', + '0x0000000000000000000000000000000000000059': '0x1', + '0x000000000000000000000000000000000000005a': '0x1', + '0x000000000000000000000000000000000000005b': '0x1', + '0x000000000000000000000000000000000000005c': '0x1', + '0x000000000000000000000000000000000000005d': '0x1', + '0x000000000000000000000000000000000000005e': '0x1', + '0x000000000000000000000000000000000000005f': '0x1', + '0x0000000000000000000000000000000000000060': '0x1', + '0x0000000000000000000000000000000000000061': '0x1', + '0x0000000000000000000000000000000000000062': '0x1', + '0x0000000000000000000000000000000000000063': '0x1', + '0x0000000000000000000000000000000000000064': '0x1', + '0x0000000000000000000000000000000000000065': '0x1', + '0x0000000000000000000000000000000000000066': '0x1', + '0x0000000000000000000000000000000000000067': '0x1', + '0x0000000000000000000000000000000000000068': '0x1', + '0x0000000000000000000000000000000000000069': '0x1', + '0x000000000000000000000000000000000000006a': '0x1', + '0x000000000000000000000000000000000000006b': '0x1', + '0x000000000000000000000000000000000000006c': '0x1', + '0x000000000000000000000000000000000000006d': '0x1', + '0x000000000000000000000000000000000000006e': '0x1', + '0x000000000000000000000000000000000000006f': '0x1', + '0x0000000000000000000000000000000000000070': '0x1', + '0x0000000000000000000000000000000000000071': '0x1', + '0x0000000000000000000000000000000000000072': '0x1', + '0x0000000000000000000000000000000000000073': '0x1', + '0x0000000000000000000000000000000000000074': '0x1', + '0x0000000000000000000000000000000000000075': '0x1', + '0x0000000000000000000000000000000000000076': '0x1', + '0x0000000000000000000000000000000000000077': '0x1', + '0x0000000000000000000000000000000000000078': '0x1', + '0x0000000000000000000000000000000000000079': '0x1', + '0x000000000000000000000000000000000000007a': '0x1', + '0x000000000000000000000000000000000000007b': '0x1', + '0x000000000000000000000000000000000000007c': '0x1', + '0x000000000000000000000000000000000000007d': '0x1', + '0x000000000000000000000000000000000000007e': '0x1', + '0x000000000000000000000000000000000000007f': '0x1', + '0x0000000000000000000000000000000000000080': '0x1', + '0x0000000000000000000000000000000000000081': '0x1', + '0x0000000000000000000000000000000000000082': '0x1', + '0x0000000000000000000000000000000000000083': '0x1', + '0x0000000000000000000000000000000000000084': '0x1', + '0x0000000000000000000000000000000000000085': '0x1', + '0x0000000000000000000000000000000000000086': '0x1', + '0x0000000000000000000000000000000000000087': '0x1', + '0x0000000000000000000000000000000000000088': '0x1', + '0x0000000000000000000000000000000000000089': '0x1', + '0x000000000000000000000000000000000000008a': '0x1', + '0x000000000000000000000000000000000000008b': '0x1', + '0x000000000000000000000000000000000000008c': '0x1', + '0x000000000000000000000000000000000000008d': '0x1', + '0x000000000000000000000000000000000000008e': '0x1', + '0x000000000000000000000000000000000000008f': '0x1', + '0x0000000000000000000000000000000000000090': '0x1', + '0x0000000000000000000000000000000000000091': '0x1', + '0x0000000000000000000000000000000000000092': '0x1', + '0x0000000000000000000000000000000000000093': '0x1', + '0x0000000000000000000000000000000000000094': '0x1', + '0x0000000000000000000000000000000000000095': '0x1', + '0x0000000000000000000000000000000000000096': '0x1', + '0x0000000000000000000000000000000000000097': '0x1', + '0x0000000000000000000000000000000000000098': '0x1', + '0x0000000000000000000000000000000000000099': '0x1', + '0x000000000000000000000000000000000000009a': '0x1', + '0x000000000000000000000000000000000000009b': '0x1', + '0x000000000000000000000000000000000000009c': '0x1', + '0x000000000000000000000000000000000000009d': '0x1', + '0x000000000000000000000000000000000000009e': '0x1', + '0x000000000000000000000000000000000000009f': '0x1', + '0x00000000000000000000000000000000000000a0': '0x1', + '0x00000000000000000000000000000000000000a1': '0x1', + '0x00000000000000000000000000000000000000a2': '0x1', + '0x00000000000000000000000000000000000000a3': '0x1', + '0x00000000000000000000000000000000000000a4': '0x1', + '0x00000000000000000000000000000000000000a5': '0x1', + '0x00000000000000000000000000000000000000a6': '0x1', + '0x00000000000000000000000000000000000000a7': '0x1', + '0x00000000000000000000000000000000000000a8': '0x1', + '0x00000000000000000000000000000000000000a9': '0x1', + '0x00000000000000000000000000000000000000aa': '0x1', + '0x00000000000000000000000000000000000000ab': '0x1', + '0x00000000000000000000000000000000000000ac': '0x1', + '0x00000000000000000000000000000000000000ad': '0x1', + '0x00000000000000000000000000000000000000ae': '0x1', + '0x00000000000000000000000000000000000000af': '0x1', + '0x00000000000000000000000000000000000000b0': '0x1', + '0x00000000000000000000000000000000000000b1': '0x1', + '0x00000000000000000000000000000000000000b2': '0x1', + '0x00000000000000000000000000000000000000b3': '0x1', + '0x00000000000000000000000000000000000000b4': '0x1', + '0x00000000000000000000000000000000000000b5': '0x1', + '0x00000000000000000000000000000000000000b6': '0x1', + '0x00000000000000000000000000000000000000b7': '0x1', + '0x00000000000000000000000000000000000000b8': '0x1', + '0x00000000000000000000000000000000000000b9': '0x1', + '0x00000000000000000000000000000000000000ba': '0x1', + '0x00000000000000000000000000000000000000bb': '0x1', + '0x00000000000000000000000000000000000000bc': '0x1', + '0x00000000000000000000000000000000000000bd': '0x1', + '0x00000000000000000000000000000000000000be': '0x1', + '0x00000000000000000000000000000000000000bf': '0x1', + '0x00000000000000000000000000000000000000c0': '0x1', + '0x00000000000000000000000000000000000000c1': '0x1', + '0x00000000000000000000000000000000000000c2': '0x1', + '0x00000000000000000000000000000000000000c3': '0x1', + '0x00000000000000000000000000000000000000c4': '0x1', + '0x00000000000000000000000000000000000000c5': '0x1', + '0x00000000000000000000000000000000000000c6': '0x1', + '0x00000000000000000000000000000000000000c7': '0x1', + '0x00000000000000000000000000000000000000c8': '0x1', + '0x00000000000000000000000000000000000000c9': '0x1', + '0x00000000000000000000000000000000000000ca': '0x1', + '0x00000000000000000000000000000000000000cb': '0x1', + '0x00000000000000000000000000000000000000cc': '0x1', + '0x00000000000000000000000000000000000000cd': '0x1', + '0x00000000000000000000000000000000000000ce': '0x1', + '0x00000000000000000000000000000000000000cf': '0x1', + '0x00000000000000000000000000000000000000d0': '0x1', + '0x00000000000000000000000000000000000000d1': '0x1', + '0x00000000000000000000000000000000000000d2': '0x1', + '0x00000000000000000000000000000000000000d3': '0x1', + '0x00000000000000000000000000000000000000d4': '0x1', + '0x00000000000000000000000000000000000000d5': '0x1', + '0x00000000000000000000000000000000000000d6': '0x1', + '0x00000000000000000000000000000000000000d7': '0x1', + '0x00000000000000000000000000000000000000d8': '0x1', + '0x00000000000000000000000000000000000000d9': '0x1', + '0x00000000000000000000000000000000000000da': '0x1', + '0x00000000000000000000000000000000000000db': '0x1', + '0x00000000000000000000000000000000000000dc': '0x1', + '0x00000000000000000000000000000000000000dd': '0x1', + '0x00000000000000000000000000000000000000de': '0x1', + '0x00000000000000000000000000000000000000df': '0x1', + '0x00000000000000000000000000000000000000e0': '0x1', + '0x00000000000000000000000000000000000000e1': '0x1', + '0x00000000000000000000000000000000000000e2': '0x1', + '0x00000000000000000000000000000000000000e3': '0x1', + '0x00000000000000000000000000000000000000e4': '0x1', + '0x00000000000000000000000000000000000000e5': '0x1', + '0x00000000000000000000000000000000000000e6': '0x1', + '0x00000000000000000000000000000000000000e7': '0x1', + '0x00000000000000000000000000000000000000e8': '0x1', + '0x00000000000000000000000000000000000000e9': '0x1', + '0x00000000000000000000000000000000000000ea': '0x1', + '0x00000000000000000000000000000000000000eb': '0x1', + '0x00000000000000000000000000000000000000ec': '0x1', + '0x00000000000000000000000000000000000000ed': '0x1', + '0x00000000000000000000000000000000000000ee': '0x1', + '0x00000000000000000000000000000000000000ef': '0x1', + '0x00000000000000000000000000000000000000f0': '0x1', + '0x00000000000000000000000000000000000000f1': '0x1', + '0x00000000000000000000000000000000000000f2': '0x1', + '0x00000000000000000000000000000000000000f3': '0x1', + '0x00000000000000000000000000000000000000f4': '0x1', + '0x00000000000000000000000000000000000000f5': '0x1', + '0x00000000000000000000000000000000000000f6': '0x1', + '0x00000000000000000000000000000000000000f7': '0x1', + '0x00000000000000000000000000000000000000f8': '0x1', + '0x00000000000000000000000000000000000000f9': '0x1', + '0x00000000000000000000000000000000000000fa': '0x1', + '0x00000000000000000000000000000000000000fb': '0x1', + '0x00000000000000000000000000000000000000fc': '0x1', + '0x00000000000000000000000000000000000000fd': '0x1', + '0x00000000000000000000000000000000000000fe': '0x1', + '0x00000000000000000000000000000000000000ff': '0x1', + '0x0000006916a87b82333f4245046623b23794C65C': '0x52b7d2dcc80cd2e4000000', + '0x0be949928Ff199c9EBA9E110db210AA5C94EFAd0': '0x7c13bc4b2c133c56000000', + '0x0C100000006d7b5e23a1eAEE637f28cA32Cd5b31': '0x52b7d2dcc80cd2e4000000', + '0x0C35317B7a96C454E2CB3d1A255D775Ab112cCc8': '0xd3c21bcecceda1000000', + '0x0d731cfabC5574329823F26d488416451d2ea376': '0xd3c21bcecceda1000000', + '0x0e79065B5F11b5BD1e62B935A600976ffF3754B9': '0xd3c21bcecceda1000000', + '0x105083929bF9bb22C26cB1777Ec92661170D4285': '0xd3c21bcecceda1000000', + '0x10F5d45854e038071485AC9e402308cF80D2d2fE': '0x52b7d2dcc80cd2e4000000', + '0x1268AD189526AC0b386faF06eFfC46779c340eE6': '0xd3c21bcecceda1000000', + '0x12Cba59f5A74DB81a12ff63C349Bd82CBF6007C2': '0xd3c21bcecceda1000000', + '0x1446D7f6dF00380F246d8211dE7f0FaBC4Fd248C': '0xd3c21bcecceda1000000', + '0x164e38a375247A784A81d420201AA8fe4E513921': '0xd3c21bcecceda1000000', + '0x1B7aA44088a0eA95bdc65fef6E5071E946Bf7d8f': '0x52b7d2dcc80cd2e4000000', + '0x222222222222cF64a76AE3d36859958c864fDA2c': '0xd3c21bcecceda1000000', + '0x2f14582947E292a2eCd20C430B46f2d27CFE213c': '0x52b7d2dcc80cd2e4000000', + '0x2f2c75B5Dd5D246194812b00eEb3B09c2c66e2eE': '0x52b7d2dcc80cd2e4000000', + '0x341c40b94bf2afbfa42573cb78f16ee15a056238': '0xd3c21bcecceda1000000', + '0x34f845773D4364999f2fbC7AA26ABDeE902cBb46': '0xd3c21bcecceda1000000', + '0x3C75594181e03E8ECD8468A0037F058a9dAfad79': '0xd3c21bcecceda1000000', + '0x462396E69dBfa455F405f4DD82F3014Af8003B72': '0xa56fa5b99019a5c8000000', + '0x49Df3CCa2670eB0D591146B16359fe336e476F29': '0xd3c21bcecceda1000000', + '0x4D0b04b405c6b62C7cFC3aE54759747e2C0b4662': '0xd3c21bcecceda1000000', + '0x4D496CcC28058B1D74B7a19541663E21154f9c84': '0x52b7d2dcc80cd2e4000000', + '0x509a7667aC8D0320e36172c192506a6188aA84f6': '0x7c13bc4b2c133c56000000', + '0x5180db0237291A6449DdA9ed33aD90a38787621c': '0xd3c21bcecceda1000000', + '0x52730f347dEf6BA09adfF62EaC60D5fEe8205BC4': '0xd3c21bcecceda1000000', + '0x5EAC0fBd3dfef8aE3efa3c5dc1aa193bc6033dFd': '0xd3c21bcecceda1000000', + '0x6a7aA9b882d50Bb7bc5Da1a244719C99f12F06a3': '0x52b7d2dcc80cd2e4000000', + '0x6Cc9397c3B38739daCbfaA68EaD5F5D77Ba5F455': '0x52b7d2dcc80cd2e4000000', + '0x762cA62ca2549ad806763B3Aa1eA317c429bDBDa': '0xd3c21bcecceda1000000', + '0x778F5F13C4Be78A3a4d7141BCB26999702f407CF': '0x52b7d2dcc80cd2e4000000', + '0x875D25Ee4bC604C71BaF6236a8488F22399BED4b': '0xd3c21bcecceda1000000', + '0x8dF7878d3571BEF5e5a744F96287C8D20386d75A': '0x52b7d2dcc80cd2e4000000', + '0x9E415A096fF77650dc925dEA546585B4adB322B6': '0xd3c21bcecceda1000000', + '0xA0766B65A4f7B1da79a1AF79aC695456eFa28644': '0xd3c21bcecceda1000000', + '0xA29B144A449E414A472c60C7AAf1aaFfE329021D': '0xd3c21bcecceda1000000', + '0xa55395566b0b54395B3246f96A0bDc4b8a483df9': '0xd3c21bcecceda1000000', + '0xAC9ba72fb61aA7c31A95df0A8b6ebA6f41EF875e': '0xd3c21bcecceda1000000', + '0xB0498C15879db2eE5471d4926c5fAA25C9a09683': '0xd3c21bcecceda1000000', + '0xB19Fb4c1f280327e60Ed37b1Dc6EE77533539314': '0x52b7d2dcc80cd2e4000000', + '0xC21cB9C99C316d1863142F7dD86dd5496D81A8D6': '0xd3c21bcecceda1000000', + '0xc473d412dc52e349862209924c8981b2ee420768': '0xd3c21bcecceda1000000', + '0xC48E23C5F6e1eA0BaEf6530734edC3968f79Af2e': '0x52b7d2dcc80cd2e4000000', + '0xc6e2459991BfE27cca6d86722F35da23A1E4Cb97': '0x52b7d2dcc80cd2e4000000', + '0xD3994e4d3202dD23c8497d7F75bF1647d1DA1bb1': '0x19D971E4FE8401E74000000', + '0xDCA6e9B48Ea86AeBFDf9929949124042296b6e34': '0xd3c21bcecceda1000000', + '0xe0a2Bd4258D2768837BAa26A28fE71Dc079f84c7': '0x52b7d2dcc80cd2e4000000', + '0xEA28d002042fd9898D0Db016be9758eeAFE35C1E': '0xd3c21bcecceda1000000', + '0xEfA7454f1116807975A4750B46695E967850de5D': '0xd3c21bcecceda1000000', + '0xFBFd6Fa9F73Ac6A058E01259034C28001BEf8247': '0x52b7d2dcc80cd2e4000000', + '0xe0991E844041bE6F11B99da5b114b6bCf84EBd57': '0xd3c21bcecceda1000000', + '0x15E719b6AcAf1E4411Bf0f9576CB1D0dB161DdFc': '0xd3c21bcecceda1000000', + '0x346D827a75F98F0A7a324Ff80b7C3F90252E8baC': '0xd3c21bcecceda1000000', + '0x73b2e0E54510239E22cC936F0b4a6dE1acf0AbdE': '0x52b7d2dcc80cd2e4000000', + '0xBb977B2EE8a111D788B3477D242078d0B837E72b': '0xd3c21bcecceda1000000', + '0x834Dbf5A03e29c25bc55459cCe9c021EeBE676Ad': '0xd3c21bcecceda1000000', + '0xD1F77E4C1C45186e8653C489F90e008a73597296': '0xd3c21bcecceda1000000', + '0xb04aeF2a3d2D86B01006cCD4339A2e943d9c6480': '0xd3c21bcecceda1000000', + '0xC9CA2bA9A27De1Db589d8c33Ab8EDFa2111b31fb': '0xd3c21bcecceda1000000', + '0x4BC656B34De23896fa6069C9862F355b740401aF': '0x084595161401484a000000', +} diff --git a/packages/genesis/src/index.ts b/packages/genesis/src/index.ts index 017a8df49c..4f01d36638 100644 --- a/packages/genesis/src/index.ts +++ b/packages/genesis/src/index.ts @@ -1,6 +1,7 @@ import { Chain } from '@ethereumjs/common' import { goerliGenesis } from './genesisStates/goerli.js' +import { holeskyGenesis } from './genesisStates/holesky.js' import { mainnetGenesis } from './genesisStates/mainnet.js' import { sepoliaGenesis } from './genesisStates/sepolia.js' @@ -22,6 +23,8 @@ export function getGenesis(chainId: number): GenesisState | undefined { return goerliGenesis case Chain.Sepolia: return sepoliaGenesis + case Chain.Holesky: + return holeskyGenesis default: return undefined diff --git a/packages/genesis/test/index.spec.ts b/packages/genesis/test/index.spec.ts index 8dc617559d..f95151e7c3 100644 --- a/packages/genesis/test/index.spec.ts +++ b/packages/genesis/test/index.spec.ts @@ -7,6 +7,7 @@ const chainToName: Record = { [Chain.Mainnet]: 'mainnet', [Chain.Goerli]: 'goerli', [Chain.Sepolia]: 'sepolia', + [Chain.Holesky]: 'holesky', } describe('genesis test', () => { From 00c3368012dbf5fb02788c850ef9e5013c0c5399 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Wed, 23 Aug 2023 20:04:52 +0200 Subject: [PATCH 2/4] common/blockchain: ensure holesky gets imported --- packages/blockchain/test/index.spec.ts | 14 +++++++--- packages/common/src/chains.ts | 36 +++++++++++++------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index 92b5e964de..05d63895fb 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -38,10 +38,18 @@ describe('blockchain test', () => { 'chainstart', 'correct HF setting with hardforkByHeadBlockNumber option' ) + }) + + it.only('should initialize holesky correctly', async () => { + // Taken from: https://github.com/eth-clients/holesky/blob/36e4ff2d5138dcb2eb614f0f60fdb060b2adc1e2/README.md#metadata + const holeskyHash = '0xff9006519a8ce843ac9c28549d24211420b546e12ce2d170c77a8cca7964f23d' + const common = new Common({ chain: Chain.Holesky }) + const blockchain = await Blockchain.create({ + common, + }) + const genesisHash = blockchain.genesisBlock.hash() - // TODO add hash test for Holesky - //const holeskyHash = '0xff9006519a8ce843ac9c28549d24211420b546e12ce2d170c77a8cca7964f23d' - assert.fail() + assert.deepEqual(bytesToHex(genesisHash), holeskyHash, 'correct genesis hash for holesky') }) it('should initialize correctly with Blockchain.fromBlocksData()', async () => { diff --git a/packages/common/src/chains.ts b/packages/common/src/chains.ts index 5a1c4fbd34..e3b831d115 100644 --- a/packages/common/src/chains.ts +++ b/packages/common/src/chains.ts @@ -464,89 +464,89 @@ export const chains: ChainsDict = { difficulty: '0x01', extraData: '0x686f77206d7563682069732074686520666973683f', gasLimit: '0x17D7840', - nonce: '0x1234', - timestamp: '1694786100', + nonce: '0x0000000000001234', + timestamp: '0x65046234', }, hardforks: [ { name: 'chainstart', block: 0, - forkHash: '0xfe3366e7', // TODO edit fork hashes + forkHash: '0x01d65a8c', }, { name: 'homestead', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'tangerineWhistle', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'spuriousDragon', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'byzantium', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'constantinople', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'petersburg', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'istanbul', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'muirGlacier', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'berlin', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'london', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { // The forkHash will remain same as mergeForkIdTransition is post merge, // terminal block: https://sepolia.etherscan.io/block/1450408 - name: 'merge', + name: 'paris', ttd: '0', block: 0, - forkHash: '0xfe3366e7', + forkHash: '0x01d65a8c', }, { name: 'mergeForkIdTransition', block: 0, - forkHash: '0xb96cbd13', + forkHash: '0x01d65a8c', }, { name: 'shanghai', block: null, timestamp: '1694790240', - forkHash: '0xf7f9bc08', + forkHash: '0x445efa46', }, { name: 'cancun', block: null, timestamp: '2000000000', - forkHash: null, + forkHash: '0x104c16da', }, ], bootstrapNodes: [ From e5ff245c18001ee99f307e1cfbb75372ac4341bb Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Wed, 23 Aug 2023 20:27:15 +0200 Subject: [PATCH 3/4] blockchain: remove it.only --- packages/blockchain/test/index.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index 05d63895fb..10f9cfd89e 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -40,7 +40,7 @@ describe('blockchain test', () => { ) }) - it.only('should initialize holesky correctly', async () => { + it('should initialize holesky correctly', async () => { // Taken from: https://github.com/eth-clients/holesky/blob/36e4ff2d5138dcb2eb614f0f60fdb060b2adc1e2/README.md#metadata const holeskyHash = '0xff9006519a8ce843ac9c28549d24211420b546e12ce2d170c77a8cca7964f23d' const common = new Common({ chain: Chain.Holesky }) From 5d885ff4728095825bf2a173d678061bb24dd3b3 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Wed, 23 Aug 2023 20:43:18 +0200 Subject: [PATCH 4/4] common: remove stale comment --- packages/common/src/chains.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/common/src/chains.ts b/packages/common/src/chains.ts index e3b831d115..e82c385440 100644 --- a/packages/common/src/chains.ts +++ b/packages/common/src/chains.ts @@ -524,8 +524,6 @@ export const chains: ChainsDict = { forkHash: '0x01d65a8c', }, { - // The forkHash will remain same as mergeForkIdTransition is post merge, - // terminal block: https://sepolia.etherscan.io/block/1450408 name: 'paris', ttd: '0', block: 0,