Skip to content

Commit

Permalink
feat: make deneb genesis default (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Mar 21, 2024
1 parent f595eb9 commit 49509b9
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 185 deletions.
16 changes: 0 additions & 16 deletions .github/tests/dencun-devnet-12.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/tests/mix-persistence.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
participants:
- el_type: besu
cl_type: lighthouse
- el_type: geth
cl_type: teku
use_separate_vc: true
- el_type: nethermind
cl_type: prysm
- el_type: besu
cl_type: lighthouse
- el_type: erigon
cl_type: nimbus
use_separate_vc: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ participants:
- el_type: ethereumjs
cl_type: teku
network_params:
capella_fork_epoch: 1
deneb_fork_epoch: 1
additional_services: []
25 changes: 0 additions & 25 deletions .github/tests/verkle-gen.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/tests/verkle.yaml

This file was deleted.

24 changes: 5 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@ network_params:
# Defaults to 256 epoch ~27 hours
shard_committee_period: 256

# The epoch at which the capella/deneb/electra forks are set to occur.
capella_fork_epoch: 0
deneb_fork_epoch: 4
electra_fork_epoch: null
# The epoch at which the deneb/electra forks are set to occur.
deneb_fork_epoch: 0
electra_fork_epoch: 500

# Network sync base url for syncing public networks from a custom snapshot (mostly useful for shadowforks)
# Defaults to "https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/
Expand Down Expand Up @@ -640,7 +639,6 @@ persistent: false
# Default: "null" - no mev boost, mev builder, mev flood or relays are spun up
# "mock" - mock-builder & mev-boost are spun up
# "full" - mev-boost, relays, flooder and builder are all spun up
# Users are recommended to set network_params.capella_fork_epoch to non zero when testing MEV
# We have seen instances of multibuilder instances failing to start mev-relay-api with non zero epochs
mev_type: null

Expand Down Expand Up @@ -750,8 +748,7 @@ participants:
cl_type: lighthouse
cl_image: sigp/lighthouse:latest
network_params:
capella_fork_epoch: 2
deneb_fork_epoch: 4
deneb_fork_epoch: 0
additional_services: []
wait_for_finalization: false
wait_for_verifications: false
Expand Down Expand Up @@ -803,7 +800,7 @@ participants:
count: 2
mev_type: full
network_params:
capella_fork_epoch: 1
deneb_fork_epoch: 1
additional_services: []

```
Expand Down Expand Up @@ -894,8 +891,6 @@ Starting your network up with `"mev_type": "full"` will instantiate and connect
* After the 3rd epoch, the mev-relay service will begin to receive execution payloads (eth_sendPayload, which does not contain transaction content) from the mev-builder service (or mock-builder in mock-mev mode).
* Validators will start to receive validated execution payload headers from the mev-relay service (via mev-boost) after the 4th epoch. The validator selects the most valuable header, signs the payload, and returns the signed header to the relay - effectively proposing the payload of transactions to be included in the soon-to-be-proposed block. Once the relay verifies the block proposer's signature, the relay will respond with the full execution payload body (incl. the transaction contents) for the validator to use when proposing a SignedBeaconBlock to the network.

It is recommended to use non zero value for `capella_fork_epoch` by setting `network_params.capella_fork_epoch` to a non-zero value
in the arguments passed with `mev_type` set to `full`.
</details>

This package also supports a `"mev_type": "mock"` mode that will only bring up:
Expand All @@ -905,15 +900,6 @@ This package also supports a `"mev_type": "mock"` mode that will only bring up:

For more details, including a guide and architecture of the `mev-boost` infrastructure, go [here](https://docs.kurtosis.com/how-to-full-mev-with-ethereum-package/).

## MEV-Boost usage with Capella at Epoch 0

This note is from 2023-10-05

`flashbots/mev-boost-relay:0.27` and later support `capella_fork_epoch` at `0` but this seems to require a few flags enabled
on the `lighthouse` beacon client including `--always-prefer-builder-payload` and `--disable-peer-scoring`

Users are recommended to browse the example tests [`./.github/tests`](./.github/tests); as inspiration for different ways to use the package.

## Pre-funded accounts at Genesis

This package comes with [seven prefunded keys for testing](https://github.com/kurtosis-tech/ethereum-package/blob/main/src/prelaunch_data_generator/genesis_constants/genesis_constants.star).
Expand Down
2 changes: 1 addition & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def run(plan, args={}):
recipe=epoch_recipe,
field="extract.epoch",
assertion=">=",
target_value=str(network_params.capella_fork_epoch),
target_value=str(network_params.deneb_fork_epoch),
timeout="20m",
service_name=first_client_beacon_name,
)
Expand Down
5 changes: 2 additions & 3 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ network_params:
eth1_follow_distance: 2048
min_validator_withdrawability_delay: 256
shard_committee_period: 256
capella_fork_epoch: 0
deneb_fork_epoch: 4
electra_fork_epoch: null
deneb_fork_epoch: 0
electra_fork_epoch: 500
network_sync_base_url: https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/
additional_services:
- tx_spammer
Expand Down
9 changes: 2 additions & 7 deletions src/el/besu/besu_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def launch(
el_volume_size,
tolerations,
node_selectors,
launcher.electra_fork_epoch,
)

service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -173,7 +172,6 @@ def get_config(
el_volume_size,
tolerations,
node_selectors,
electra_fork_epoch,
):
cmd = [
"besu",
Expand All @@ -198,9 +196,7 @@ def get_config(
"--engine-rpc-port={0}".format(ENGINE_HTTP_RPC_PORT_NUM),
"--sync-mode=FULL",
"--data-storage-format={0}".format(
"VERKLE"
if electra_fork_epoch != None or "verkle-gen" in network
else "BONSAI"
"VERKLE" if "verkle-gen" in network else "BONSAI"
),
"--metrics-enabled=true",
"--metrics-host=0.0.0.0",
Expand Down Expand Up @@ -280,10 +276,9 @@ def get_config(
)


def new_besu_launcher(el_cl_genesis_data, jwt_file, network, electra_fork_epoch=None):
def new_besu_launcher(el_cl_genesis_data, jwt_file, network):
return struct(
el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
electra_fork_epoch=electra_fork_epoch,
)
5 changes: 0 additions & 5 deletions src/el/el_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ def launch(
jwt_file,
network_params.network,
network_id,
network_params.capella_fork_epoch,
el_cl_data.cancun_time,
el_cl_data.prague_time,
network_params.electra_fork_epoch,
),
"launch_method": geth.launch,
},
Expand All @@ -44,10 +42,8 @@ def launch(
jwt_file,
network_params.network,
network_id,
network_params.capella_fork_epoch,
el_cl_data.cancun_time,
el_cl_data.prague_time,
network_params.electra_fork_epoch,
),
"launch_method": geth.launch,
},
Expand All @@ -56,7 +52,6 @@ def launch(
el_cl_data,
jwt_file,
network_params.network,
network_params.electra_fork_epoch,
),
"launch_method": besu.launch,
},
Expand Down
44 changes: 7 additions & 37 deletions src/el/geth/geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ def launch(
extra_params,
extra_env_vars,
extra_labels,
launcher.capella_fork_epoch,
launcher.electra_fork_epoch,
launcher.cancun_time,
launcher.prague_time,
persistent,
Expand Down Expand Up @@ -187,8 +185,6 @@ def get_config(
extra_params,
extra_env_vars,
extra_labels,
capella_fork_epoch,
electra_fork_epoch,
cancun_time,
prague_time,
persistent,
Expand All @@ -198,11 +194,9 @@ def get_config(
):
# TODO: Remove this once electra fork has path based storage scheme implemented
if (
electra_fork_epoch != None or constants.NETWORK_NAME.verkle in network
constants.NETWORK_NAME.verkle in network
) and constants.NETWORK_NAME.shadowfork not in network:
if (
electra_fork_epoch == 0 or constants.NETWORK_NAME.verkle + "-gen" in network
): # verkle-gen
if constants.NETWORK_NAME.verkle + "-gen" in network: # verkle-gen
init_datadir_cmd_str = "geth --datadir={0} --cache.preimages --override.prague={1} init {2}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
prague_time,
Expand All @@ -215,11 +209,6 @@ def get_config(
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
)
elif "--builder" in extra_params or capella_fork_epoch != 0:
init_datadir_cmd_str = "geth init --datadir={0} {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
elif constants.NETWORK_NAME.shadowfork in network:
init_datadir_cmd_str = "echo shadowfork"
else:
Expand All @@ -230,29 +219,14 @@ def get_config(

cmd = [
"geth",
# Disable path based storage scheme for electra fork or when builder image or when capella is not 0 is used
# Disable path based storage scheme for electra fork and verkle
# TODO: REMOVE Once geth default db is path based, and builder rebased
# TODO: capella fork epoch check is needed to ensure older versions of geth works.
"{0}".format(
"--state.scheme=path"
if electra_fork_epoch == None
and "verkle" not in network
and constants.NETWORK_NAME.shadowfork not in network # for now
and "--builder" not in extra_params
and capella_fork_epoch == 0
else ""
),
"{0}".format("--state.scheme=path" if "verkle" not in network else ""),
# Override prague fork timestamp for electra fork
"{0}".format("--cache.preimages" if "verkle" in network else ""),
# Override prague fork timestamp
"{0}".format(
"--cache.preimages"
if electra_fork_epoch != None or "verkle" in network
else ""
),
# Override prague fork timestamp if electra_fork_epoch == 0
"{0}".format(
"--override.prague=" + str(prague_time)
if electra_fork_epoch == 0 or "verkle-gen" in network
else ""
"--override.prague=" + str(prague_time) if "verkle-gen" in network else ""
),
"{0}".format(
"--{}".format(network) if network in constants.PUBLIC_NETWORKS else ""
Expand Down Expand Up @@ -386,18 +360,14 @@ def new_geth_launcher(
jwt_file,
network,
networkid,
capella_fork_epoch,
cancun_time,
prague_time,
electra_fork_epoch=None,
):
return struct(
el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
networkid=networkid,
capella_fork_epoch=capella_fork_epoch,
cancun_time=cancun_time,
prague_time=prague_time,
electra_fork_epoch=electra_fork_epoch,
)
20 changes: 4 additions & 16 deletions src/network_launcher/kurtosis.star
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,12 @@ def launch(plan, network_params, participants, parallel_keystore_generation):

plan.print("Generating EL CL data")

# we are running bellatrix genesis (deprecated) - will be removed in the future
if (
network_params.capella_fork_epoch > 0
and network_params.electra_fork_epoch == None
):
ethereum_genesis_generator_image = (
constants.ETHEREUM_GENESIS_GENERATOR.bellatrix_genesis
)
# we are running capella genesis - default behavior
elif (
network_params.capella_fork_epoch == 0
and network_params.electra_fork_epoch == None
and network_params.deneb_fork_epoch > 0
):
# we are running capella genesis - deprecated
if network_params.deneb_fork_epoch > 0:
ethereum_genesis_generator_image = (
constants.ETHEREUM_GENESIS_GENERATOR.capella_genesis
)
# we are running deneb genesis - experimental, soon to become default
# we are running deneb genesis - default behavior
elif network_params.deneb_fork_epoch == 0:
ethereum_genesis_generator_image = (
constants.ETHEREUM_GENESIS_GENERATOR.deneb_genesis
Expand All @@ -85,7 +73,7 @@ def launch(plan, network_params, participants, parallel_keystore_generation):
)
else:
fail(
"Unsupported fork epoch configuration, need to define either capella_fork_epoch, deneb_fork_epoch or electra_fork_epoch"
"Unsupported fork epoch configuration, need to define either deneb_fork_epoch or electra_fork_epoch"
)
return (
total_number_of_validator_keys,
Expand Down
9 changes: 4 additions & 5 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ DENEB_FORK_VERSION = "0x50000038"
ELECTRA_FORK_VERSION = "0x60000038"

ETHEREUM_GENESIS_GENERATOR = struct(
bellatrix_genesis="ethpandaops/ethereum-genesis-generator:1.3.15", # EOL
capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Default
deneb_genesis="ethpandaops/ethereum-genesis-generator:default-deneb-genesis", # Soon to become default
verkle_support_genesis="ethpandaops/ethereum-genesis-generator:3.0.0-rc.19", # soon to be deneb genesis
verkle_genesis="ethpandaops/ethereum-genesis-generator:4.0.0-rc.7",
capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Deprecated
deneb_genesis="ethpandaops/ethereum-genesis-generator:3.0.0", # Default
verkle_support_genesis="ethpandaops/ethereum-genesis-generator:3.0.0-rc.19", # soon to be deneb genesis, waiting for rebase
verkle_genesis="ethpandaops/ethereum-genesis-generator:verkle-gen-v1.0.0",
)

NETWORK_NAME = struct(
Expand Down
Loading

0 comments on commit 49509b9

Please sign in to comment.