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

feat: add prefunded accounts #752

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,18 +533,32 @@ network_params:

# Preloaded contracts for the chain
additional_preloaded_contracts: {}
# example: To set a contract code at a certain address:
# Example:
# additional_preloaded_contracts: '{
# "0x123463a4B065722E99115D6c222f267d9cABb524":
# balance: "1ETH"
# code: "0x1234"
# storage: {}
# nonce: 0
# secretKey: "0x"
# {
# balance: "1ETH",
# code: "0x1234",
# storage: {},
# nonce: 0,
# secretKey: "0x",
# }
# }'

# Repository override for devnet networks
# Default: ethpandaops
devnet_repo: ethpandaops

# A number of prefunded accounts to be created
# Defaults to no prefunded accounts
# Example:
# prefunded_accounts: '{"0x25941dC771bB64514Fc8abBce970307Fb9d477e9": {"balance": "10ETH"}}'
# 10ETH to the account 0x25941dC771bB64514Fc8abBce970307Fb9d477e9
# To prefund multiple accounts, separate them with a comma
#
# prefunded_accounts: '{"0x25941dC771bB64514Fc8abBce970307Fb9d477e9": {"balance": "10ETH"}, "0x4107be99052d895e3ee461C685b042Aa975ab5c0": {"balance": "1ETH"}}'
prefunded_accounts: {}

# Global parameters for the network

# By default includes
Expand Down
1 change: 1 addition & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ network_params:
max_blobs_per_block: 6
additional_preloaded_contracts: {}
devnet_repo: ethpandaops
prefunded_accounts: {}
additional_services: []
dora_params:
image: ""
Expand Down
3 changes: 3 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def input_parser(plan, input_args):
"additional_preloaded_contracts"
],
devnet_repo=result["network_params"]["devnet_repo"],
prefunded_accounts=result["network_params"]["prefunded_accounts"],
),
mev_params=struct(
mev_relay_image=result["mev_params"]["mev_relay_image"],
Expand Down Expand Up @@ -811,6 +812,7 @@ def default_network_params():
"preset": "mainnet",
"additional_preloaded_contracts": {},
"devnet_repo": "ethpandaops",
"prefunded_accounts": {},
}


Expand Down Expand Up @@ -844,6 +846,7 @@ def default_minimal_network_params():
"preset": "minimal",
"additional_preloaded_contracts": {},
"devnet_repo": "ethpandaops",
"prefunded_accounts": {},
}


Expand Down
1 change: 1 addition & 0 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ SUBCATEGORY_PARAMS = {
"preset",
"additional_preloaded_contracts",
"devnet_repo",
"prefunded_accounts",
],
"dora_params": [
"image",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ def new_env_file_for_el_cl_genesis_data(
"AdditionalPreloadedContracts": json.encode(
network_params.additional_preloaded_contracts
),
"PrefundedAccounts": json.encode(network_params.prefunded_accounts),
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ export SAMPLES_PER_SLOT={{ .SamplesPerSlot }}
export CUSTODY_REQUIREMENT={{ .CustodyRequirement }}
export MAX_BLOBS_PER_BLOCK={{ .MaxBlobsPerBlock }}
export ADDITIONAL_PRELOADED_CONTRACTS={{ .AdditionalPreloadedContracts }}
export EL_PREMINE_ADDRS={{ .PrefundedAccounts }}