Skip to content

Commit 9240bd8

Browse files
am1r021jochem-brouweracolytec3
authored
Fix some failing hive tests in the devp2p/snap sync test suite (#3847)
* Add missing forks and set fork block correctly for merge config * Remove TTD check in common * common: fix mergeForkBlock * Move around everything * Add mergeNetSplitBlock if not provided * fix common logic * fix spelling * address feedback and remove cli opt for setting post merge forkID block * Add paris hardfork if not present * Address feedback * Fix logic for setting merge forks when not present * spell check --------- Co-authored-by: Jochem Brouwer <[email protected]> Co-authored-by: acolytec3 <[email protected]>
1 parent 185fb0a commit 9240bd8

File tree

27 files changed

+238
-117
lines changed

27 files changed

+238
-117
lines changed

packages/block/test/testdata/goerliCommon.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,12 @@ export const Goerli: ChainConfig = {
7474
forkHash: '0xb8c6299d',
7575
},
7676
{
77-
// The forkHash will remain same as mergeForkIdTransition is post merge,
77+
// The forkHash will remain same as MergeNetsplitBlock is post merge,
7878
// terminal block: https://goerli.etherscan.io/block/7382818
7979
name: 'paris',
8080
block: 7382819,
8181
forkHash: '0xb8c6299d',
8282
},
83-
{
84-
name: 'mergeForkIdTransition',
85-
block: null,
86-
forkHash: null,
87-
},
8883
{
8984
name: 'shanghai',
9085
block: null,

packages/blockchain/test/testdata/goerliCommon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ export const Goerli: ChainConfig = {
7474
forkHash: '0xb8c6299d',
7575
},
7676
{
77-
// The forkHash will remain same as mergeForkIdTransition is post merge,
77+
// The forkHash will remain same as mergeNetsplitBlock is post merge,
7878
// terminal block: https://goerli.etherscan.io/block/7382818
7979
name: 'paris',
8080
block: 7382819,
8181
forkHash: '0xb8c6299d',
8282
},
8383
{
84-
name: 'mergeForkIdTransition',
84+
name: 'mergeNetsplitBlock',
8585
block: null,
8686
forkHash: null,
8787
},

packages/client/bin/utils.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ export function getArgs(): ClientOpts {
123123
describe: 'A custom trusted setup txt file for initializing the kzg library',
124124
coerce: (arg: string) => (arg ? path.resolve(arg) : undefined),
125125
})
126-
.option('mergeForkIdPostMerge', {
127-
describe:
128-
'Place mergeForkIdTransition hardfork before (false) or after (true) Merge hardfork in the custom gethGenesis',
129-
boolean: true,
130-
default: true,
131-
})
132126
.option('bootnodes', {
133127
describe:
134128
'Comma-separated list of network bootnodes (format: "enode://<id>@<host:port>,enode://..." ("[?discport=<port>]" not supported) or path to a bootnode.txt file',
@@ -736,7 +730,6 @@ export async function generateClientConfig(args: ClientOpts) {
736730
const chainName = path.parse(args.gethGenesis).base.split('.')[0]
737731
common = createCommonFromGethGenesis(genesisFile, {
738732
chain: chainName,
739-
mergeForkIdPostMerge: args.mergeForkIdPostMerge,
740733
})
741734
;(common.customCrypto as any) = cryptoFunctions
742735
customGenesisState = parseGethGenesisState(genesisFile)

packages/client/src/rpc/modules/engine/CLConnectionManager.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ export class CLConnectionManager {
115115
maximumFractionDigits: 1,
116116
})
117117

118-
if (this.config.chainCommon.gteHardfork(Hardfork.MergeForkIdTransition)) {
118+
if (this.config.chainCommon.gteHardfork(Hardfork.MergeNetsplitBlock)) {
119119
this.start()
120120
} else {
121121
this.config.events.on(Event.CHAIN_UPDATED, () => {
122-
if (this.config.chainCommon.gteHardfork(Hardfork.MergeForkIdTransition)) {
122+
if (this.config.chainCommon.gteHardfork(Hardfork.MergeNetsplitBlock)) {
123123
this.start()
124124
}
125125
})
@@ -311,24 +311,6 @@ export class CLConnectionManager {
311311
this.disconnectedCheckIndex++
312312
}
313313

314-
if (
315-
this.config.chainCommon.hardfork() === Hardfork.MergeForkIdTransition &&
316-
!this.config.chainCommon.gteHardfork(Hardfork.Paris)
317-
) {
318-
if (this.connectionStatus === ConnectionStatus.Disconnected) {
319-
logCLStatus(
320-
this.config.logger,
321-
'CL client connection is needed, Merge HF happening soon',
322-
logLevel.WARN,
323-
)
324-
logCLStatus(
325-
this.config.logger,
326-
'(no CL <-> EL communication yet, connection might be in a workable state though)',
327-
logLevel.WARN,
328-
)
329-
}
330-
}
331-
332314
if (
333315
!this.oneTimeMergeCLConnectionCheck &&
334316
this.config.chainCommon.hardfork() === Hardfork.Paris

packages/client/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export interface ClientOpts {
7878
customGenesisState?: string
7979
gethGenesis?: string
8080
trustedSetup?: string
81-
mergeForkIdPostMerge?: boolean
8281
bootnodes?: string | string[]
8382
port?: number
8483
extIP?: string

packages/client/test/cli/cli.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ describe('[CLI]', () => {
624624
'--dev=poa',
625625
'--isSingleNode=true',
626626
'--sync="none"',
627-
'--mergeForkIdPostMerge=false',
628627
]
629628
const onData = async (
630629
message: string,

packages/client/test/sim/configs/4844-devnet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const devnet4844Config = {
1414
muirGlacierBlock: 0,
1515
berlinBlock: 0,
1616
londonBlock: 0,
17+
mergeForkBlock: 0,
1718
shanghaiTime: 0,
1819
cancunTime: 0,
1920
clique: {

packages/client/test/testdata/common/goerliCommon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ export const Goerli: ChainConfig = {
7474
forkHash: '0xb8c6299d',
7575
},
7676
{
77-
// The forkHash will remain same as mergeForkIdTransition is post merge,
77+
// The forkHash will remain same as mergeNetsplitBlock is post merge,
7878
// terminal block: https://goerli.etherscan.io/block/7382818
7979
name: 'paris',
8080
block: 7382819,
8181
forkHash: '0xb8c6299d',
8282
},
8383
{
84-
name: 'mergeForkIdTransition',
84+
name: 'mergeNetsplitBlock',
8585
block: null,
8686
forkHash: null,
8787
},

packages/client/test/testdata/common/mergeTestnet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const mergeTestnetData: ChainConfig = {
5555
block: 3,
5656
},
5757
{
58-
name: 'mergeForkIdTransition',
58+
name: 'mergeNetsplitBlock',
5959
block: 3,
6060
},
6161
],

packages/client/test/testdata/geth-genesis/eip4844.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const eip4844Data = {
1212
muirGlacierBlock: 0,
1313
berlinBlock: 0,
1414
londonBlock: 0,
15+
mergeForkBlock: 0,
1516
shanghaiTime: 0,
1617
cancunTime: 0,
1718
clique: {

0 commit comments

Comments
 (0)