Skip to content

Commit

Permalink
feat: add support for electra (#176)
Browse files Browse the repository at this point in the history
Co-authored-by: Gyanendra Mishra <anomaly.the@gmail.com>
  • Loading branch information
barnabasbusa and h4ck3rk3y committed Sep 19, 2023
1 parent 5e5b868 commit fbe6c00
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
```
Expand Down Expand Up @@ -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
}
],
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion network_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/package_io/parse_input.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit fbe6c00

Please sign in to comment.