Skip to content

Commit

Permalink
fix: Update neth image; improve genesis tool (#73)
Browse files Browse the repository at this point in the history
- Update Nethermind image; 
- Improve genesis generation tool for Nethermind.
  • Loading branch information
flcl42 authored Sep 23, 2024
1 parent 24cff21 commit 71e61c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DEFAULT_EL_IMAGES = {
"op-geth": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:latest",
"op-reth": "ghcr.io/paradigmxyz/op-reth:latest",
"op-erigon": "testinprod/op-erigon:latest",
"op-nethermind": "nethermindeth/nethermind:op-c482d56",
"op-nethermind": "nethermind/nethermind:latest",
"op-besu": "ghcr.io/optimism-java/op-besu:latest",
}

Expand Down
19 changes: 15 additions & 4 deletions static_files/chainspec_template/gen2spec.jq
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Taken from https://github.com/ethereum/hive and modified to support more cases for Ethereum / OP networks

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

# Removes all empty keys and values in input.
def remove_empty:
. | walk(
Expand Down Expand Up @@ -43,6 +47,13 @@ def infix_zeros_to_length(s;l):
;

# This gives the consensus engine definition for the ethash engine.
def ethash:
{
"Ethash": {}
}
;

# This gives the consensus engine definition for the op engine.
def optimism:
{
"Optimism": {
Expand All @@ -63,7 +74,7 @@ def optimism:

{
"version": "1",
"engine": optimism,
"engine": (if .config.optimism != null then optimism else ethash end),
"params": {
# Tangerine Whistle
"eip150Transition": "0x0",
Expand Down Expand Up @@ -130,7 +141,7 @@ def optimism:
"eip1153TransitionTimestamp": .config.cancunTime|to_hex,
"eip5656TransitionTimestamp": .config.cancunTime|to_hex,
"eip6780TransitionTimestamp": .config.cancunTime|to_hex,

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

Expand Down Expand Up @@ -158,5 +169,5 @@ def optimism:
"excessBlobGas": .excessBlobGas,
"parentBeaconBlockRoot": .parentBeaconBlockRoot,
},
"accounts": ((.alloc|with_entries(.key|="0x"+.))),
}|remove_empty
"accounts": ((.alloc|with_entries(.key|=(if startswith("0x") then . else "0x" + . end)))),
}|remove_empty

0 comments on commit 71e61c8

Please sign in to comment.