Skip to content

Commit 7fafd41

Browse files
Remove Goerli from packages (#3851)
* common/client/genesis: remove goerli from monorepo * monorepo: fix goerli-related tests * Reference goerli in testdata * fix goerli test in client * fix goerli test --------- Co-authored-by: acolytec3 <[email protected]>
1 parent 60ed998 commit 7fafd41

36 files changed

+1369
-210
lines changed

packages/block/examples/clique.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { createBlock } from '@ethereumjs/block'
2-
import { Common, Goerli, Hardfork } from '@ethereumjs/common'
2+
import { Common, Hardfork } from '@ethereumjs/common'
3+
4+
import { Goerli } from '../test/testdata/goerliCommon.js'
35

46
const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart })
57

packages/block/test/block.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Common, Goerli, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common'
1+
import { Common, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common'
22
import { RLP } from '@ethereumjs/rlp'
33
import { createLegacyTx } from '@ethereumjs/tx'
44
import { KECCAK256_RLP_ARRAY, bytesToHex, equalsBytes, hexToBytes, toBytes } from '@ethereumjs/util'
@@ -17,6 +17,7 @@ import {
1717
} from '../src/index.js'
1818

1919
import { genesisHashesTestData } from './testdata/genesisHashesTest.js'
20+
import { Goerli } from './testdata/goerliCommon.js'
2021
import { testdataFromRPCGoerliData } from './testdata/testdata-from-rpc-goerli.js'
2122
import { testdataPreLondon2Data } from './testdata/testdata_pre-london-2.js'
2223
import { testdataPreLondonData } from './testdata/testdata_pre-london.js'
@@ -126,7 +127,7 @@ describe('[Block]: block functions', () => {
126127
})
127128

128129
it('should initialize with null parameters without throwing', () => {
129-
const common = new Common({ chain: Goerli })
130+
const common = new Common({ chain: Mainnet })
130131
const opts = { common }
131132
assert.doesNotThrow(function () {
132133
createBlock({}, opts)

packages/block/test/clique.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Common, Goerli, Hardfork } from '@ethereumjs/common'
1+
import { Common, Hardfork } from '@ethereumjs/common'
22
import { Address, createZeroAddress, hexToBytes } from '@ethereumjs/util'
33
import { assert, describe, it } from 'vitest'
44

@@ -13,6 +13,8 @@ import {
1313
createSealedCliqueBlockHeader,
1414
} from '../src/index.js'
1515

16+
import { Goerli } from './testdata/goerliCommon.js'
17+
1618
describe('[Header]: Clique PoA Functionality', () => {
1719
const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart })
1820

packages/block/test/from-rpc.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
1+
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
22
import { bytesToHex, equalsBytes, hexToBytes, randomBytes } from '@ethereumjs/util'
33
import { assert, describe, it } from 'vitest'
44

@@ -9,6 +9,7 @@ import {
99
} from '../src/index.js'
1010

1111
import { alchemy14151203Data } from './testdata/alchemy14151203.js'
12+
import { Goerli } from './testdata/goerliCommon.js'
1213
import { infuraGoerliBlock10536893Data } from './testdata/infura-goerli-block-10536893.js'
1314
import { infura15571241Data } from './testdata/infura15571241.js'
1415
import { infura15571241withTransactionsData } from './testdata/infura15571241withTransactions.js'

packages/block/test/header.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
1+
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
22
import { RLP } from '@ethereumjs/rlp'
33
import {
44
KECCAK256_RLP,
@@ -23,6 +23,7 @@ import {
2323
import { bcBlockGasLimitTestData } from './testdata/bcBlockGasLimitTest.js'
2424
import { blocksGoerliData } from './testdata/blocks_goerli.js'
2525
import { blocksMainnetData } from './testdata/blocks_mainnet.js'
26+
import { Goerli } from './testdata/goerliCommon.js'
2627

2728
import type { BlockHeader } from '../src/index.js'
2829
import type { CliqueConfig } from '@ethereumjs/common'
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
import type { ChainConfig } from '@ethereumjs/common'
2+
3+
export const Goerli: ChainConfig = {
4+
name: 'goerli',
5+
chainId: 5,
6+
defaultHardfork: 'cancun',
7+
consensus: {
8+
type: 'poa',
9+
algorithm: 'clique',
10+
clique: {
11+
period: 15,
12+
epoch: 30000,
13+
},
14+
},
15+
comment: 'Cross-client PoA test network',
16+
url: 'https://github.com/goerli/testnet',
17+
genesis: {
18+
timestamp: '0x5c51a607',
19+
gasLimit: 10485760,
20+
difficulty: 1,
21+
nonce: '0x0000000000000000',
22+
extraData:
23+
'0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
24+
},
25+
hardforks: [
26+
{
27+
name: 'chainstart',
28+
block: 0,
29+
forkHash: '0xa3f5ab08',
30+
},
31+
{
32+
name: 'homestead',
33+
block: 0,
34+
forkHash: '0xa3f5ab08',
35+
},
36+
{
37+
name: 'tangerineWhistle',
38+
block: 0,
39+
forkHash: '0xa3f5ab08',
40+
},
41+
{
42+
name: 'spuriousDragon',
43+
block: 0,
44+
forkHash: '0xa3f5ab08',
45+
},
46+
{
47+
name: 'byzantium',
48+
block: 0,
49+
forkHash: '0xa3f5ab08',
50+
},
51+
{
52+
name: 'constantinople',
53+
block: 0,
54+
forkHash: '0xa3f5ab08',
55+
},
56+
{
57+
name: 'petersburg',
58+
block: 0,
59+
forkHash: '0xa3f5ab08',
60+
},
61+
{
62+
name: 'istanbul',
63+
block: 1561651,
64+
forkHash: '0xc25efa5c',
65+
},
66+
{
67+
name: 'berlin',
68+
block: 4460644,
69+
forkHash: '0x757a1c47',
70+
},
71+
{
72+
name: 'london',
73+
block: 5062605,
74+
forkHash: '0xb8c6299d',
75+
},
76+
{
77+
// The forkHash will remain same as mergeForkIdTransition is post merge,
78+
// terminal block: https://goerli.etherscan.io/block/7382818
79+
name: 'paris',
80+
block: 7382819,
81+
forkHash: '0xb8c6299d',
82+
},
83+
{
84+
name: 'mergeForkIdTransition',
85+
block: null,
86+
forkHash: null,
87+
},
88+
{
89+
name: 'shanghai',
90+
block: null,
91+
timestamp: '1678832736',
92+
forkHash: '0xf9843abf',
93+
},
94+
{
95+
name: 'cancun',
96+
block: null,
97+
timestamp: '1705473120',
98+
forkHash: '0x70cc14e2',
99+
},
100+
],
101+
bootstrapNodes: [
102+
{
103+
ip: '51.141.78.53',
104+
port: 30303,
105+
id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a',
106+
location: '',
107+
comment: 'Upstream bootnode 1',
108+
},
109+
{
110+
ip: '13.93.54.137',
111+
port: 30303,
112+
id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b',
113+
location: '',
114+
comment: 'Upstream bootnode 2',
115+
},
116+
{
117+
ip: '94.237.54.114',
118+
port: 30313,
119+
id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291',
120+
location: '',
121+
comment: 'Upstream bootnode 3',
122+
},
123+
{
124+
ip: '18.218.250.66',
125+
port: 30313,
126+
id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949',
127+
location: '',
128+
comment: 'Upstream bootnode 4',
129+
},
130+
{
131+
ip: '3.11.147.67',
132+
port: 30303,
133+
id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91',
134+
location: '',
135+
comment: 'Ethereum Foundation bootnode',
136+
},
137+
{
138+
ip: '51.15.116.226',
139+
port: 30303,
140+
id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd',
141+
location: '',
142+
comment: 'Goerli Initiative bootnode',
143+
},
144+
{
145+
ip: '51.15.119.157',
146+
port: 30303,
147+
id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33',
148+
location: '',
149+
comment: 'Goerli Initiative bootnode',
150+
},
151+
{
152+
ip: '51.15.119.157',
153+
port: 40303,
154+
id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd',
155+
location: '',
156+
comment: 'Goerli Initiative bootnode',
157+
},
158+
],
159+
dnsNetworks: [
160+
'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net',
161+
],
162+
}

packages/blockchain/examples/clique.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { CliqueConsensus, createBlockchain } from '@ethereumjs/blockchain'
2-
import { Common, ConsensusAlgorithm, Goerli, Hardfork } from '@ethereumjs/common'
2+
import { Common, ConsensusAlgorithm, Hardfork } from '@ethereumjs/common'
3+
4+
import { Goerli } from '../test/testdata/goerliCommon.js'
35

46
import type { ConsensusDict } from '@ethereumjs/blockchain'
57

packages/blockchain/test/clique.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Common,
88
ConsensusAlgorithm,
99
ConsensusType,
10-
Goerli,
1110
Hardfork,
1211
createCustomCommon,
1312
} from '@ethereumjs/common'
@@ -23,6 +22,8 @@ import { assert, describe, it } from 'vitest'
2322
import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP, CliqueConsensus } from '../src/consensus/clique.js'
2423
import { createBlockchain } from '../src/index.js'
2524

25+
import { Goerli } from './testdata/goerliCommon.js'
26+
2627
import type { Blockchain, ConsensusDict } from '../src/index.js'
2728
import type { Block } from '@ethereumjs/block'
2829
import type { CliqueConfig } from '@ethereumjs/common'

packages/blockchain/test/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import {
44
createBlockHeader,
55
createBlockHeaderFromBytesArray,
66
} from '@ethereumjs/block'
7-
import { Common, Goerli, Hardfork, Holesky, Mainnet, Sepolia } from '@ethereumjs/common'
7+
import { Common, Hardfork, Holesky, Mainnet, Sepolia } from '@ethereumjs/common'
88
import { MapDB, bytesToHex, equalsBytes, hexToBytes, utf8ToBytes } from '@ethereumjs/util'
99
import { assert, describe, it } from 'vitest'
1010

1111
import { Blockchain, createBlockchain, createBlockchainFromBlocksData } from '../src/index.js'
1212

1313
import { blocksMainnetData } from './testdata/blocks_mainnet.js'
14+
import { Goerli } from './testdata/goerliCommon.js'
1415
import { preLondonData } from './testdata/testdata_pre-london.js'
1516
import { createTestDB, generateBlockchain, generateBlocks, isConsecutive } from './util.js'
1617

packages/blockchain/test/reorg.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { cliqueSigner, createBlock } from '@ethereumjs/block'
2-
import { Common, ConsensusAlgorithm, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
2+
import { Common, ConsensusAlgorithm, Hardfork, Mainnet } from '@ethereumjs/common'
33
import { Address, equalsBytes, hexToBytes } from '@ethereumjs/util'
44
import { assert, describe, it } from 'vitest'
55

66
import { CLIQUE_NONCE_AUTH, CliqueConsensus } from '../src/consensus/clique.js'
77
import { createBlockchain } from '../src/index.js'
88

9+
import { Goerli } from './testdata/goerliCommon.js'
910
import { generateConsecutiveBlock } from './util.js'
1011

1112
import type { ConsensusDict } from '../src/index.js'

0 commit comments

Comments
 (0)