Skip to content

Commit

Permalink
fix: Update Nethermind scripts for Holocene (#92)
Browse files Browse the repository at this point in the history
Recently we've added support for the upcoming Optimism hard-fork
Holocene in Nethermind
(NethermindEth/nethermind#7761) and the OP team
suggested us to use OP's kurtosis package to test it.

We found a couple of issues when trying to set up an enclave due to
certain changes to other fork's timestamps which would trigger an error
in Nethermind. To fix that, one of our developers (@flcl42) updated the
`gen2spec.jq` script which fixes the above mentioned issue.

Co-authored-by: Barnabas Busa <barnabas.busa@ethereum.org>
  • Loading branch information
emlautarom1 and barnabasbusa authored Dec 2, 2024
1 parent 28d6a79 commit 50f0193
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions static_files/scripts/gen2spec.jq
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Taken from https://github.com/ethereum/hive and modified to support more cases for Ethereum / OP networks
# Taken from https://github.com/ethereum/hive and modified to support more cases for Ethereum / OP / Taiko networks

# Usage: cat genesis.json | jq --from-file gen2spec.jq > chainspec.json
# Usage: cat genesis.json | jq --from-file gen2spec.jq > chainspec.json

# Removes all empty keys and values in input.
def remove_empty:
Expand Down Expand Up @@ -62,7 +62,9 @@ def optimism:
"bedrockBlockNumber": .config.londonBlock|to_hex,
"canyonTimestamp": .config.shanghaiTime|to_hex,
"ecotoneTimestamp": .config.cancunTime|to_hex,
"fjordTimestamp": .config.pragueTime|to_hex,
"fjordTimestamp": .config.fjordTime|to_hex,
"graniteTimestamp": .config.graniteTime|to_hex,
"holoceneTimestamp": .config.holoceneTime|to_hex,
"l1FeeRecipient": "0x420000000000000000000000000000000000001A",
"l1BlockAddress": "0x4200000000000000000000000000000000000015",
"canyonBaseFeeChangeDenominator": "250"
Expand All @@ -71,10 +73,26 @@ def optimism:
}
;

def taiko:
{
"Taiko": {}
}
;

def clique:
{
"clique": {
"params": {
"period": .config.clique.period,
"epoch": .config.clique.epoch,
}
}
}
;

{
"version": "1",
"engine": (if .config.optimism != null then optimism else ethash end),
"engine": (if .config.optimism != null then optimism elif .config.taiko != null then taiko elif .config.clique != null then clique else ethash end),
"params": {
# Tangerine Whistle
"eip150Transition": "0x0",
Expand All @@ -85,8 +103,8 @@ def optimism:
"eip161dTransition": "0x0",
"eip155Transition": "0x0",
"maxCodeSizeTransition": "0x0",
"maxCodeSize": 24576,
"maximumExtraDataSize": "0x400",
"maxCodeSize": "0x6000",
"maximumExtraDataSize": "0x20",

# Byzantium
"eip140Transition": .config.byzantiumBlock|to_hex,
Expand Down Expand Up @@ -142,14 +160,26 @@ def optimism:
"eip5656TransitionTimestamp": .config.cancunTime|to_hex,
"eip6780TransitionTimestamp": .config.cancunTime|to_hex,

# OP forks
"rip7212TransitionTimestamp": .config.fjordTime|to_hex,
"opGraniteTransitionTimestamp": .config.graniteTime|to_hex,
"opHoloceneTransitionTimestamp": .config.holoceneTime|to_hex,

#Prague
"rip7212TransitionTimestamp": .config.pragueTime|to_hex,

# Fee collector
"feeCollector": (if .config.optimism != null then "0x4200000000000000000000000000000000000019" elif .config.taiko != null then "0x\(.config.chainId)0000000000000000000000000000010001" else null end),
"eip1559FeeCollectorTransition": (if .config.optimism != null or .config.taiko != null then .config.londonBlock|to_hex else null end),

# Other chain parameters
"networkID": .config.chainId|to_hex,
"chainID": .config.chainId|to_hex,

"terminalTotalDifficulty": .config.terminalTotalDifficulty|to_hex,
"terminalTotalDifficulty": (if .config.taiko != null then "0x0" else .config.terminalTotalDifficulty|to_hex end),

"eip1559BaseFeeMinValueTransition": .config.ontakeBlock|to_hex,
"eip1559BaseFeeMinValue": (if .config.ontakeBlock then "0x86ff51" else null end),
"ontakeTransition": .config.ontakeBlock|to_hex,
},
"genesis": {
"seal": {
Expand All @@ -158,7 +188,7 @@ def optimism:
"mixHash": .mixHash,
},
},
"difficulty": .difficulty,
"difficulty": (if .config.taiko != null then "0x0" else .difficulty|to_hex end),
"author": .coinbase,
"timestamp": .timestamp,
"parentHash": .parentHash,
Expand Down

0 comments on commit 50f0193

Please sign in to comment.