Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use separate file for additional contracts & fix disabled fork activation epoch #849

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
77e58a9
feat: add support for older forks
barnabasbusa Dec 4, 2024
1055036
remove false check
barnabasbusa Dec 4, 2024
cfa462b
add parsed files to network
barnabasbusa Dec 4, 2024
c9dcf67
add test files
barnabasbusa Dec 4, 2024
184b188
move additional contracts to a separate file, use FarFutureEpoch for …
pk910 Dec 4, 2024
a3c5a78
fix verkle activation condition, add todo to remove completely later
pk910 Dec 4, 2024
c2dafc3
`kurtosis lint`
pk910 Dec 4, 2024
dd1c2b0
remove debug output
pk910 Dec 4, 2024
4442f0e
fix: update genesis image
barnabasbusa Dec 5, 2024
09b7eb1
Merge branch 'main' into bbusa/support-older-forks
barnabasbusa Dec 6, 2024
331004f
bump test files and egg
barnabasbusa Dec 6, 2024
68f8132
change tag name
barnabasbusa Dec 6, 2024
65c0eb7
Merge branch 'bbusa/support-older-forks' into pk910/support-large-con…
barnabasbusa Dec 6, 2024
4907a53
Merge branch 'main' into pk910/support-large-contracts
barnabasbusa Dec 6, 2024
f700840
Merge branch 'main' into pk910/support-large-contracts
barnabasbusa Dec 6, 2024
2d9f0d4
fix additional preloaded contracts double encoding
pk910 Dec 6, 2024
09bc2af
bump egg image
pk910 Dec 6, 2024
f86aa62
bump egg
pk910 Dec 6, 2024
d0f3d1d
Merge branch 'main' into pk910/support-large-contracts
pk910 Dec 12, 2024
c2e5482
fix encoding for additional contracts
pk910 Dec 12, 2024
286791f
fix additional contracts encoding
pk910 Dec 12, 2024
76a590c
Merge branch 'main' into pk910/support-large-contracts
pk910 Dec 13, 2024
0460c4e
fix merge conflict
pk910 Dec 13, 2024
e45ff0f
small fix
pk910 Dec 13, 2024
7411c22
small fix
pk910 Dec 13, 2024
f24d233
update egg image
pk910 Dec 13, 2024
bed70c2
`kurtosis lint --format`
pk910 Dec 13, 2024
d3131e8
Merge branch 'main' into pk910/support-large-contracts
pk910 Feb 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,12 @@ network_params:
deneb_fork_epoch: 0

# Electra fork epoch
# Defaults to 100000000
electra_fork_epoch: 100000000
# Defaults to 18446744073709551615
electra_fork_epoch: 18446744073709551615

# Fulu fork epoch
# Defaults to 100000001
fulu_fork_epoch: 100000001

# Defaults to 18446744073709551615
fulu_fork_epoch: 18446744073709551615

