From fbe6c004e5a9e47e4e819eddea7d2b424a555634 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 19 Sep 2023 21:48:48 +0200 Subject: [PATCH] feat: add support for electra (#176) Co-authored-by: Gyanendra Mishra --- README.md | 42 +++++++++++++++++++++++++++------ network_params.json | 4 +++- src/package_io/parse_input.star | 3 ++- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c124fa444..4a32c2633 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Optional features (enabled via flags or parameter files at runtime): * Block until the Beacon nodes finalize an epoch (i.e. finalized_epoch > 0) * Spin up & configure parameters for the infrastructure behind Flashbot's implementation of PBS using `mev-boost`, in either `full` or `mock` mode. More details [here](./README.md#proposer-builder-separation-pbs-implementation-via-flashbots-mev-boost-protocol). * Spin up & connect the network to a [beacon metrics gazer service](https://github.com/dapplion/beacon-metrics-gazer) to collect network-wide participation metrics. -* Spin up and connect a [JSON RPC Snooper](https://github.com/ethDreamer/json_rpc_snoop) to the network log responses & requests between the EL engine API and the CL client. +* Spin up and connect a [JSON RPC Snooper](https://github.com/ethDreamer/json_rpc_snoop) to the network log responses & requests between the EL engine API and the CL client. * Specify extra parameters to be passed in for any of the: CL client Beacon, and CL client validator, and/or EL client containers * Specify the required parameters for the nodes to reach an external block building network * Generate keystores for each node in parallel @@ -35,7 +35,7 @@ kurtosis run --enclave my-testnet github.com/kurtosis-tech/eth2-package "$(cat ~ Where `network_params.json` contains the parameters for your network in your home directory. #### Run on Kubernetes -Kurtosis packages work the same way over Docker or on Kubernetes. Please visit our [Kubernetes docs](https://docs.kurtosis.com/k8s) to learn how to spin up a private testnet on a Kubernetes cluster. +Kurtosis packages work the same way over Docker or on Kubernetes. Please visit our [Kubernetes docs](https://docs.kurtosis.com/k8s) to learn how to spin up a private testnet on a Kubernetes cluster. #### Tear down The testnet will reside in an [enclave](https://docs.kurtosis.com/concepts-reference/enclaves/) - an isolated, ephemeral environment. The enclave and its contents (e.g. running containers, files artifacts, etc) will persist until torn down. You can remove an enclave and its contents with: @@ -44,7 +44,7 @@ kurtosis enclave rm -f my-testnet ``` ## Management -The [Kurtosis CLI](https://docs.kurtosis.com/cli) can be used to inspect and interact with the network. +The [Kurtosis CLI](https://docs.kurtosis.com/cli) can be used to inspect and interact with the network. For example, if you need shell access, simply run: ``` @@ -142,7 +142,32 @@ To configure the package behaviour, you can modify your `network_params.json` fi // "https://0xdeadbeefcafc@relay.example.com", // "https://0xdeadbeefcafd@relay.example.com" // ] - "builder_network_params": null + "builder_network_params": null, + + // Resource management for el/beacon/validator containers + // CPU is milicores + // RAM is in MB + // Defaults are set per client + "el_min_cpu": "", + "el_max_cpu": "", + "el_min_mem": "", + "el_max_mem": "", + "bn_min_cpu": "", + "bn_max_cpu": "", + "bn_min_mem": "", + "bn_max_mem": "", + "v_min_cpu": "", + "v_max_cpu": "", + "v_min_mem": "", + "v_max_mem": "", + + // Snooper can be enabled with the `snooper_enabled` flag per client or globally + // Defaults to false + "snooper_enabled": false, + + // Count of nodes to spin up for this participant + // Default to 1 + "count": 1 } ], @@ -166,10 +191,13 @@ To configure the package behaviour, you can modify your `network_params.json` fi // This mnemonic will a) be used to create keystores for all the types of validators that we have and b) be used to generate a CL genesis.ssz that has the children // validator keys already preregistered as validators "preregistered_validator_keys_mnemonic": "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete", + // How long you want the network to wait before starting up + "genesis_delay": 120, // The epoch at which the capella and deneb forks are set to occur. - "capella_fork_epoch": 2, - "deneb_fork_epoch": 4 + "capella_fork_epoch": 0, + "deneb_fork_epoch": 4, + "electra_fork_epoch": null, }, // True by defaults such that in addition to the Ethereum network: @@ -408,7 +436,7 @@ This package also supports a `"mev_type": "mock"` mode that will only bring up: 1. `mock-builder` - a server that listens for builder API directives and responds with payloads built using an execution client 1. `mev-boost` - for every EL/CL pair launched -For more details, including a guide and architecture of the `mev-boost` infrastructure, go [here](https://docs.kurtosis.com/how-to-full-mev-with-eth2-package). +For more details, including a guide and architecture of the `mev-boost` infrastructure, go [here](https://docs.kurtosis.com/how-to-full-mev-with-eth2-package). ## Pre-funded accounts at Genesis diff --git a/network_params.json b/network_params.json index 2d090a753..2c59fc34b 100644 --- a/network_params.json +++ b/network_params.json @@ -21,8 +21,10 @@ "slots_per_epoch": 32, "num_validator_keys_per_node": 64, "preregistered_validator_keys_mnemonic": "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete", + "genesis_delay": 120, "capella_fork_epoch": 0, - "deneb_fork_epoch": 500 + "deneb_fork_epoch": 500, + "electra_fork_epoch": null }, "launch_additional_services": true, "wait_for_finalization": false, diff --git a/src/package_io/parse_input.star b/src/package_io/parse_input.star index beaf4df73..6c79e5a2e 100644 --- a/src/package_io/parse_input.star +++ b/src/package_io/parse_input.star @@ -54,9 +54,10 @@ def parse_input(plan, input_args): deposit_contract_address=result["network_params"]["deposit_contract_address"], seconds_per_slot=result["network_params"]["seconds_per_slot"], slots_per_epoch=result["network_params"]["slots_per_epoch"], + genesis_delay=result["network_params"]["genesis_delay"], capella_fork_epoch=result["network_params"]["capella_fork_epoch"], deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"], - genesis_delay=result["network_params"]["genesis_delay"] + electra_fork_epoch=result["network_params"]["electra_fork_epoch"], ), mev_params = struct( mev_relay_image = result["mev_params"]["mev_relay_image"],