Commit cb58b659 authored by Parithosh Jayanthi's avatar Parithosh Jayanthi Committed by GitHub

feat: Adding arbitrary contract definition (#646)

Co-authored-by: default avatarBarnabas Busa <busa.barnabas@gmail.com>
Co-authored-by: default avatarpk910 <philipp@pk910.de>
Co-authored-by: default avatarBarnabas Busa <barnabas.busa@ethereum.org>
parent 20fef708
participants:
- el_type: geth
cl_type: teku
- el_type: nethermind
cl_type: prysm
- el_type: erigon
cl_type: nimbus
- el_type: besu
cl_type: lighthouse
- el_type: reth
cl_type: lodestar
- el_type: ethereumjs
cl_type: teku
network_params:
network: kurtosis
additional_preloaded_contracts: '{"0x123463a4B065722E99115D6c222f267d9cABb524": {"balance": "2ETH","code": "0x1234","storage": {}}}'
additional_services: []
...@@ -564,6 +564,15 @@ network_params: ...@@ -564,6 +564,15 @@ network_params:
# For an example of minimal preset, please refer to [minimal.yaml](.github/tests/minimal.yaml) # For an example of minimal preset, please refer to [minimal.yaml](.github/tests/minimal.yaml)
preset: "mainnet" preset: "mainnet"
# Preloaded contracts for the chain
additional_preloaded_contracts: {}
# example: To set a contract code at a certain address:
# "0x123463a4B065722E99115D6c222f267d9cABb524":
# balance: "1ETH"
# code: "0x1234"
# storage: {}
# nonce: 0
# secretKey: "0x"
# Global parameters for the network # Global parameters for the network
......
...@@ -14,7 +14,7 @@ participants: ...@@ -14,7 +14,7 @@ participants:
el_max_mem: 0 el_max_mem: 0
# CL # CL
cl_type: lighthouse cl_type: lighthouse
cl_image: sigp/lighthouse:latest cl_image: sigp/lighthouse:latest-unstable
cl_log_level: "" cl_log_level: ""
cl_extra_env_vars: {} cl_extra_env_vars: {}
cl_extra_labels: {} cl_extra_labels: {}
...@@ -28,7 +28,7 @@ participants: ...@@ -28,7 +28,7 @@ participants:
use_separate_vc: true use_separate_vc: true
# Validator # Validator
vc_type: lighthouse vc_type: lighthouse
vc_image: sigp/lighthouse:latest vc_image: sigp/lighthouse:latest-unstable
vc_log_level: "" vc_log_level: ""
vc_count: 1 vc_count: 1
vc_extra_env_vars: {} vc_extra_env_vars: {}
...@@ -81,6 +81,7 @@ network_params: ...@@ -81,6 +81,7 @@ network_params:
samples_per_slot: 8 samples_per_slot: 8
custody_requirement: 1 custody_requirement: 1
target_number_of_peers: 70 target_number_of_peers: 70
additional_preloaded_contracts: {}
additional_services: additional_services:
- tx_spammer - tx_spammer
- blob_spammer - blob_spammer
......
...@@ -88,7 +88,7 @@ EIP7594_FORK_VERSION = "0x70000038" ...@@ -88,7 +88,7 @@ EIP7594_FORK_VERSION = "0x70000038"
ETHEREUM_GENESIS_GENERATOR = struct( ETHEREUM_GENESIS_GENERATOR = struct(
capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Deprecated (no support for minimal config) capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Deprecated (no support for minimal config)
deneb_genesis="ethpandaops/ethereum-genesis-generator:3.1.6", # Default deneb_genesis="ethpandaops/ethereum-genesis-generator:3.2.1", # Default
verkle_support_genesis="ethpandaops/ethereum-genesis-generator:3.0.0-rc.19", # soon to be deneb genesis, waiting for rebase 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", verkle_genesis="ethpandaops/ethereum-genesis-generator:verkle-gen-v1.0.0",
) )
...@@ -380,7 +380,7 @@ RAM_CPU_OVERRIDES = { ...@@ -380,7 +380,7 @@ RAM_CPU_OVERRIDES = {
"geth_max_cpu": 1000, # 1 core "geth_max_cpu": 1000, # 1 core
"erigon_max_mem": 1024, # 1GB "erigon_max_mem": 1024, # 1GB
"erigon_max_cpu": 1000, # 1 core "erigon_max_cpu": 1000, # 1 core
"nethermind_max_mem": 1024, # 1GB "nethermind_max_mem": 2048, # 2GB
"nethermind_max_cpu": 1000, # 1 core "nethermind_max_cpu": 1000, # 1 core
"besu_max_mem": 1024, # 1GB "besu_max_mem": 1024, # 1GB
"besu_max_cpu": 1000, # 1 core "besu_max_cpu": 1000, # 1 core
......
...@@ -15,7 +15,7 @@ DEFAULT_EL_IMAGES = { ...@@ -15,7 +15,7 @@ DEFAULT_EL_IMAGES = {
} }
DEFAULT_CL_IMAGES = { DEFAULT_CL_IMAGES = {
"lighthouse": "sigp/lighthouse:latest", "lighthouse": "ethpandaops/lighthouse:stable",
"teku": "consensys/teku:latest", "teku": "consensys/teku:latest",
"nimbus": "statusim/nimbus-eth2:multiarch-latest", "nimbus": "statusim/nimbus-eth2:multiarch-latest",
"prysm": "gcr.io/prysmaticlabs/prysm/beacon-chain:latest", "prysm": "gcr.io/prysmaticlabs/prysm/beacon-chain:latest",
...@@ -24,7 +24,7 @@ DEFAULT_CL_IMAGES = { ...@@ -24,7 +24,7 @@ DEFAULT_CL_IMAGES = {
} }
DEFAULT_CL_IMAGES_MINIMAL = { DEFAULT_CL_IMAGES_MINIMAL = {
"lighthouse": "ethpandaops/lighthouse:stable-minimal", "lighthouse": "ethpandaops/lighthouse:stable",
"teku": "consensys/teku:latest", "teku": "consensys/teku:latest",
"nimbus": "ethpandaops/nimbus-eth2:stable-minimal", "nimbus": "ethpandaops/nimbus-eth2:stable-minimal",
"prysm": "ethpandaops/prysm-beacon-chain:develop-minimal", "prysm": "ethpandaops/prysm-beacon-chain:develop-minimal",
...@@ -33,7 +33,7 @@ DEFAULT_CL_IMAGES_MINIMAL = { ...@@ -33,7 +33,7 @@ DEFAULT_CL_IMAGES_MINIMAL = {
} }
DEFAULT_VC_IMAGES = { DEFAULT_VC_IMAGES = {
"lighthouse": "sigp/lighthouse:latest", "lighthouse": "ethpandaops/lighthouse:stable",
"lodestar": "chainsafe/lodestar:latest", "lodestar": "chainsafe/lodestar:latest",
"nimbus": "statusim/nimbus-validator-client:multiarch-latest", "nimbus": "statusim/nimbus-validator-client:multiarch-latest",
"prysm": "gcr.io/prysmaticlabs/prysm/validator:latest", "prysm": "gcr.io/prysmaticlabs/prysm/validator:latest",
...@@ -42,7 +42,7 @@ DEFAULT_VC_IMAGES = { ...@@ -42,7 +42,7 @@ DEFAULT_VC_IMAGES = {
} }
DEFAULT_VC_IMAGES_MINIMAL = { DEFAULT_VC_IMAGES_MINIMAL = {
"lighthouse": "ethpandaops/lighthouse:stable-minimal", "lighthouse": "ethpandaops/lighthouse:stable",
"lodestar": "chainsafe/lodestar:latest", "lodestar": "chainsafe/lodestar:latest",
"nimbus": "ethpandaops/nimbus-validator-client:stable-minimal", "nimbus": "ethpandaops/nimbus-validator-client:stable-minimal",
"prysm": "ethpandaops/prysm-validator:develop-minimal", "prysm": "ethpandaops/prysm-validator:develop-minimal",
...@@ -292,6 +292,9 @@ def input_parser(plan, input_args): ...@@ -292,6 +292,9 @@ def input_parser(plan, input_args):
custody_requirement=result["network_params"]["custody_requirement"], custody_requirement=result["network_params"]["custody_requirement"],
target_number_of_peers=result["network_params"]["target_number_of_peers"], target_number_of_peers=result["network_params"]["target_number_of_peers"],
preset=result["network_params"]["preset"], preset=result["network_params"]["preset"],
additional_preloaded_contracts=result["network_params"][
"additional_preloaded_contracts"
],
), ),
mev_params=struct( mev_params=struct(
mev_relay_image=result["mev_params"]["mev_relay_image"], mev_relay_image=result["mev_params"]["mev_relay_image"],
...@@ -789,6 +792,7 @@ def default_network_params(): ...@@ -789,6 +792,7 @@ def default_network_params():
"custody_requirement": 1, "custody_requirement": 1,
"target_number_of_peers": 70, "target_number_of_peers": 70,
"preset": "mainnet", "preset": "mainnet",
"additional_preloaded_contracts": {},
} }
...@@ -818,6 +822,7 @@ def default_minimal_network_params(): ...@@ -818,6 +822,7 @@ def default_minimal_network_params():
"custody_requirement": 1, "custody_requirement": 1,
"target_number_of_peers": 70, "target_number_of_peers": 70,
"preset": "minimal", "preset": "minimal",
"additional_preloaded_contracts": {},
} }
......
...@@ -112,6 +112,7 @@ def launch_participant_network( ...@@ -112,6 +112,7 @@ def launch_participant_network(
network_params.custody_requirement, network_params.custody_requirement,
network_params.target_number_of_peers, network_params.target_number_of_peers,
network_params.preset, network_params.preset,
network_params.additional_preloaded_contracts,
) )
elif network_params.network in constants.PUBLIC_NETWORKS: elif network_params.network in constants.PUBLIC_NETWORKS:
# We are running a public network # We are running a public network
......
...@@ -36,6 +36,7 @@ def generate_el_cl_genesis_data( ...@@ -36,6 +36,7 @@ def generate_el_cl_genesis_data(
custody_requirement, custody_requirement,
target_number_of_peers, target_number_of_peers,
preset, preset,
additional_preloaded_contracts,
): ):
files = {} files = {}
shadowfork_file = "" shadowfork_file = ""
...@@ -67,6 +68,7 @@ def generate_el_cl_genesis_data( ...@@ -67,6 +68,7 @@ def generate_el_cl_genesis_data(
custody_requirement, custody_requirement,
target_number_of_peers, target_number_of_peers,
preset, preset,
additional_preloaded_contracts,
) )
genesis_generation_template = shared_utils.new_template_and_data( genesis_generation_template = shared_utils.new_template_and_data(
genesis_generation_config_yml_template, template_data genesis_generation_config_yml_template, template_data
...@@ -86,7 +88,7 @@ def generate_el_cl_genesis_data( ...@@ -86,7 +88,7 @@ def generate_el_cl_genesis_data(
genesis = plan.run_sh( genesis = plan.run_sh(
description="Creating genesis", description="Creating genesis",
run="cp /opt/values.env /config/values.env && ./entrypoint.sh all && mkdir /network-configs && mv /data/custom_config_data/* /network-configs/", run="cp /opt/values.env /config/values.env && ./entrypoint.sh all && mkdir /network-configs && mv /data/metadata/* /network-configs/",
image=image, image=image,
files=files, files=files,
store=[ store=[
...@@ -154,6 +156,7 @@ def new_env_file_for_el_cl_genesis_data( ...@@ -154,6 +156,7 @@ def new_env_file_for_el_cl_genesis_data(
custody_requirement, custody_requirement,
target_number_of_peers, target_number_of_peers,
preset, preset,
additional_preloaded_contracts,
): ):
return { return {
"UnixTimestamp": genesis_unix_timestamp, "UnixTimestamp": genesis_unix_timestamp,
...@@ -184,4 +187,5 @@ def new_env_file_for_el_cl_genesis_data( ...@@ -184,4 +187,5 @@ def new_env_file_for_el_cl_genesis_data(
"CustodyRequirement": custody_requirement, "CustodyRequirement": custody_requirement,
"TargetNumberOfPeers": target_number_of_peers, "TargetNumberOfPeers": target_number_of_peers,
"Preset": preset, "Preset": preset,
"AdditionalPreloadedContracts": json.encode(additional_preloaded_contracts),
} }
...@@ -31,3 +31,4 @@ export DATA_COLUMN_SIDECAR_SUBNET_COUNT={{ .DataColumnSidecarSubnetCount }} ...@@ -31,3 +31,4 @@ export DATA_COLUMN_SIDECAR_SUBNET_COUNT={{ .DataColumnSidecarSubnetCount }}
export SAMPLES_PER_SLOT={{ .SamplesPerSlot }} export SAMPLES_PER_SLOT={{ .SamplesPerSlot }}
export CUSTODY_REQUIREMENT={{ .CustodyRequirement }} export CUSTODY_REQUIREMENT={{ .CustodyRequirement }}
export TARGET_NUMBER_OF_PEERS={{ .TargetNumberOfPeers }} export TARGET_NUMBER_OF_PEERS={{ .TargetNumberOfPeers }}
export ADDITIONAL_PRELOADED_CONTRACTS={{ .AdditionalPreloadedContracts }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment