From 16c57e360801ff2db7d464953ad1dc70b45d7bf9 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 9 Jan 2025 09:09:23 -0700 Subject: [PATCH 1/7] fix: Generate all addresses --- static_files/scripts/fund.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/static_files/scripts/fund.sh b/static_files/scripts/fund.sh index 760d5ce3..1a24aaf6 100644 --- a/static_files/scripts/fund.sh +++ b/static_files/scripts/fund.sh @@ -28,11 +28,6 @@ for chain_id in "${chain_ids[@]}"; do role="${roles[$index]}" role_idx=$((index+1)) - # Skip wallet addrs for anything other Proposer/Batcher/Sequencer/Challenger if not on local L1 - if [[ "${L1_NETWORK}" != "local" && $role_idx -gt 4 ]]; then - continue - fi - private_key=$(cast wallet private-key "$mnemonic" "m/44'/60'/2'/$chain_id/$role_idx") address=$(cast wallet address "${private_key}") write_keyfile "${address}" "${private_key}" "${role}-$chain_id" From a1dc74e1bc278ebb6410bb7ec8e952c6e13e683b Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 9 Jan 2025 09:13:45 -0700 Subject: [PATCH 2/7] fix launchers --- src/cl/hildr/hildr_launcher.star | 1 + src/el_cl_launcher.star | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cl/hildr/hildr_launcher.star b/src/cl/hildr/hildr_launcher.star index 39b4dbd3..b169c07f 100644 --- a/src/cl/hildr/hildr_launcher.star +++ b/src/cl/hildr/hildr_launcher.star @@ -73,6 +73,7 @@ def launch( existing_cl_clients, l1_config_env_vars, sequencer_enabled, + interop_params, ): # beacon_node_identity_recipe = PostHttpRequestRecipe( # endpoint="/", diff --git a/src/el_cl_launcher.star b/src/el_cl_launcher.star index 36588f3b..2bedd199 100644 --- a/src/el_cl_launcher.star +++ b/src/el_cl_launcher.star @@ -312,6 +312,7 @@ def launch( all_cl_contexts, l1_config_env_vars, False, + interop_params, ) all_cl_contexts.append(cl_builder_context) From 9f43a8f4e50a6c208b56a7fff3fd40dd05986613 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Wed, 8 Jan 2025 21:56:18 -0700 Subject: [PATCH 3/7] fix: Faucet address The faucet address was being shared with the deployment address, which can cause nonce conflicts. --- src/contracts/contract_deployer.star | 2 +- static_files/scripts/fund.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/contracts/contract_deployer.star b/src/contracts/contract_deployer.star index adaa9f80..166b3b57 100644 --- a/src/contracts/contract_deployer.star +++ b/src/contracts/contract_deployer.star @@ -48,7 +48,7 @@ def deploy_contracts(plan, priv_key, l1_config_env_vars, optimism_args, l1_netwo name="op-deployer-fund-script", ) - collect_fund = plan.run_sh( + plan.run_sh( name="op-deployer-fund", description="Collect keys, and fund addresses", image=utils.DEPLOYMENT_UTILS_IMAGE, diff --git a/static_files/scripts/fund.sh b/static_files/scripts/fund.sh index 1a24aaf6..f4e10acf 100644 --- a/static_files/scripts/fund.sh +++ b/static_files/scripts/fund.sh @@ -41,9 +41,10 @@ for chain_id in "${chain_ids[@]}"; do done # Add the L1 and L2 faucet information to each chain's wallet data + # Use chain 20 from the ethereum_package to prevent conflicts chain_wallets=$(echo "$chain_wallets" | jq \ - --arg addr "$addr" \ - --arg private_key "0x$PRIVATE_KEY" \ + --arg addr "0xafF0CA253b97e54440965855cec0A8a2E2399896" \ + --arg private_key "0x4b9f63ecf84210c5366c66d68fa1f5da1fa4f634fad6dfc86178e4d79ff9e59" \ '.["l1FaucetPrivateKey"] = $private_key | .["l1FaucetAddress"] = $addr') chain_wallets=$(echo "$chain_wallets" | jq \ From a7fa4bab3ce22398d7854c8f1ed339166d957522 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 9 Jan 2025 10:37:32 -0700 Subject: [PATCH 4/7] Wait for fund transactions --- src/contracts/contract_deployer.star | 4 +++- static_files/scripts/fund.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/contracts/contract_deployer.star b/src/contracts/contract_deployer.star index 166b3b57..67b7eedf 100644 --- a/src/contracts/contract_deployer.star +++ b/src/contracts/contract_deployer.star @@ -8,6 +8,8 @@ FUND_SCRIPT_FILEPATH = "../../static_files/scripts" utils = import_module("../util.star") +ethereum_package_genesis_constants = import_module("github.com/ethpandaops/ethereum-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star") + CANNED_VALUES = ( ("int", "eip1559Denominator", 50), @@ -53,7 +55,7 @@ def deploy_contracts(plan, priv_key, l1_config_env_vars, optimism_args, l1_netwo description="Collect keys, and fund addresses", image=utils.DEPLOYMENT_UTILS_IMAGE, env_vars={ - "PRIVATE_KEY": str(priv_key), + "PRIVATE_KEY": ethereum_package_genesis_constants.PRE_FUNDED_ACCOUNTS[19].private_key, "FUND_VALUE": "10ether", "L1_NETWORK": str(l1_network), } diff --git a/static_files/scripts/fund.sh b/static_files/scripts/fund.sh index f4e10acf..9fddb080 100644 --- a/static_files/scripts/fund.sh +++ b/static_files/scripts/fund.sh @@ -16,7 +16,7 @@ write_keyfile() { } send() { - cast send $1 --value "$FUND_VALUE" --private-key "$PRIVATE_KEY" --nonce "$nonce" --async + cast send $1 --value "$FUND_VALUE" --private-key "$PRIVATE_KEY" --timeout 60 --nonce "$nonce" & nonce=$((nonce+1)) } @@ -62,3 +62,5 @@ done echo "Wallet private key and addresses" echo "$wallets_json" > "/network-data/wallets.json" echo "$wallets_json" + +wait From 2848a031cd9fb02d7bf80802ab8f5f865c28ce44 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 9 Jan 2025 10:51:52 -0700 Subject: [PATCH 5/7] avoid indexing errors --- main.star | 8 +++----- src/wait/wait_for_sync.star | 12 +++++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/main.star b/main.star index fe00ae2c..94d51d9b 100644 --- a/main.star +++ b/main.star @@ -58,6 +58,9 @@ def run(plan, args): "L1_WS_URL": external_l1_args.el_ws_url, "L1_CHAIN_ID": external_l1_args.network_id, } + + plan.print("Waiting for network to sync") + wait_for_sync.wait_for_sync(plan, l1_config_env_vars) else: plan.print("Deploying a local L1") l1 = ethereum_package.run(plan, ethereum_args) @@ -74,13 +77,8 @@ def run(plan, args): l1_config_env_vars = get_l1_config( all_l1_participants, l1_network_params, l1_network_id ) - - if l1_network == "kurtosis": plan.print("Waiting for L1 to start up") wait_for_sync.wait_for_startup(plan, l1_config_env_vars) - else: - plan.print("Waiting for network to sync") - wait_for_sync.wait_for_sync(plan, l1_config_env_vars) deployment_output = contract_deployer.deploy_contracts( plan, diff --git a/src/wait/wait_for_sync.star b/src/wait/wait_for_sync.star index 8448afc5..1d8c95ba 100644 --- a/src/wait/wait_for_sync.star +++ b/src/wait/wait_for_sync.star @@ -26,10 +26,20 @@ def wait_for_sync(plan, l1_config_env_vars): def wait_for_startup(plan, l1_config_env_vars): plan.run_sh( - name="wait-for-l1-startup", + name="wait-for-l1-consensus-startup", description="Wait for L1 to start up - can take up to 2 minutes", image=utils.DEPLOYMENT_UTILS_IMAGE, env_vars=l1_config_env_vars, run="while true; do sleep 5; echo 'L1 Chain is starting up'; if [ \"$(curl -s $CL_RPC_URL/eth/v1/beacon/headers/ | jq -r '.data[0].header.message.slot')\" != \"0\" ]; then echo 'L1 Chain has started!'; break; fi; done", wait="300s", ) + + # wait for block 3 to avoid transaction indexing in progress errors + plan.run_sh( + name="wait-for-l1-execution-startup", + description="Wait for L1 execution to start up - can take up to 2 minutes", + image=utils.DEPLOYMENT_UTILS_IMAGE, + env_vars=l1_config_env_vars, + run='while true; do sleep 5; current_head=$(cast bn --rpc-url=$L1_RPC_URL); echo "L1 Execution is starting up"; if [ "$current_head" -ge "3" ]; then echo "L1 Execution has started!"; break; fi; done', + wait="5m" + ) From 939f100448c3bf3e3c79e2371ce6fe1b577b9ed4 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 9 Jan 2025 10:52:13 -0700 Subject: [PATCH 6/7] missing 0 --- static_files/scripts/fund.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static_files/scripts/fund.sh b/static_files/scripts/fund.sh index 9fddb080..a13694a7 100644 --- a/static_files/scripts/fund.sh +++ b/static_files/scripts/fund.sh @@ -44,7 +44,7 @@ for chain_id in "${chain_ids[@]}"; do # Use chain 20 from the ethereum_package to prevent conflicts chain_wallets=$(echo "$chain_wallets" | jq \ --arg addr "0xafF0CA253b97e54440965855cec0A8a2E2399896" \ - --arg private_key "0x4b9f63ecf84210c5366c66d68fa1f5da1fa4f634fad6dfc86178e4d79ff9e59" \ + --arg private_key "0x04b9f63ecf84210c5366c66d68fa1f5da1fa4f634fad6dfc86178e4d79ff9e59" \ '.["l1FaucetPrivateKey"] = $private_key | .["l1FaucetAddress"] = $addr') chain_wallets=$(echo "$chain_wallets" | jq \ From 699a1c26e333c4158ddaaa49ee4269db2ed5cedc Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 9 Jan 2025 10:53:05 -0700 Subject: [PATCH 7/7] lint --- src/contracts/contract_deployer.star | 8 ++++++-- src/wait/wait_for_sync.star | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/contracts/contract_deployer.star b/src/contracts/contract_deployer.star index 67b7eedf..61be674b 100644 --- a/src/contracts/contract_deployer.star +++ b/src/contracts/contract_deployer.star @@ -8,7 +8,9 @@ FUND_SCRIPT_FILEPATH = "../../static_files/scripts" utils = import_module("../util.star") -ethereum_package_genesis_constants = import_module("github.com/ethpandaops/ethereum-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star") +ethereum_package_genesis_constants = import_module( + "github.com/ethpandaops/ethereum-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star" +) CANNED_VALUES = ( @@ -55,7 +57,9 @@ def deploy_contracts(plan, priv_key, l1_config_env_vars, optimism_args, l1_netwo description="Collect keys, and fund addresses", image=utils.DEPLOYMENT_UTILS_IMAGE, env_vars={ - "PRIVATE_KEY": ethereum_package_genesis_constants.PRE_FUNDED_ACCOUNTS[19].private_key, + "PRIVATE_KEY": ethereum_package_genesis_constants.PRE_FUNDED_ACCOUNTS[ + 19 + ].private_key, "FUND_VALUE": "10ether", "L1_NETWORK": str(l1_network), } diff --git a/src/wait/wait_for_sync.star b/src/wait/wait_for_sync.star index 1d8c95ba..8f731f2e 100644 --- a/src/wait/wait_for_sync.star +++ b/src/wait/wait_for_sync.star @@ -41,5 +41,5 @@ def wait_for_startup(plan, l1_config_env_vars): image=utils.DEPLOYMENT_UTILS_IMAGE, env_vars=l1_config_env_vars, run='while true; do sleep 5; current_head=$(cast bn --rpc-url=$L1_RPC_URL); echo "L1 Execution is starting up"; if [ "$current_head" -ge "3" ]; then echo "L1 Execution has started!"; break; fi; done', - wait="5m" + wait="5m", )