Skip to content

Commit

Permalink
feat: Allow verkle to be at genesis or post genesis
Browse files Browse the repository at this point in the history
Co-authored-by: Barnabas Busa <[email protected]>
  • Loading branch information
parithosh and barnabasbusa authored Nov 30, 2023
1 parent 82ec85e commit 60a7529
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 28 deletions.
10 changes: 0 additions & 10 deletions .github/tests/petra.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/tests/verkle-gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:gballet-kaustinen-with-shapella-fc8f4b9
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:verkle-trees-capella-2ffb8a9
count: 2
- el_client_type: geth
el_client_image: ethpandaops/geth:gballet-kaustinen-with-shapella-fc8f4b9
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:g11tech-verge-815364b
network_params:
electra_fork_epoch: 0
additional_services:
- el_forkmon
- tx_spammer
- dora
snooper_enabled: true
17 changes: 17 additions & 0 deletions .github/tests/verkle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:transition-post-genesis-1d80ebd
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:verkle-trees-capella-2ffb8a9
count: 2
- el_client_type: geth
el_client_image: ethpandaops/geth:transition-post-genesis-1d80ebd
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:g11tech-verge-815364b
network_params:
electra_fork_epoch: 1
additional_services:
- el_forkmon
- tx_spammer
- dora
snooper_enabled: true
17 changes: 17 additions & 0 deletions examples/verkle-gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:gballet-kaustinen-with-shapella-fc8f4b9
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:verkle-trees-capella-2ffb8a9
count: 2
- el_client_type: geth
el_client_image: ethpandaops/geth:gballet-kaustinen-with-shapella-fc8f4b9
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:g11tech-verge-815364b
network_params:
electra_fork_epoch: 0
additional_services:
- el_forkmon
- tx_spammer
- dora
snooper_enabled: true
17 changes: 17 additions & 0 deletions examples/verkle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:transition-post-genesis-1d80ebd
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:verkle-trees-capella-2ffb8a9
count: 2
- el_client_type: geth
el_client_image: ethpandaops/geth:transition-post-genesis-1d80ebd
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:g11tech-verge-815364b
network_params:
electra_fork_epoch: 1
additional_services:
- el_forkmon
- tx_spammer
- dora
snooper_enabled: true
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def run(plan, args={}):
genesis_constants.PRE_FUNDED_ACCOUNTS,
fuzz_target,
tx_spammer_params,
network_params.electra_fork_epoch,
)
plan.print("Successfully launched transaction spammer")
elif additional_service == "blob_spammer":
Expand Down
22 changes: 15 additions & 7 deletions src/el/geth/geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,19 @@ def get_config(
):
# TODO: Remove this once electra fork has path based storage scheme implemented
if electra_fork_epoch != None:
init_datadir_cmd_str = "geth init --cache.preimages --override.prague={0} --datadir={1} {2}".format(
final_genesis_timestamp,
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
if electra_fork_epoch == 0: # verkle-gen
init_datadir_cmd_str = "geth --datadir={0} --cache.preimages --override.prague={1} init {2}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
final_genesis_timestamp,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
else: # verkle
init_datadir_cmd_str = (
"geth --datadir={0} --cache.preimages init {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
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,
Expand All @@ -190,10 +198,10 @@ def get_config(
),
# Override prague fork timestamp for electra fork
"{0}".format("--cache.preimages" if electra_fork_epoch != None else ""),
# Override prague fork timestamp for electra fork
# Override prague fork timestamp if electra_fork_epoch == 0
"{0}".format(
"--override.prague=" + final_genesis_timestamp
if electra_fork_epoch != None
if electra_fork_epoch == 0
else ""
),
"--verbosity=" + verbosity_level,
Expand Down
3 changes: 0 additions & 3 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,6 @@ def parse_network_params(input_args):
if result["network_params"]["electra_fork_epoch"] != None:
# if electra is defined, then deneb needs to be set very high
result["network_params"]["deneb_fork_epoch"] = HIGH_DENEB_VALUE_FORK_VERKLE
# TODO: remove once transition is complete
if result["network_params"]["electra_fork_epoch"] != 0:
fail("electra_fork_epoch can only be 0 or None")

if (
result["network_params"]["capella_fork_epoch"] > 0
Expand Down
11 changes: 8 additions & 3 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ def launch_participant_network(
)
# we are running electra - experimental
elif network_params.electra_fork_epoch != None:
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.14"
)
if network_params.electra_fork_epoch == 0:
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.14"
)
else:
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.16"
)
else:
fail(
"Unsupported fork epoch configuration, need to define either capella_fork_epoch, deneb_fork_epoch or electra_fork_epoch"
Expand Down
20 changes: 15 additions & 5 deletions src/transaction_spammer/transaction_spammer.star
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
IMAGE_NAME = "ethpandaops/tx-fuzz:master"
shared_utils = import_module("../shared_utils/shared_utils.star")
SERVICE_NAME = "transaction-spammer"


def launch_transaction_spammer(plan, prefunded_addresses, el_uri, tx_spammer_params):
def launch_transaction_spammer(
plan, prefunded_addresses, el_uri, tx_spammer_params, electra_fork_epoch
):
config = get_config(
prefunded_addresses, el_uri, tx_spammer_params.tx_spammer_extra_args
prefunded_addresses,
el_uri,
tx_spammer_params.tx_spammer_extra_args,
electra_fork_epoch,
)
plan.add_service(SERVICE_NAME, config)


def get_config(prefunded_addresses, el_uri, tx_spammer_extra_args):
def get_config(prefunded_addresses, el_uri, tx_spammer_extra_args, electra_fork_epoch):
# Temp hack to use the old tx-fuzz image until we can get the new one working
if electra_fork_epoch != None:
tx_spammer_image = "ethpandaops/tx-fuzz:kaustinen-281adbc"
else:
tx_spammer_image = "ethpandaops/tx-fuzz:master"
return ServiceConfig(
image=IMAGE_NAME,
image=tx_spammer_image,
cmd=[
"spam",
"--rpc={}".format(el_uri),
Expand Down

0 comments on commit 60a7529

Please sign in to comment.