# Network sync base url for syncing public networks from a custom snapshot (mostly useful for shadowforks)
# Defaults to "https://snapshots.ethpandaops.io/"
Expand Down
6 changes: 3 additions & 3 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ network_params:
min_validator_withdrawability_delay: 256
shard_committee_period: 256
deneb_fork_epoch: 0
electra_fork_epoch: 100000000
fulu_fork_epoch: 100000001
electra_fork_epoch: 18446744073709551615
fulu_fork_epoch: 18446744073709551615
network_sync_base_url: https://snapshots.ethpandaops.io/
data_column_sidecar_subnet_count: 128
samples_per_slot: 8
Expand Down Expand Up @@ -176,7 +176,7 @@ keymanager_enabled: false
checkpoint_sync_enabled: false
checkpoint_sync_url: ""
ethereum_genesis_generator_params:
image: ethpandaops/ethereum-genesis-generator:3.5.1
image: ethpandaops/ethereum-genesis-generator:pk910-bash-el-genesis-generator
port_publisher:
nat_exit_ip: KURTOSIS_IP_ADDR_PLACEHOLDER
el:
Expand Down
2 changes: 1 addition & 1 deletion src/assertoor/assertoor_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_config(
IMAGE_NAME = assertoor_params.image

if assertoor_params.image == constants.DEFAULT_ASSERTOOR_IMAGE:
if network_params.fulu_fork_epoch < constants.FULU_FORK_EPOCH:
if network_params.fulu_fork_epoch < constants.FAR_FUTURE_EPOCH:
IMAGE_NAME = "ethpandaops/assertoor:fulu-support"

return ServiceConfig(
Expand Down
2 changes: 1 addition & 1 deletion src/dora/dora_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_config(
IMAGE_NAME = dora_params.image

if dora_params.image == constants.DEFAULT_DORA_IMAGE:
if network_params.fulu_fork_epoch < constants.FULU_FORK_EPOCH:
if network_params.fulu_fork_epoch < constants.FAR_FUTURE_EPOCH:
IMAGE_NAME = "ethpandaops/dora:fulu-support"
if network_params.eip7732_fork_epoch < constants.EIP7732_FORK_EPOCH:
IMAGE_NAME = "ethpandaops/dora:eip7732-support"
Expand Down
7 changes: 2 additions & 5 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ DEFAULT_DORA_IMAGE = "ethpandaops/dora:latest"
DEFAULT_ASSERTOOR_IMAGE = "ethpandaops/assertoor:latest"
DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest"
DEFAULT_ETHEREUM_GENESIS_GENERATOR_IMAGE = (
"ethpandaops/ethereum-genesis-generator:3.6.0"
"ethpandaops/ethereum-genesis-generator:pk910-bash-el-genesis-generator"
)
DEFAULT_FLASHBOTS_RELAY_IMAGE = "flashbots/mev-boost-relay:0.29.2a3"
DEFAULT_FLASHBOTS_BUILDER_IMAGE = "ethpandaops/reth-rbuilder:develop"
Expand All @@ -113,14 +113,11 @@ BELLATRIX_FORK_VERSION = "0x30000038"
CAPELLA_FORK_VERSION = "0x40000038"
DENEB_FORK_VERSION = "0x50000038"
ELECTRA_FORK_VERSION = "0x60000038"
ELECTRA_FORK_EPOCH = 100000000
FULU_FORK_VERSION = "0x70000038"
FULU_FORK_EPOCH = 100000001
EIP7732_FORK_EPOCH = 100000002
EIP7732_FORK_VERSION = "0x80000038"
EIP7805_FORK_EPOCH = 100000003
EIP7805_FORK_VERSION = "0x90000038"

FAR_FUTURE_EPOCH = 18446744073709551615

MAX_LABEL_LENGTH = 63

Expand Down
16 changes: 8 additions & 8 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,10 @@ def default_network_params():
"bellatrix_fork_epoch": 0,
"capella_fork_epoch": 0,
"deneb_fork_epoch": 0,
"electra_fork_epoch": constants.ELECTRA_FORK_EPOCH,
"fulu_fork_epoch": constants.FULU_FORK_EPOCH,
"eip7732_fork_epoch": constants.EIP7732_FORK_EPOCH,
"eip7805_fork_epoch": constants.EIP7805_FORK_EPOCH,
"electra_fork_epoch": constants.FAR_FUTURE_EPOCH,
"fulu_fork_epoch": constants.FAR_FUTURE_EPOCH,
"eip7732_fork_epoch": constants.FAR_FUTURE_EPOCH,
"eip7805_fork_epoch": constants.FAR_FUTURE_EPOCH,
"network_sync_base_url": "https://snapshots.ethpandaops.io/",
"data_column_sidecar_subnet_count": 128,
"samples_per_slot": 8,
Expand Down Expand Up @@ -950,10 +950,10 @@ def default_minimal_network_params():
"bellatrix_fork_epoch": 0,
"capella_fork_epoch": 0,
"deneb_fork_epoch": 0,
"electra_fork_epoch": constants.ELECTRA_FORK_EPOCH,
"fulu_fork_epoch": constants.FULU_FORK_EPOCH,
"eip7732_fork_epoch": constants.EIP7732_FORK_EPOCH,
"eip7805_fork_epoch": constants.EIP7805_FORK_EPOCH,
"electra_fork_epoch": constants.FAR_FUTURE_EPOCH,
"fulu_fork_epoch": constants.FAR_FUTURE_EPOCH,
"eip7732_fork_epoch": constants.FAR_FUTURE_EPOCH,
"eip7805_fork_epoch": constants.FAR_FUTURE_EPOCH,
"network_sync_base_url": "https://snapshots.ethpandaops.io/",
"data_column_sidecar_subnet_count": 128,
"samples_per_slot": 8,
Expand Down
5 changes: 5 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,15 @@ def launch_participant_network(
static_files.EL_CL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH
)

el_cl_genesis_additional_contracts_template = read_file(
static_files.EL_CL_GENESIS_ADDITIONAL_CONTRACTS_TEMPLATE_FILEPATH
)

el_cl_data = el_cl_genesis_data_generator.generate_el_cl_genesis_data(
plan,
ethereum_genesis_generator_image,
el_cl_genesis_config_template,
el_cl_genesis_additional_contracts_template,
final_genesis_timestamp,
network_params,
total_number_of_validator_keys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ constants = import_module("../../package_io/constants.star")

GENESIS_VALUES_PATH = "/opt"
GENESIS_VALUES_FILENAME = "values.env"
GENESIS_CONTRACTS_FILENAME = "additional-contracts.json"
SHADOWFORK_FILEPATH = "/shadowfork"


def generate_el_cl_genesis_data(
plan,
image,
genesis_generation_config_yml_template,
genesis_additional_contracts_yml_template,
genesis_unix_timestamp,
network_params,
total_num_validator_keys_to_preregister,
Expand All @@ -34,12 +36,25 @@ def generate_el_cl_genesis_data(
genesis_generation_config_yml_template, template_data
)

additional_contracts_template_data = (
new_additionsl_contracts_file_for_el_cl_genesis_data(
network_params,
)
)
additional_contracts_template = shared_utils.new_template_and_data(
genesis_additional_contracts_yml_template, additional_contracts_template_data
)

genesis_values_and_dest_filepath = {}

genesis_values_and_dest_filepath[
GENESIS_VALUES_FILENAME
] = genesis_generation_template

genesis_values_and_dest_filepath[
GENESIS_CONTRACTS_FILENAME
] = additional_contracts_template

genesis_generation_config_artifact_name = plan.render_templates(
genesis_values_and_dest_filepath, "genesis-el-cl-env-file"
)
Expand Down Expand Up @@ -107,14 +122,14 @@ def new_env_file_for_el_cl_genesis_data(
"ChurnLimitQuotient": network_params.churn_limit_quotient,
"EjectionBalance": network_params.ejection_balance,
"Eth1FollowDistance": network_params.eth1_follow_distance,
"AltairForkEpoch": network_params.altair_fork_epoch,
"BellatrixForkEpoch": network_params.bellatrix_fork_epoch,
"CapellaForkEpoch": network_params.capella_fork_epoch,
"DenebForkEpoch": network_params.deneb_fork_epoch,
"ElectraForkEpoch": network_params.electra_fork_epoch,
"FuluForkEpoch": network_params.fulu_fork_epoch,
"Eip7732ForkEpoch": network_params.eip7732_fork_epoch,
"Eip7805ForkEpoch": network_params.eip7805_fork_epoch,
"AltairForkEpoch": "{0}".format(network_params.altair_fork_epoch),
"BellatrixForkEpoch": "{0}".format(network_params.bellatrix_fork_epoch),
"CapellaForkEpoch": "{0}".format(network_params.capella_fork_epoch),
"DenebForkEpoch": "{0}".format(network_params.deneb_fork_epoch),
"ElectraForkEpoch": "{0}".format(network_params.electra_fork_epoch),
"FuluForkEpoch": "{0}".format(network_params.fulu_fork_epoch),
"Eip7732ForkEpoch": "{0}".format(network_params.eip7732_fork_epoch),
"Eip7805ForkEpoch": "{0}".format(network_params.eip7805_fork_epoch),
"GenesisForkVersion": constants.GENESIS_FORK_VERSION,
"AltairForkVersion": constants.ALTAIR_FORK_VERSION,
"BellatrixForkVersion": constants.BELLATRIX_FORK_VERSION,
Expand All @@ -135,9 +150,21 @@ def new_env_file_for_el_cl_genesis_data(
"MaxBlobsPerBlockFulu": network_params.max_blobs_per_block_fulu,
"TargetBlobsPerBlockFulu": network_params.target_blobs_per_block_fulu,
"Preset": network_params.preset,
"AdditionalPreloadedContracts": json.encode(
network_params.additional_preloaded_contracts
),
"AdditionalPreloadedContractsFile": GENESIS_VALUES_PATH
+ "/"
+ GENESIS_CONTRACTS_FILENAME,
"PrefundedAccounts": json.encode(network_params.prefunded_accounts),
"GossipMaxSize": network_params.gossip_max_size,
}


def new_additionsl_contracts_file_for_el_cl_genesis_data(
network_params,
):
additional_contracts_json = network_params.additional_preloaded_contracts
if type(additional_contracts_json) != "string":
additional_contracts_json = json.encode(additional_contracts_json)

return {
"AdditionalPreloadedContracts": additional_contracts_json,
}
4 changes: 4 additions & 0 deletions src/static_files/static_files.star
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ STATIC_FILES_DIRPATH = "/static_files"
EL_CL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/genesis-generation-config/el-cl/values.env.tmpl"
)
EL_CL_GENESIS_ADDITIONAL_CONTRACTS_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH
+ "/genesis-generation-config/el-cl/additional-contracts.json.tmpl"
)

# EL Forkmon config
EL_FORKMON_CONFIG_TEMPLATE_FILEPATH = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ .AdditionalPreloadedContracts }}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export MAX_BLOBS_PER_BLOCK_ELECTRA={{ .MaxBlobsPerBlockElectra }}
export TARGET_BLOBS_PER_BLOCK_ELECTRA={{ .TargetBlobsPerBlockElectra }}
export MAX_BLOBS_PER_BLOCK_FULU={{ .MaxBlobsPerBlockFulu }}
export TARGET_BLOBS_PER_BLOCK_FULU={{ .TargetBlobsPerBlockFulu }}
export ADDITIONAL_PRELOADED_CONTRACTS={{ .AdditionalPreloadedContracts }}
export ADDITIONAL_PRELOADED_CONTRACTS={{ .AdditionalPreloadedContractsFile }}
export EL_PREMINE_ADDRS={{ .PrefundedAccounts }}
export GOSSIP_MAX_SIZE={{ .GossipMaxSize }}
export MAX_CHUNK_SIZE={{ .GossipMaxSize }}
Loading