From 55dd03c84c6ef7624ed3512b4d69b95c13b3af90 Mon Sep 17 00:00:00 2001 From: Maddiaa <47148561+Maddiaa0@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:52:15 +0800 Subject: [PATCH] feat: consensus layer in spartan (#11105) --- .github/workflows/ci.yml | 2 +- .github/workflows/devnet-deploy.yml | 2 +- .yarn/install-state.gz | Bin 0 -> 719 bytes package.json | 3 + spartan/aztec-network/.gitignore | 1 + spartan/aztec-network/eth-devnet/README.md | 62 + .../eth-devnet/config/config.yaml | 144 +++ .../eth-devnet/config/genesis.json | 1078 +++++++++++++++++ .../eth-devnet/config/jwt-secret.hex | 1 + .../eth-devnet/config/mnemonics.yaml | 3 + spartan/aztec-network/eth-devnet/create.sh | 173 +++ .../aztec-network/files/config/genesis.json | 179 --- .../files/config/setup-service-addresses.sh | 4 +- spartan/aztec-network/templates/_helpers.tpl | 4 +- .../aztec-network/templates/boot-node.yaml | 24 - .../templates/deploy-l1-verifier.yaml | 4 +- .../aztec-network/templates/eth-beacon.yaml | 120 ++ .../templates/eth-execution.yaml | 121 ++ .../templates/eth-validator.yaml | 101 ++ spartan/aztec-network/templates/reth.yaml | 172 --- .../templates/setup-l2-contracts.yaml | 4 +- spartan/aztec-network/values.yaml | 39 +- spartan/aztec-network/values/ci-smoke.yaml | 28 +- spartan/aztec-network/values/ci.yaml | 30 +- .../end-to-end/scripts/network_test.sh | 44 +- .../end-to-end/src/spartan/4epochs.test.ts | 2 +- .../src/spartan/gating-passive.test.ts | 2 +- .../end-to-end/src/spartan/reorg.test.ts | 2 +- .../end-to-end/src/spartan/smoke.test.ts | 2 +- .../ethereum/src/deploy_l1_contracts.ts | 2 + yarn-project/telemetry-client/package.json | 2 +- yarn.lock | 12 + 32 files changed, 1958 insertions(+), 409 deletions(-) create mode 100644 .yarn/install-state.gz create mode 100644 package.json create mode 100644 spartan/aztec-network/.gitignore create mode 100644 spartan/aztec-network/eth-devnet/README.md create mode 100644 spartan/aztec-network/eth-devnet/config/config.yaml create mode 100644 spartan/aztec-network/eth-devnet/config/genesis.json create mode 100644 spartan/aztec-network/eth-devnet/config/jwt-secret.hex create mode 100644 spartan/aztec-network/eth-devnet/config/mnemonics.yaml create mode 100755 spartan/aztec-network/eth-devnet/create.sh delete mode 100644 spartan/aztec-network/files/config/genesis.json create mode 100644 spartan/aztec-network/templates/eth-beacon.yaml create mode 100644 spartan/aztec-network/templates/eth-execution.yaml create mode 100644 spartan/aztec-network/templates/eth-validator.yaml delete mode 100644 spartan/aztec-network/templates/reth.yaml create mode 100644 yarn.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33e2e7fbeca..8207b1de618 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,7 +373,7 @@ jobs: uses: ./.github/ensure-tester with: username: ${{ needs.configure.outputs.username }} - runner_type: 8core-tester-x86 + runner_type: 16core-tester-x86 ttl: 60 run: | until docker info &>/dev/null; do sleep 1; done diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 73e70ae5e1a..04a22d5713f 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -111,7 +111,7 @@ jobs: PXE_PORT="$(jq -r .pxe.service.nodePort helm_values.json)" FAUCET_PORT="$(jq -r .faucet.apiServerPort helm_values.json)" - ETHEREUM_PORT="$(jq -r .ethereum.service.port helm_values.json)" + ETHEREUM_PORT="$(jq -r .ethereum.execution.service.port helm_values.json)" L1_CHAIN_ID="$(jq -r .ethereum.chainId helm_values.json)" MNEMONIC="$(jq -r .aztec.l1DeploymentMnemonic helm_values.json)" diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz new file mode 100644 index 0000000000000000000000000000000000000000..3c5726bddda6971f2d267efe200e7ce6a0c0d010 GIT binary patch literal 719 zcmV;=0x$e5` zRK}CGAmugqXJ0SL?ZQ~8y`%|sQb|Q;P)IbvvY=^{HW?9;P>#lsyn`6H(!qpi6`^q6)=N|LA1byaZDr~rIk#PWrZ>zCHvbi_1##? z^y)(y*LCoKuV~PWOR|a&BHriyU&~0Aqt6#e4jyuCk8hUk-si6Wj%_7}Jl!u&7C;oyFg?#e7Y8!_RC8U8*GjBCByWiftCtp4+-bx$zJ~r444K}%n+Y_3u!KOB|ryLH5;~5T^ zBWCEZZo&8n_ys3FgWvv>dH(=kgr;lq9PMV+?vca3!1_(s!*~{0W>S$=Trt000lG BV}1Yt literal 0 HcmV?d00001 diff --git a/package.json b/package.json new file mode 100644 index 00000000000..50a9e525b6a --- /dev/null +++ b/package.json @@ -0,0 +1,3 @@ +{ + "packageManager": "yarn@4.5.2" +} diff --git a/spartan/aztec-network/.gitignore b/spartan/aztec-network/.gitignore new file mode 100644 index 00000000000..466e24805a9 --- /dev/null +++ b/spartan/aztec-network/.gitignore @@ -0,0 +1 @@ +out/ \ No newline at end of file diff --git a/spartan/aztec-network/eth-devnet/README.md b/spartan/aztec-network/eth-devnet/README.md new file mode 100644 index 00000000000..786be2137e0 --- /dev/null +++ b/spartan/aztec-network/eth-devnet/README.md @@ -0,0 +1,62 @@ +## Eth Devnet + +### Usage + +```bash +./create.sh +``` + +## Args + +Args can be supplied via environment variables. + +### NUMBER_OF_KEYS + +This determines the number of accounts that will be prefunded with eth on the execution layer. + +### MNEMONIC + +The seed phrase from which the keys will be derived. + +### BLOCK_TIME + +The time in seconds between blocks. + +### GAS_LIMIT + +The gas limit for the execution layer. + +### CHAIN_ID + +The chain id for the execution layer. + +--- + +## Common Pitfalls + +If you are struggling to get the network up and running, it is usually due to the genesis.json file having different values from the config.yaml + genesis.ssz file. Make sure that you do not edit any of them by accident after ./create.sh is run. +Note that this script places the configuration values within the /out folder, it will not actually run the testnet. + +SSZ files are not passable thorugh config maps, so they must be base64 encoded, then decoded in the container before running. + +Generating an Ethereum testnet requires a few ingredients: + +## Genesis.json file + +The genesis.json file configures the initial state of the execution layer, it defines what accounts are preloaded with what balances, what hardforks are active etc. +In this case the most important values to set are the deposit contract (ensuring that it is filled with empty state ( and an empty deposit tree )), and the allocation accounts we would like to have preloaded with funds. + +## Config.yaml + +The config.yaml file is used to configure a beacon chain client. It configures what contract address the deposit contract should be read on, as well as configuring when hardforks should be activated. + +## Genesis.ssz + +This file contains the state of the beacon chain at the genesis block, and it is used to bootstrap the network, such as the validator registry at the time of genesis, the deposit root from eth1 at the time of genesis etc. + +## Other files + +### Jwt secret + +The jwt secret is used to authenticate the beacon chain client to the execution layer. +The execution api ports should not be exposed to the open internet. diff --git a/spartan/aztec-network/eth-devnet/config/config.yaml b/spartan/aztec-network/eth-devnet/config/config.yaml new file mode 100644 index 00000000000..2bd8fc02652 --- /dev/null +++ b/spartan/aztec-network/eth-devnet/config/config.yaml @@ -0,0 +1,144 @@ +# Minimal config - from github.com/ethereum-optimism/optimism + +# Extends the minimal preset +PRESET_BASE: "minimal" + +# Free-form short name of the network that this configuration applies to - known +# canonical network names include: +# * 'mainnet' - there can be only one +# * 'prater' - testnet +# Must match the regex: [a-z0-9\-] +CONFIG_NAME: "minimal" + +# Transition +# --------------------------------------------------------------- +# 2**256-2**10 for testing minimal network +TERMINAL_TOTAL_DIFFICULTY: 115792089237316195423570985008687907853269984665640564039457584007913129638912 +# By default, don't use these params +TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000 +TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 + +# Genesis +# --------------------------------------------------------------- +# [customized] +MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 64 +# Jan 3, 2020 +MIN_GENESIS_TIME: 1578009600 +# Highest byte set to 0xFF, this is dev network +GENESIS_FORK_VERSION: 0x000000FF +# [customized] don't wait with genesis if we don't have to +GENESIS_DELAY: 0 + +# Forking +# --------------------------------------------------------------- +# Values provided for illustrative purposes. +# Individual tests/testnets may set different values. + +# Altair +ALTAIR_FORK_VERSION: 0x01000001 +ALTAIR_FORK_EPOCH: 0 +# Bellatrix +BELLATRIX_FORK_VERSION: 0x02000001 +BELLATRIX_FORK_EPOCH: 0 +# Capella +CAPELLA_FORK_VERSION: 0x03000001 +CAPELLA_FORK_EPOCH: 0 +# DENEB +DENEB_FORK_VERSION: 0x04000001 +DENEB_FORK_EPOCH: 0 + +# EIP6110 +EIP6110_FORK_VERSION: 0x05000001 +EIP6110_FORK_EPOCH: 18446744073709551615 +# EIP7002 +EIP7002_FORK_VERSION: 0x05000001 +EIP7002_FORK_EPOCH: 18446744073709551615 +# WHISK +WHISK_FORK_VERSION: 0x06000001 +WHISK_FORK_EPOCH: 18446744073709551615 + +# Time parameters +# --------------------------------------------------------------- +# [customized] Faster for testing purposes +SECONDS_PER_SLOT: 12 +# 14 (estimate from Eth1 mainnet) +SECONDS_PER_ETH1_BLOCK: 12 +# 2**8 (= 256) epochs +MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 +# [customized] higher frequency of committee turnover and faster time to acceptable voluntary exit +SHARD_COMMITTEE_PERIOD: 64 +# [customized] process deposits more quickly, but insecure +ETH1_FOLLOW_DISTANCE: 16 + +# Validator cycle +# --------------------------------------------------------------- +# 2**2 (= 4) +INACTIVITY_SCORE_BIAS: 4 +# 2**4 (= 16) +INACTIVITY_SCORE_RECOVERY_RATE: 16 +# 2**4 * 10**9 (= 16,000,000,000) Gwei +EJECTION_BALANCE: 16000000000 +# [customized] more easily demonstrate the difference between this value and the activation churn limit +MIN_PER_EPOCH_CHURN_LIMIT: 2 +# [customized] scale queue churn at much lower validator counts for testing +CHURN_LIMIT_QUOTIENT: 32 +# [New in Deneb:EIP7514] [customized] +MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 4 + +# Fork choice +# --------------------------------------------------------------- +# 40% +PROPOSER_SCORE_BOOST: 40 +# 20% +REORG_HEAD_WEIGHT_THRESHOLD: 20 +# 160% +REORG_PARENT_WEIGHT_THRESHOLD: 160 +# `2` epochs +REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2 + +# Deposit contract +# --------------------------------------------------------------- +# Local Optimism monorepo devnet +DEPOSIT_CHAIN_ID: 1337 +DEPOSIT_NETWORK_ID: 1337 +# Configured on a per testnet basis +DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242 + +# Networking +# --------------------------------------------------------------- +# `10 * 2**20` (= 10485760, 10 MiB) +GOSSIP_MAX_SIZE: 10485760 +# `2**10` (= 1024) +MAX_REQUEST_BLOCKS: 1024 +# `2**8` (= 256) +EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 +# [customized] `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 272) +MIN_EPOCHS_FOR_BLOCK_REQUESTS: 272 +# `10 * 2**20` (=10485760, 10 MiB) +MAX_CHUNK_SIZE: 10485760 +# 5s +TTFB_TIMEOUT: 5 +# 10s +RESP_TIMEOUT: 10 +ATTESTATION_PROPAGATION_SLOT_RANGE: 32 +# 500ms +MAXIMUM_GOSSIP_CLOCK_DISPARITY: 500 +MESSAGE_DOMAIN_INVALID_SNAPPY: 0x00000000 +MESSAGE_DOMAIN_VALID_SNAPPY: 0x01000000 +# 2 subnets per node +SUBNETS_PER_NODE: 2 +# 2**8 (= 64) +ATTESTATION_SUBNET_COUNT: 64 +ATTESTATION_SUBNET_EXTRA_BITS: 0 +# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +ATTESTATION_SUBNET_PREFIX_BITS: 6 + +# Deneb +# `2**7` (=128) +MAX_REQUEST_BLOCKS_DENEB: 128 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK +MAX_REQUEST_BLOB_SIDECARS: 768 +# `2**12` (= 4096 epochs, ~18 days) +MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 +# `6` +BLOB_SIDECAR_SUBNET_COUNT: 6 diff --git a/spartan/aztec-network/eth-devnet/config/genesis.json b/spartan/aztec-network/eth-devnet/config/genesis.json new file mode 100644 index 00000000000..9566e2ff7d3 --- /dev/null +++ b/spartan/aztec-network/eth-devnet/config/genesis.json @@ -0,0 +1,1078 @@ +{ + "config": { + "chainId": 1337, + "homesteadBlock": 0, + "eip150Block": 0, + "eip155Block": 0, + "eip158Block": 0, + "byzantiumBlock": 0, + "constantinopleBlock": 0, + "petersburgBlock": 0, + "istanbulBlock": 0, + "berlinBlock": 0, + "londonBlock": 0, + "mergeNetsplitBlock": 0, + "depositContractAddress": "0x0000000000000000000000000000000000000000", + "terminalTotalDifficulty": 0, + "terminalTotalDifficultyPassed": true, + "shanghaiTime": 0, + "cancunTime": 0 + }, + "alloc": { + "0x3fab184622dc19b6109349b94811493bf2a45362": { + "balance": "1000000000000000000000000000" + }, + "0x0000000000000000000000000000000000000000": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000001": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000002": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000003": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000004": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000005": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000006": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000007": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000008": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000009": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000010": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000011": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000012": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000013": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000014": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000015": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000016": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000017": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000018": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000019": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000020": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000021": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000022": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000023": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000024": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000025": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000026": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000027": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000028": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000029": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000030": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000031": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000032": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000033": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000034": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000035": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000036": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000037": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000038": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000039": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000040": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000041": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000042": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000043": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000044": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000045": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000046": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000047": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000048": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000049": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000050": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000051": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000052": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000053": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000054": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000055": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000056": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000057": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000058": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000059": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000060": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000061": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000062": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000063": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000064": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000065": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000066": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000067": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000068": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000069": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000070": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000071": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000072": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000073": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000074": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000075": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000076": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000077": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000078": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000079": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000080": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000081": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000082": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000083": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000084": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000085": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000086": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000087": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000088": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000089": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000090": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000091": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000092": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000093": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000094": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000095": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000096": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000097": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000098": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000099": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009f": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000aa": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ab": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ac": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ad": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ae": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000af": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ba": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000be": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bf": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ca": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ce": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cf": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000da": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000db": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000dc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000dd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000de": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000df": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ea": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000eb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ec": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ed": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ee": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ef": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fa": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fe": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ff": { + "balance": "1" + }, + "0x4242424242424242424242424242424242424242": { + "balance": "0", + "nonce": 1, + "code": "0x60806040526004361061003f5760003560e01c806301ffc9a71461004457806322895118146100a4578063621fd130146101ba578063c5f2892f14610244575b600080fd5b34801561005057600080fd5b506100906004803603602081101561006757600080fd5b50357fffffffff000000000000000000000000000000000000000000000000000000001661026b565b604080519115158252519081900360200190f35b6101b8600480360360808110156100ba57600080fd5b8101906020810181356401000000008111156100d557600080fd5b8201836020820111156100e757600080fd5b8035906020019184600183028401116401000000008311171561010957600080fd5b91939092909160208101903564010000000081111561012757600080fd5b82018360208201111561013957600080fd5b8035906020019184600183028401116401000000008311171561015b57600080fd5b91939092909160208101903564010000000081111561017957600080fd5b82018360208201111561018b57600080fd5b803590602001918460018302840111640100000000831117156101ad57600080fd5b919350915035610304565b005b3480156101c657600080fd5b506101cf6110b5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102095781810151838201526020016101f1565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b506102596110c7565b60408051918252519081900360200190f35b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f8564090700000000000000000000000000000000000000000000000000000000145b92915050565b6030861461035d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118056026913960400191505060405180910390fd5b602084146103b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061179c6036913960400191505060405180910390fd5b6060821461040f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806118786029913960400191505060405180910390fd5b670de0b6b3a7640000341015610470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118526026913960400191505060405180910390fd5b633b9aca003406156104cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117d26033913960400191505060405180910390fd5b633b9aca00340467ffffffffffffffff811115610535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061182b6027913960400191505060405180910390fd5b6060610540826114ba565b90507f649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c589898989858a8a6105756020546114ba565b6040805160a0808252810189905290819060208201908201606083016080840160c085018e8e80828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910187810386528c815260200190508c8c808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920188810386528c5181528c51602091820193918e019250908190849084905b83811015610648578181015183820152602001610630565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b5086810383528881526020018989808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018881038452895181528951602091820193918b019250908190849084905b838110156106ef5781810151838201526020016106d7565b50505050905090810190601f16801561071c5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390a1600060028a8a600060801b604051602001808484808284377fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941691909301908152604080517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0818403018152601090920190819052815191955093508392506020850191508083835b602083106107fc57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016107bf565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610859573d6000803e3d6000fd5b5050506040513d602081101561086e57600080fd5b5051905060006002806108846040848a8c6116fe565b6040516020018083838082843780830192505050925050506040516020818303038152906040526040518082805190602001908083835b602083106108f857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016108bb565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610955573d6000803e3d6000fd5b5050506040513d602081101561096a57600080fd5b5051600261097b896040818d6116fe565b60405160009060200180848480828437919091019283525050604080518083038152602092830191829052805190945090925082918401908083835b602083106109f457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016109b7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610a51573d6000803e3d6000fd5b5050506040513d6020811015610a6657600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610ada57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a9d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610b37573d6000803e3d6000fd5b5050506040513d6020811015610b4c57600080fd5b50516040805160208101858152929350600092600292839287928f928f92018383808284378083019250505093505050506040516020818303038152906040526040518082805190602001908083835b60208310610bd957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b9c565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610c36573d6000803e3d6000fd5b5050506040513d6020811015610c4b57600080fd5b50516040518651600291889160009188916020918201918291908601908083835b60208310610ca957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c6c565b6001836020036101000a0380198251168184511680821785525050505050509050018367ffffffffffffffff191667ffffffffffffffff1916815260180182815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610d4e57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610d11565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610dab573d6000803e3d6000fd5b5050506040513d6020811015610dc057600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610e3457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610df7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610e91573d6000803e3d6000fd5b5050506040513d6020811015610ea657600080fd5b50519050858114610f02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260548152602001806117486054913960600191505060405180910390fd5b60205463ffffffff11610f60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117276021913960400191505060405180910390fd5b602080546001019081905560005b60208110156110a9578160011660011415610fa0578260008260208110610f9157fe5b0155506110ac95505050505050565b600260008260208110610faf57fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061102557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610fe8565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015611082573d6000803e3d6000fd5b5050506040513d602081101561109757600080fd5b50519250600282049150600101610f6e565b50fe5b50505050505050565b60606110c26020546114ba565b905090565b6020546000908190815b60208110156112f05781600116600114156111e6576002600082602081106110f557fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061116b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161112e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156111c8573d6000803e3d6000fd5b5050506040513d60208110156111dd57600080fd5b505192506112e2565b600283602183602081106111f657fe5b015460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061126b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161122e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156112c8573d6000803e3d6000fd5b5050506040513d60208110156112dd57600080fd5b505192505b6002820491506001016110d1565b506002826112ff6020546114ba565b600060401b6040516020018084815260200183805190602001908083835b6020831061135a57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161131d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000095909516920191825250604080518083037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8018152601890920190819052815191955093508392850191508083835b6020831061143f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611402565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa15801561149c573d6000803e3d6000fd5b5050506040513d60208110156114b157600080fd5b50519250505090565b60408051600880825281830190925260609160208201818036833701905050905060c082901b8060071a60f81b826000815181106114f457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060061a60f81b8260018151811061153757fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060051a60f81b8260028151811061157a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060041a60f81b826003815181106115bd57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060031a60f81b8260048151811061160057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060021a60f81b8260058151811061164357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060011a60f81b8260068151811061168657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060001a60f81b826007815181106116c957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535050919050565b6000808585111561170d578182fd5b83861115611719578182fd5b505082019391909203915056fe4465706f736974436f6e74726163743a206d65726b6c6520747265652066756c6c4465706f736974436f6e74726163743a207265636f6e7374727563746564204465706f7369744461746120646f6573206e6f74206d6174636820737570706c696564206465706f7369745f646174615f726f6f744465706f736974436f6e74726163743a20696e76616c6964207769746864726177616c5f63726564656e7469616c73206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c7565206e6f74206d756c7469706c65206f6620677765694465706f736974436f6e74726163743a20696e76616c6964207075626b6579206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f20686967684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f206c6f774465706f736974436f6e74726163743a20696e76616c6964207369676e6174757265206c656e677468a26469706673582212201dd26f37a621703009abf16e77e69c93dc50c79db7f6cc37543e3e0e3decdc9764736f6c634300060b0033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000022": "0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b", + "0x0000000000000000000000000000000000000000000000000000000000000023": "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", + "0x0000000000000000000000000000000000000000000000000000000000000024": "0xc78009fdf07fc56a11f122370658a353aaa542ed63e44c4bc15ff4cd105ab33c", + "0x0000000000000000000000000000000000000000000000000000000000000025": "0x536d98837f2dd165a55d5eeae91485954472d56f246df256bf3cae19352a123c", + "0x0000000000000000000000000000000000000000000000000000000000000026": "0x9efde052aa15429fae05bad4d0b1d7c64da64d03d7a1854a588c2cb8430c0d30", + "0x0000000000000000000000000000000000000000000000000000000000000027": "0xd88ddfeed400a8755596b21942c1497e114c302e6118290f91e6772976041fa1", + "0x0000000000000000000000000000000000000000000000000000000000000028": "0x87eb0ddba57e35f6d286673802a4af5975e22506c7cf4c64bb6be5ee11527f2c", + "0x0000000000000000000000000000000000000000000000000000000000000029": "0x26846476fd5fc54a5d43385167c95144f2643f533cc85bb9d16b782f8d7db193", + "0x000000000000000000000000000000000000000000000000000000000000002a": "0x506d86582d252405b840018792cad2bf1259f1ef5aa5f887e13cb2f0094f51e1", + "0x000000000000000000000000000000000000000000000000000000000000002b": "0xffff0ad7e659772f9534c195c815efc4014ef1e1daed4404c06385d11192e92b", + "0x000000000000000000000000000000000000000000000000000000000000002c": "0x6cf04127db05441cd833107a52be852868890e4317e6a02ab47683aa75964220", + "0x000000000000000000000000000000000000000000000000000000000000002d": "0xb7d05f875f140027ef5118a2247bbb84ce8f2f0f1123623085daf7960c329f5f", + "0x000000000000000000000000000000000000000000000000000000000000002e": "0xdf6af5f5bbdb6be9ef8aa618e4bf8073960867171e29676f8b284dea6a08a85e", + "0x000000000000000000000000000000000000000000000000000000000000002f": "0xb58d900f5e182e3c50ef74969ea16c7726c549757cc23523c369587da7293784", + "0x0000000000000000000000000000000000000000000000000000000000000030": "0xd49a7502ffcfb0340b1d7885688500ca308161a7f96b62df9d083b71fcc8f2bb", + "0x0000000000000000000000000000000000000000000000000000000000000031": "0x8fe6b1689256c0d385f42f5bbe2027a22c1996e110ba97c171d3e5948de92beb", + "0x0000000000000000000000000000000000000000000000000000000000000032": "0x8d0d63c39ebade8509e0ae3c9c3876fb5fa112be18f905ecacfecb92057603ab", + "0x0000000000000000000000000000000000000000000000000000000000000033": "0x95eec8b2e541cad4e91de38385f2e046619f54496c2382cb6cacd5b98c26f5a4", + "0x0000000000000000000000000000000000000000000000000000000000000034": "0xf893e908917775b62bff23294dbbe3a1cd8e6cc1c35b4801887b646a6f81f17f", + "0x0000000000000000000000000000000000000000000000000000000000000035": "0xcddba7b592e3133393c16194fac7431abf2f5485ed711db282183c819e08ebaa", + "0x0000000000000000000000000000000000000000000000000000000000000036": "0x8a8d7fe3af8caa085a7639a832001457dfb9128a8061142ad0335629ff23ff9c", + "0x0000000000000000000000000000000000000000000000000000000000000037": "0xfeb3c337d7a51a6fbf00b9e34c52e1c9195c969bd4e7a0bfd51d5c5bed9c1167", + "0x0000000000000000000000000000000000000000000000000000000000000038": "0xe71f0aa83cc32edfbefa9f4d3e0174ca85182eec9f3a09f6a6c0df6377a510d7", + "0x0000000000000000000000000000000000000000000000000000000000000039": "0x31206fa80a50bb6abe29085058f16212212a60eec8f049fecb92d8c8e0a84bc0", + "0x000000000000000000000000000000000000000000000000000000000000003a": "0x21352bfecbeddde993839f614c3dac0a3ee37543f9b412b16199dc158e23b544", + "0x000000000000000000000000000000000000000000000000000000000000003b": "0x619e312724bb6d7c3153ed9de791d764a366b389af13c58bf8a8d90481a46765", + "0x000000000000000000000000000000000000000000000000000000000000003c": "0x7cdd2986268250628d0c10e385c58c6191e6fbe05191bcc04f133f2cea72c1c4", + "0x000000000000000000000000000000000000000000000000000000000000003d": "0x848930bd7ba8cac54661072113fb278869e07bb8587f91392933374d017bcbe1", + "0x000000000000000000000000000000000000000000000000000000000000003e": "0x8869ff2c22b28cc10510d9853292803328be4fb0e80495e8bb8d271f5b889636", + "0x000000000000000000000000000000000000000000000000000000000000003f": "0xb5fe28e79f1b850f8658246ce9b6a1e7b49fc06db7143e8fe0b4f2b0c5523a5c", + "0x0000000000000000000000000000000000000000000000000000000000000040": "0x985e929f70af28d0bdd1a90a808f977f597c7c778c489e98d3bd8910d31ac0f7" + } + }, + "0x4e59b44847b379578588920cA78FbF26c0B4956C": { + "balance": "0", + "nonce": "1", + "code": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3" + }, + "0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500" + }, + "0x0F792be4B0c0cb4DAE440Ef133E90C0eCD48CCCC": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500" + }, + "0x0c15F14308530b7CDB8460094BbB9cC28b9AaaAA": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460cb5760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146101f457600182026001905f5b5f82111560685781019083028483029004916001019190604d565b909390049250505036603814608857366101f457346101f4575f5260205ff35b34106101f457600154600101600155600354806003026004013381556001015f35815560010160203590553360601b5f5260385f601437604c5fa0600101600355005b6003546002548082038060101160df575060105b5f5b8181146101835782810160030260040181604c02815460601b8152601401816001015481526020019060020154807fffffffffffffffffffffffffffffffff00000000000000000000000000000000168252906010019060401c908160381c81600701538160301c81600601538160281c81600501538160201c81600401538160181c81600301538160101c81600201538160081c81600101535360010160e1565b910180921461019557906002556101a0565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14156101cd57505f5b6001546002828201116101e25750505f6101e8565b01600290035b5f555f600155604c025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + }, + "0x00431F263cE400f4455c2dCf564e53007Ca4bbBb": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460d35760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f82111560685781019083028483029004916001019190604d565b9093900492505050366060146088573661019a573461019a575f5260205ff35b341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060021160e7575060025b5f5b8181146101295782810160040260040181607402815460601b815260140181600101548152602001816002015481526020019060030154905260010160e9565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + }, + "0x8943545177806ED17B9F23F0a21ee5948eCaa776": { + "balance": "1000000000000000000000000000" + }, + "0xE25583099BA105D9ec0A67f5Ae86D90e50036425": { + "balance": "1000000000000000000000000000" + }, + "0x614561D2d143621E126e87831AEF287678B442b8": { + "balance": "1000000000000000000000000000" + }, + "0xf93Ee4Cf8c6c40b329b0c0626F28333c132CF241": { + "balance": "1000000000000000000000000000" + }, + "0x802dCbE1B1A97554B4F50DB5119E37E8e7336417": { + "balance": "1000000000000000000000000000" + }, + "0xAe95d8DA9244C37CaC0a3e16BA966a8e852Bb6D6": { + "balance": "1000000000000000000000000000" + }, + "0x2c57d1CFC6d5f8E4182a56b4cf75421472eBAEa4": { + "balance": "1000000000000000000000000000" + }, + "0x741bFE4802cE1C4b5b00F9Df2F5f179A1C89171A": { + "balance": "1000000000000000000000000000" + }, + "0xc3913d4D8bAb4914328651C2EAE817C8b78E1f4c": { + "balance": "1000000000000000000000000000" + }, + "0x65D08a056c17Ae13370565B04cF77D2AfA1cB9FA": { + "balance": "1000000000000000000000000000" + }, + "0x3e95dFbBaF6B348396E6674C7871546dCC568e56": { + "balance": "1000000000000000000000000000" + }, + "0x5918b2e647464d4743601a865753e64C8059Dc4F": { + "balance": "1000000000000000000000000000" + }, + "0x589A698b7b7dA0Bec545177D3963A2741105C7C9": { + "balance": "1000000000000000000000000000" + }, + "0x4d1CB4eB7969f8806E2CaAc0cbbB71f88C8ec413": { + "balance": "1000000000000000000000000000" + }, + "0xF5504cE2BcC52614F121aff9b93b2001d92715CA": { + "balance": "1000000000000000000000000000" + }, + "0xF61E98E7D47aB884C244E39E031978E33162ff4b": { + "balance": "1000000000000000000000000000" + }, + "0xf1424826861ffbbD25405F5145B5E50d0F1bFc90": { + "balance": "1000000000000000000000000000" + }, + "0xfDCe42116f541fc8f7b0776e2B30832bD5621C85": { + "balance": "1000000000000000000000000000" + }, + "0xD9211042f35968820A3407ac3d80C725f8F75c14": { + "balance": "1000000000000000000000000000" + }, + "0xD8F3183DEF51A987222D845be228e0Bbb932C222": { + "balance": "1000000000000000000000000000" + }, + "0xafF0CA253b97e54440965855cec0A8a2E2399896": { + "balance": "1000000000000000000000000000" + }, + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266": { + "balance": "1000000000000000000000000" + }, + "0x70997970C51812dc3A010C7d01b50e0d17dc79C8": { + "balance": "1000000000000000000000000" + }, + "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC": { + "balance": "1000000000000000000000000" + }, + "0x90F79bf6EB2c4f870365E785982E1f101E93b906": { + "balance": "1000000000000000000000000" + }, + "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65": { + "balance": "1000000000000000000000000" + }, + "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc": { + "balance": "1000000000000000000000000" + }, + "0x976EA74026E726554dB657fA54763abd0C3a0aa9": { + "balance": "1000000000000000000000000" + }, + "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955": { + "balance": "1000000000000000000000000" + }, + "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f": { + "balance": "1000000000000000000000000" + }, + "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720": { + "balance": "1000000000000000000000000" + }, + "0xBcd4042DE499D14e55001CcbB24a551F3b954096": { + "balance": "1000000000000000000000000" + }, + "0x71bE63f3384f5fb98995898A86B02Fb2426c5788": { + "balance": "1000000000000000000000000" + }, + "0xFABB0ac9d68B0B445fB7357272Ff202C5651694a": { + "balance": "1000000000000000000000000" + }, + "0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec": { + "balance": "1000000000000000000000000" + }, + "0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097": { + "balance": "1000000000000000000000000" + }, + "0xcd3B766CCDd6AE721141F452C550Ca635964ce71": { + "balance": "1000000000000000000000000" + }, + "0x2546BcD3c84621e976D8185a91A922aE77ECEc30": { + "balance": "1000000000000000000000000" + }, + "0xbDA5747bFD65F08deb54cb465eB87D40e51B197E": { + "balance": "1000000000000000000000000" + }, + "0xdD2FD4581271e230360230F9337D5c0430Bf44C0": { + "balance": "1000000000000000000000000" + }, + "0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199": { + "balance": "1000000000000000000000000" + }, + "0x09DB0a93B389bEF724429898f539AEB7ac2Dd55f": { + "balance": "1000000000000000000000000" + }, + "0x02484cb50AAC86Eae85610D6f4Bf026f30f6627D": { + "balance": "1000000000000000000000000" + }, + "0x08135Da0A343E492FA2d4282F2AE34c6c5CC1BbE": { + "balance": "1000000000000000000000000" + }, + "0x5E661B79FE2D3F6cE70F5AAC07d8Cd9abb2743F1": { + "balance": "1000000000000000000000000" + }, + "0x61097BA76cD906d2ba4FD106E757f7Eb455fc295": { + "balance": "1000000000000000000000000" + }, + "0xDf37F81dAAD2b0327A0A50003740e1C935C70913": { + "balance": "1000000000000000000000000" + }, + "0x553BC17A05702530097c3677091C5BB47a3a7931": { + "balance": "1000000000000000000000000" + }, + "0x87BdCE72c06C21cd96219BD8521bDF1F42C78b5e": { + "balance": "1000000000000000000000000" + }, + "0x40Fc963A729c542424cD800349a7E4Ecc4896624": { + "balance": "1000000000000000000000000" + }, + "0x9DCCe783B6464611f38631e6C851bf441907c710": { + "balance": "1000000000000000000000000" + }, + "0x1BcB8e569EedAb4668e55145Cfeaf190902d3CF2": { + "balance": "1000000000000000000000000" + }, + "0x8263Fce86B1b78F95Ab4dae11907d8AF88f841e7": { + "balance": "1000000000000000000000000" + }, + "0xcF2d5b3cBb4D7bF04e3F7bFa8e27081B52191f91": { + "balance": "1000000000000000000000000" + }, + "0x86c53Eb85D0B7548fea5C4B4F82b4205C8f6Ac18": { + "balance": "1000000000000000000000000" + }, + "0x1aac82773CB722166D7dA0d5b0FA35B0307dD99D": { + "balance": "1000000000000000000000000" + }, + "0x2f4f06d218E426344CFE1A83D53dAd806994D325": { + "balance": "1000000000000000000000000" + }, + "0x1003ff39d25F2Ab16dBCc18EcE05a9B6154f65F4": { + "balance": "1000000000000000000000000" + }, + "0x9eAF5590f2c84912A08de97FA28d0529361Deb9E": { + "balance": "1000000000000000000000000" + }, + "0x11e8F3eA3C6FcF12EcfF2722d75CEFC539c51a1C": { + "balance": "1000000000000000000000000" + }, + "0x7D86687F980A56b832e9378952B738b614A99dc6": { + "balance": "1000000000000000000000000" + }, + "0x9eF6c02FB2ECc446146E05F1fF687a788a8BF76d": { + "balance": "1000000000000000000000000" + }, + "0x08A2DE6F3528319123b25935C92888B16db8913E": { + "balance": "1000000000000000000000000" + }, + "0xe141C82D99D85098e03E1a1cC1CdE676556fDdE0": { + "balance": "1000000000000000000000000" + }, + "0x4b23D303D9e3719D6CDf8d172Ea030F80509ea15": { + "balance": "1000000000000000000000000" + }, + "0xC004e69C5C04A223463Ff32042dd36DabF63A25a": { + "balance": "1000000000000000000000000" + }, + "0x5eb15C0992734B5e77c888D713b4FC67b3D679A2": { + "balance": "1000000000000000000000000" + }, + "0x7Ebb637fd68c523613bE51aad27C35C4DB199B9c": { + "balance": "1000000000000000000000000" + }, + "0x3c3E2E178C69D4baD964568415a0f0c84fd6320A": { + "balance": "1000000000000000000000000" + } + }, + "coinbase": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "extraData": "", + "gasLimit": "0xe8d4a51000", + "nonce": "0x1234", + "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1736349804 +} \ No newline at end of file diff --git a/spartan/aztec-network/eth-devnet/config/jwt-secret.hex b/spartan/aztec-network/eth-devnet/config/jwt-secret.hex new file mode 100644 index 00000000000..bd827d7b652 --- /dev/null +++ b/spartan/aztec-network/eth-devnet/config/jwt-secret.hex @@ -0,0 +1 @@ +0x61e1dd9539e8cc37b3d71dcf8ce372f0e119cc1c73426ee80472a4214f2a41a1 \ No newline at end of file diff --git a/spartan/aztec-network/eth-devnet/config/mnemonics.yaml b/spartan/aztec-network/eth-devnet/config/mnemonics.yaml new file mode 100644 index 00000000000..2f0c204bc56 --- /dev/null +++ b/spartan/aztec-network/eth-devnet/config/mnemonics.yaml @@ -0,0 +1,3 @@ +# Used with the eth2-testnet-generator +- mnemonic: "test test test test test test test test test test test junk" + count: 64 diff --git a/spartan/aztec-network/eth-devnet/create.sh b/spartan/aztec-network/eth-devnet/create.sh new file mode 100755 index 00000000000..286a0a5e113 --- /dev/null +++ b/spartan/aztec-network/eth-devnet/create.sh @@ -0,0 +1,173 @@ +#!/bin/bash + +set -euo pipefail + +DIR_PATH=$(git rev-parse --show-toplevel)/spartan/aztec-network/eth-devnet + +## Genesis configuration values are provided as environment variables +NUMBER_OF_KEYS=${NUMBER_OF_KEYS:-16} +MNEMONIC=${MNEMONIC:-"test test test test test test test test test test test junk"} +BLOCK_TIME=${BLOCK_TIME:-"12"} +GAS_LIMIT=${GAS_LIMIT:-"1000000000"} +CHAIN_ID=${CHAIN_ID:-"1337"} + +# Install cast if it is not installed +if ! command -v cast &> /dev/null; then + curl -L https://foundry.paradigm.xyz | bash + ~/.foundry/bin/foundryup + ## add cast to path + export PATH="$PATH:~/.foundry/bin" +fi + +# Function to create execution genesis +# Updates genesis timestamp to current time, helps with triggering Consensus layer +create_execution_genesis() { + local execution_genesis_path="$1" + local execution_genesis_output="$2" + echo "Creating execution genesis..." + + # Get the current timestamp + timestamp=$(date +%s) + + # Read the Genesis JSON template + if [[ ! -f "$execution_genesis_path" ]]; then + echo "Error: Genesis template not found at $execution_genesis_path" + exit 1 + fi + + genesis_json=$(cat "$execution_genesis_path") + + # Replace the timestamp in the Genesis JSON + updated_json=$(echo "$genesis_json" | jq --arg ts "$timestamp" '.timestamp = ($ts | tonumber)') + + # If mnemonic is provided, add prefunded accounts + if [[ -n "${MNEMONIC:-}" ]]; then + echo "Prefunding accounts with mnemonic: $MNEMONIC" + echo "Number of keys: $NUMBER_OF_KEYS" + + updated_json=$(prefund_accounts "$updated_json" "$MNEMONIC" "$NUMBER_OF_KEYS") + fi + + # Update the gas limit to the configured value + if [[ -n "${GAS_LIMIT:-}" ]]; then + updated_json=$(echo "$updated_json" | jq --arg gas_limit "$GAS_LIMIT" '.gasLimit = ($gas_limit | tonumber)') + fi + + if [[ -n "${CHAIN_ID:-}" ]]; then + updated_json=$(echo "$updated_json" | jq --arg chain_id "$CHAIN_ID" '.config.chainId = ($chain_id | tonumber)') + fi + + # Write the updated Genesis JSON to the output file + echo "$updated_json" > "$execution_genesis_output" + echo "Execution genesis created at $execution_genesis_output" +} + +prefund_accounts() { + local genesis_json="$1" + local mnemonic="$2" + local number_of_keys="$3" + local updated_json="$genesis_json" + + # Initialize array to store addresses + declare -a VALIDATOR_ADDRESSES_LIST + + # Generate addresses from mnemonic + for i in $(seq 0 $(($number_of_keys - 1))); do + # Get private key and address + PRIVATE_KEY=$(cast wallet private-key "$MNEMONIC" --mnemonic-index $i) + ADDRESS=$(cast wallet address "$PRIVATE_KEY") + VALIDATOR_ADDRESSES_LIST+=("$ADDRESS") + done + + # Add each address to the genesis allocation + for address in "${VALIDATOR_ADDRESSES_LIST[@]}"; do + updated_json=$(echo "$updated_json" | jq --arg addr "$address" \ + '.alloc[$addr] = {"balance": "1000000000000000000000000000"}') + done + + echo "$updated_json" +} + +# Function to create beacon genesis +# Uses the eth2-testnet-generator to generate beacon genesis state (genesis.ssz file) +# The selected eth1 block +create_beacon_genesis() { + local execution_genesis_path="$1" + local beacon_mnemonics_path="./config/mnemonics.yaml" + local beacon_config_path="./config/config.yaml" + local beacon_genesis_path="./out" + + echo "Creating beacon genesis using:" + echo " Beacon mnemonics path: $beacon_mnemonics_path" + echo " Beacon config path: $beacon_config_path" + echo " Execution genesis path: $execution_genesis_path" + + # update the templates block time if it is provided + cp "$DIR_PATH/$beacon_config_path" "$DIR_PATH/out/config.yaml" + if [[ -n "${BLOCK_TIME:-}" ]]; then + yq eval ".SECONDS_PER_SLOT = ${BLOCK_TIME}" -i "$DIR_PATH/out/config.yaml" + yq eval ".SECONDS_PER_ETH1_BLOCK = ${BLOCK_TIME}" -i "$DIR_PATH/out/config.yaml" + fi + + # Update the chain id if it is provided + if [[ -n "${CHAIN_ID:-}" ]]; then + yq eval ".DEPOSIT_CHAIN_ID = ${CHAIN_ID}" -i "$DIR_PATH/out/config.yaml" + yq eval ".DEPOSIT_NETWORK_ID = ${CHAIN_ID}" -i "$DIR_PATH/out/config.yaml" + fi + + # Run the protolamba's eth2 testnet genesis container + echo "$DIR_PATH/config:/app/config" + echo "$DIR_PATH/out:/app/out" + + docker run --rm \ + -v "$DIR_PATH/config:/app/config" \ + -v "$DIR_PATH/out:/app/out" \ + maddiaa/eth2-testnet-genesis deneb \ + --config="./out/config.yaml" \ + --preset-phase0=minimal \ + --preset-altair=minimal \ + --preset-bellatrix=minimal \ + --preset-capella=minimal \ + --preset-deneb=minimal \ + --eth1-config="./out/genesis.json" \ + --state-output="${beacon_genesis_path}/genesis.ssz" \ + --tranches-dir="$beacon_genesis_path" \ + --mnemonics="$beacon_mnemonics_path" \ + --eth1-withdrawal-address="0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \ + --eth1-match-genesis-time + + if [[ $? -ne 0 ]]; then + echo "Error: eth2-testnet-genesis failed." + exit 1 + fi + + echo "Beacon genesis created at $beacon_genesis_path" +} + +create_deposit_contract_block() { + echo 0 > "$DIR_PATH/out/deposit_contract_block.txt" + echo "Deposit contract block created at $DIR_PATH/out/deposit_contract_block.txt" +} + +## The ssz file must be written in base64 in order for a config map to accept it +write_ssz_file_base64() { + local ssz_file="$DIR_PATH/out/genesis.ssz" + local output_file="$DIR_PATH/out/genesis-ssz" + base64 -w 0 "$ssz_file" > "$output_file" + echo "SSZ file base64 encoded at $output_file" +} + +# Main +beacon_config_path="$DIR_PATH/config/config.yaml" +genesis_json_path="$DIR_PATH/config/genesis.json" + +mkdir -p "$DIR_PATH/out" + +create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/out/genesis.json" +create_beacon_genesis "$DIR_PATH/out/genesis.json" +create_deposit_contract_block +write_ssz_file_base64 + +cp "$beacon_config_path" "$DIR_PATH/out/config.yaml" +cp "$DIR_PATH/config/jwt-secret.hex" "$DIR_PATH/out/jwt-secret.hex" +echo "Genesis files copied to ./out" diff --git a/spartan/aztec-network/files/config/genesis.json b/spartan/aztec-network/files/config/genesis.json deleted file mode 100644 index e899e7f8255..00000000000 --- a/spartan/aztec-network/files/config/genesis.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "config": { - "chainId": 1337, - "homesteadBlock":0, - "eip150Block":0, - "eip155Block":0, - "eip158Block":0, - "byzantiumBlock":0, - "constantinopleBlock":0, - "petersburgBlock":0, - "istanbulBlock":0, - "muirGlacierBlock":0, - "berlinBlock":0, - "londonBlock":0, - "arrowGlacierBlock":0, - "grayGlacierBlock":0, - "mergeNetsplitBlock":0, - "bedrockBlock":0, - "regolithTime":0, - "shanghaiTime":0, - "cancunTime":0, - "terminalTotalDifficulty":0, - "terminalTotalDifficultyPassed":true - }, - "nonce": "0x42", - "timestamp": "0x0", - "extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa", - "gasLimit": "0x1388", - "difficulty": "0x400000000", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "alloc": { - "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266": { - "balance": "0x56bc75e2d63100000" - }, - "0x70997970C51812dc3A010C7d01b50e0d17dc79C8": { - "balance": "0x56bc75e2d63100000" - }, - "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC": { - "balance": "0x56bc75e2d63100000" - }, - "0x90F79bf6EB2c4f870365E785982E1f101E93b906": { - "balance": "0x56bc75e2d63100000" - }, - "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65": { - "balance": "0x56bc75e2d63100000" - }, - "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc": { - "balance": "0x56bc75e2d63100000" - }, - "0x976EA74026E726554dB657fA54763abd0C3a0aa9": { - "balance": "0x56bc75e2d63100000" - }, - "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955": { - "balance": "0x56bc75e2d63100000" - }, - "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f": { - "balance": "0x56bc75e2d63100000" - }, - "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720": { - "balance": "0x56bc75e2d63100000" - }, - "0xBcd4042DE499D14e55001CcbB24a551F3b954096": { - "balance": "0x56bc75e2d63100000" - }, - "0x71bE63f3384f5fb98995898A86B02Fb2426c5788": { - "balance": "0x56bc75e2d63100000" - }, - "0xFABB0ac9d68B0B445fB7357272Ff202C5651694a": { - "balance": "0x56bc75e2d63100000" - }, - "0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec": { - "balance": "0x56bc75e2d63100000" - }, - "0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097": { - "balance": "0x56bc75e2d63100000" - }, - "0xcd3B766CCDd6AE721141F452C550Ca635964ce71": { - "balance": "0x56bc75e2d63100000" - }, - "0x2546BcD3c84621e976D8185a91A922aE77ECEc30": { - "balance": "0x56bc75e2d63100000" - }, - "0xbDA5747bFD65F08deb54cb465eB87D40e51B197E": { - "balance": "0x56bc75e2d63100000" - }, - "0xdD2FD4581271e230360230F9337D5c0430Bf44C0": { - "balance": "0x56bc75e2d63100000" - }, - "0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199": { - "balance": "0x56bc75e2d63100000" - }, - "0x09DB0a93B389bEF724429898f539AEB7ac2Dd55f": { - "balance": "0x56bc75e2d63100000" - }, - "0x02484cb50AAC86Eae85610D6f4Bf026f30f6627D": { - "balance": "0x56bc75e2d63100000" - }, - "0x08135Da0A343E492FA2d4282F2AE34c6c5CC1BbE": { - "balance": "0x56bc75e2d63100000" - }, - "0x5E661B79FE2D3F6cE70F5AAC07d8Cd9abb2743F1": { - "balance": "0x56bc75e2d63100000" - }, - "0x61097BA76cD906d2ba4FD106E757f7Eb455fc295": { - "balance": "0x56bc75e2d63100000" - }, - "0xDf37F81dAAD2b0327A0A50003740e1C935C70913": { - "balance": "0x56bc75e2d63100000" - }, - "0x553BC17A05702530097c3677091C5BB47a3a7931": { - "balance": "0x56bc75e2d63100000" - }, - "0x87BdCE72c06C21cd96219BD8521bDF1F42C78b5e": { - "balance": "0x56bc75e2d63100000" - }, - "0x40Fc963A729c542424cD800349a7E4Ecc4896624": { - "balance": "0x56bc75e2d63100000" - }, - "0x9DCCe783B6464611f38631e6C851bf441907c710": { - "balance": "0x56bc75e2d63100000" - }, - "0x1BcB8e569EedAb4668e55145Cfeaf190902d3CF2": { - "balance": "0x56bc75e2d63100000" - }, - "0x8263Fce86B1b78F95Ab4dae11907d8AF88f841e7": { - "balance": "0x56bc75e2d63100000" - }, - "0xcF2d5b3cBb4D7bF04e3F7bFa8e27081B52191f91": { - "balance": "0x56bc75e2d63100000" - }, - "0x86c53Eb85D0B7548fea5C4B4F82b4205C8f6Ac18": { - "balance": "0x56bc75e2d63100000" - }, - "0x1aac82773CB722166D7dA0d5b0FA35B0307dD99D": { - "balance": "0x56bc75e2d63100000" - }, - "0x2f4f06d218E426344CFE1A83D53dAd806994D325": { - "balance": "0x56bc75e2d63100000" - }, - "0x1003ff39d25F2Ab16dBCc18EcE05a9B6154f65F4": { - "balance": "0x56bc75e2d63100000" - }, - "0x9eAF5590f2c84912A08de97FA28d0529361Deb9E": { - "balance": "0x56bc75e2d63100000" - }, - "0x11e8F3eA3C6FcF12EcfF2722d75CEFC539c51a1C": { - "balance": "0x56bc75e2d63100000" - }, - "0x7D86687F980A56b832e9378952B738b614A99dc6": { - "balance": "0x56bc75e2d63100000" - }, - "0x9eF6c02FB2ECc446146E05F1fF687a788a8BF76d": { - "balance": "0x56bc75e2d63100000" - }, - "0x08A2DE6F3528319123b25935C92888B16db8913E": { - "balance": "0x56bc75e2d63100000" - }, - "0xe141C82D99D85098e03E1a1cC1CdE676556fDdE0": { - "balance": "0x56bc75e2d63100000" - }, - "0x4b23D303D9e3719D6CDf8d172Ea030F80509ea15": { - "balance": "0x56bc75e2d63100000" - }, - "0xC004e69C5C04A223463Ff32042dd36DabF63A25a": { - "balance": "0x56bc75e2d63100000" - }, - "0x5eb15C0992734B5e77c888D713b4FC67b3D679A2": { - "balance": "0x56bc75e2d63100000" - }, - "0x7Ebb637fd68c523613bE51aad27C35C4DB199B9c": { - "balance": "0x56bc75e2d63100000" - }, - "0x3c3E2E178C69D4baD964568415a0f0c84fd6320A": { - "balance": "0x56bc75e2d63100000" - } - }, - "number": "0x0" - } \ No newline at end of file diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index e3d6431c4ad..05934ad5916 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -56,9 +56,9 @@ get_service_address() { if [ "${EXTERNAL_ETHEREUM_HOST}" != "" ]; then ETHEREUM_ADDR="${EXTERNAL_ETHEREUM_HOST}" elif [ "${NETWORK_PUBLIC}" = "true" ]; then - ETHEREUM_ADDR=$(get_service_address "ethereum" "${ETHEREUM_PORT}") + ETHEREUM_ADDR=$(get_service_address "eth-execution" "${ETHEREUM_PORT}") else - ETHEREUM_ADDR="http://${SERVICE_NAME}-ethereum.${NAMESPACE}:${ETHEREUM_PORT}" + ETHEREUM_ADDR="http://${SERVICE_NAME}-eth-execution.${NAMESPACE}:${ETHEREUM_PORT}" fi # Configure Boot Node address diff --git a/spartan/aztec-network/templates/_helpers.tpl b/spartan/aztec-network/templates/_helpers.tpl index 2e303c81112..9e23dc5ffdb 100644 --- a/spartan/aztec-network/templates/_helpers.tpl +++ b/spartan/aztec-network/templates/_helpers.tpl @@ -142,9 +142,9 @@ Service Address Setup Container - name: OTEL_COLLECTOR_ENDPOINT value: "{{ .Values.telemetry.otelCollectorEndpoint }}" - name: EXTERNAL_ETHEREUM_HOST - value: "{{ .Values.ethereum.externalHost }}" + value: "{{ .Values.ethereum.execution.externalHost }}" - name: ETHEREUM_PORT - value: "{{ .Values.ethereum.service.port }}" + value: "{{ .Values.ethereum.execution.service.port }}" - name: EXTERNAL_BOOT_NODE_HOST value: "{{ .Values.bootNode.externalHost }}" - name: BOOT_NODE_PORT diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 56b0ee5d916..c467ea50c9c 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -52,30 +52,6 @@ spec: - name: config mountPath: /shared/config {{- if .Values.bootNode.deployContracts }} - - name: deploy-create2-deployer - image: {{ .Values.images.foundry.image }} - command: - - /bin/sh - - -c - - | - set -eux - source /shared/config/service-addresses - # it is possible that even though we asserted this above, the DNS resolver of *this* pod - # is not yet ready to resolve the ethereum host. - # so we need to wait for it to be ready. - until cast rpc --rpc-url ${ETHEREUM_HOST} eth_chainId | grep 0x; do - echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." - sleep 5 - done - echo "Ethereum node is ready!" - PROXY_CODE="$(cast code --rpc-url ${ETHEREUM_HOST} 0x4e59b44847b379578588920ca78fbf26c0b4956c)" - if [ "$PROXY_CODE" = "0x" ]; then - echo "Deploying Deterministic Deployment Proxy" - cast publish --rpc-url ${ETHEREUM_HOST} 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222 - fi - volumeMounts: - - name: config - mountPath: /shared/config - name: deploy-l1-contracts {{- include "aztec-network.image" . | nindent 10 }} command: diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index c21dcccbe93..ac165f393a7 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -99,9 +99,9 @@ spec: - name: NAMESPACE value: {{ .Release.Namespace }} - name: EXTERNAL_ETHEREUM_HOST - value: "{{ .Values.ethereum.externalHost }}" + value: "{{ .Values.ethereum.execution.externalHost }}" - name: ETHEREUM_PORT - value: "{{ .Values.ethereum.service.port }}" + value: "{{ .Values.ethereum.execution.service.port }}" - name: EXTERNAL_BOOT_NODE_HOST value: "{{ .Values.bootNode.externalHost }}" - name: BOOT_NODE_PORT diff --git a/spartan/aztec-network/templates/eth-beacon.yaml b/spartan/aztec-network/templates/eth-beacon.yaml new file mode 100644 index 00000000000..af528260766 --- /dev/null +++ b/spartan/aztec-network/templates/eth-beacon.yaml @@ -0,0 +1,120 @@ +{{- if not .Values.ethereum.externalHost }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-beacon + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "aztec-network.selectorLabels" . | nindent 6 }} + app: eth-beacon + template: + metadata: + labels: + {{- include "aztec-network.selectorLabels" . | nindent 8 }} + app: eth-beacon + spec: + {{- if .Values.network.public }} + hostNetwork: true + {{- end }} + containers: + - name: eth-beacon + image: "{{ .Values.images.lighthouse.image }}" + imagePullPolicy: {{ .Values.images.lighthouse.pullPolicy }} + command: ["/bin/sh", "-c"] + args: + # Genesis information is copied such that we can write into it + # First serialize the ssz file + - >- + cp -r /genesis-template /genesis && + base64 -d /genesis/genesis-ssz > /genesis/genesis.ssz && + + + lighthouse bn + --disable-peer-scoring + --disable-packet-filter + --enable-private-discovery + --disable-enr-auto-update + --staking + --http + --http-address=0.0.0.0 + --http-port=5052 + --validator-monitor-auto + --http-allow-origin='*' + --listen-address=0.0.0.0 + {{- include "helpers.flag" (list "port" .Values.ethereum.beacon.port) }} + --target-peers=0 + --testnet-dir=/genesis + --execution-endpoints="http://{{ include "aztec-network.fullname" . }}-eth-execution.{{ .Release.Namespace }}.svc.cluster.local:8551" + --execution-jwt-secret-key="61e1dd9539e8cc37b3d71dcf8ce372f0e119cc1c73426ee80472a4214f2a41a1" + --allow-insecure-genesis-sync + --debug-level=info + volumeMounts: + - name: shared-volume + mountPath: /data + - name: genesis + mountPath: /genesis-template + resources: + {{- toYaml .Values.ethereum.beacon.resources | nindent 12 }} + volumes: + - name: shared-volume + persistentVolumeClaim: + claimName: {{ include "aztec-network.fullname" . }}-eth-beacon-pvc + - name: genesis + configMap: + name: {{ include "aztec-network.fullname" . }}-eth-beacon-genesis +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-beacon + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + {{- if .Values.network.public}} + type: LoadBalancer + {{- else }} + type: ClusterIP + {{- end }} + selector: + {{- include "aztec-network.selectorLabels" . | nindent 4 }} + app: eth-beacon + ports: + - protocol: TCP + port: {{ .Values.ethereum.beacon.service.port }} + targetPort: {{ .Values.ethereum.beacon.service.targetPort }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-beacon-genesis + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +data: + config.yaml: | + {{ .Files.Get "eth-devnet/out/config.yaml" | nindent 4 }} + deposit_contract_block.txt: | + {{ .Files.Get "eth-devnet/out/deposit_contract_block.txt" | nindent 4 }} + jwt-secret.hex: | + {{ .Files.Get "eth-devnet/out/jwt-secret.hex" | nindent 4 }} + genesis-ssz: | + {{ .Files.Get "eth-devnet/out/genesis-ssz" | nindent 4 }} +--- +{{- if gt (.Values.ethereum.replicas | int) 0 }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-beacon-pvc + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: {{ .Values.ethereum.beacon.storageSize }} +{{- end }} +--- +{{ end }} diff --git a/spartan/aztec-network/templates/eth-execution.yaml b/spartan/aztec-network/templates/eth-execution.yaml new file mode 100644 index 00000000000..39f1e722e96 --- /dev/null +++ b/spartan/aztec-network/templates/eth-execution.yaml @@ -0,0 +1,121 @@ +{{- if not .Values.ethereum.externalHost }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-execution + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.ethereum.replicas }} + selector: + matchLabels: + {{- include "aztec-network.selectorLabels" . | nindent 6 }} + app: eth-execution + template: + metadata: + labels: + {{- include "aztec-network.selectorLabels" . | nindent 8 }} + app: eth-execution + spec: + {{- if .Values.network.public }} + hostNetwork: true + {{- end }} + containers: + - name: ethereum + image: "{{ .Values.images.reth.image }}" + imagePullPolicy: {{ .Values.images.reth.pullPolicy }} + command: ["/bin/sh", "-c"] + args: + - >- + reth node + {{ include "helpers.flag" (list "http.port" .Values.ethereum.execution.service.port) }} + --http + --http.addr="0.0.0.0" + --http.api="admin,net,eth,web3,debug,trace" + --http.corsdomain="*" + --txpool.max-tx-input-bytes={{ .Values.ethereum.maxTxInputSizeBytes }} + --max-outbound-peers=0 + --max-inbound-peers=0 + --ipcdisable + --disable-discovery + --authrpc.addr="0.0.0.0" + --authrpc.port=8551 + --authrpc.jwtsecret="/genesis/jwt-secret.hex" + --chain="/genesis/genesis.json" + --datadir="/data" + -vvvv + + ports: + - containerPort: {{ .Values.ethereum.execution.service.port }} + name: eth-execution + volumeMounts: + - name: genesis + mountPath: /genesis + - name: shared-volume + mountPath: /data + resources: + {{- toYaml .Values.ethereum.resources | nindent 12 }} + volumes: + - name: shared-volume + persistentVolumeClaim: + claimName: {{ include "aztec-network.fullname" . }}-eth-execution-pvc + - name: genesis + configMap: + name: {{ include "aztec-network.fullname" . }}-eth-execution-genesis +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-execution + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + {{- if .Values.network.public }} + type: LoadBalancer + {{- else }} + type: ClusterIP + {{- end }} + selector: + {{- include "aztec-network.selectorLabels" . | nindent 4 }} + app: eth-execution + ports: + - name: jsonrpc + protocol: TCP + port: {{ .Values.ethereum.execution.service.port }} + targetPort: {{ .Values.ethereum.execution.service.targetPort }} + {{- if and (eq .Values.ethereum.execution.service.type "NodePort") .Values.ethereum.execution.service.nodePort }} + nodePort: {{ .Values.ethereum.execution.service.nodePort }} + {{- end }} + # Engine Api + - name: engine + protocol: TCP + port: 8551 + targetPort: 8551 +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-execution-genesis + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +data: + genesis.json: | + {{ .Files.Get "eth-devnet/out/genesis.json" | nindent 4 }} + jwt-secret.hex: | + {{ .Files.Get "eth-devnet/out/jwt-secret.hex" | nindent 4 }} +--- +{{- if gt (.Values.ethereum.replicas | int) 0 }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-execution-pvc + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: {{ .Values.ethereum.execution.storageSize }} +{{- end }} +--- +{{ end }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/eth-validator.yaml b/spartan/aztec-network/templates/eth-validator.yaml new file mode 100644 index 00000000000..6f259e67aad --- /dev/null +++ b/spartan/aztec-network/templates/eth-validator.yaml @@ -0,0 +1,101 @@ +{{- if not .Values.ethereum.externalHost }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-validator + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "aztec-network.selectorLabels" . | nindent 6 }} + app: eth-validator + template: + metadata: + labels: + {{- include "aztec-network.selectorLabels" . | nindent 8 }} + app: eth-validator + spec: + initContainers: + - name: create-genesis + image: maddiaa/eth2-val-tools:latest + imagePullPolicy: IfNotPresent + command: ["/bin/sh", "-c"] + # Generate keystores based on the provided mnemonic, then copy them into the /validator-setup directory + args: + - >- + echo "Generating validator keys..." && + ./eth2-val-tools keystores + --source-min=0 + --source-max=64 + --source-mnemonic="${DEPLOYMENT_MNEMONIC}" + --out-loc=data && + + mkdir -p /validator-setup && + cp -r ./data/* /validator-setup && + rm -rf /validator-setup/lodestar-secrets /validator-setup/nimbus-keys /validator-setup/prysm /validator-setup/teku-keys /validator-setup/teku-secrets && + echo "Validator key generation complete!" + env: + - name: DEPLOYMENT_MNEMONIC + value: {{ .Values.aztec.l1DeploymentMnemonic }} + volumeMounts: + - name: validator-setup + mountPath: /validator-setup + containers: + - name: eth-validator + image: "{{ .Values.images.lighthouse.image }}" + imagePullPolicy: {{ .Values.images.lighthouse.pullPolicy }} + command: ["/bin/sh", "-c"] + # Copy the genesis and validator setup into the data directory + args: + - >- + cp -r /genesis-template /genesis && + mkdir -p /data/validators && + mkdir -p /data/secrets && + cp -r /validator-setup/keys/* /data/validators && + cp -r /validator-setup/secrets/* /data/secrets && + base64 -d /genesis/genesis-ssz > /genesis/genesis.ssz && + + lighthouse vc + --datadir="/data" + --beacon-nodes="http://{{ include "aztec-network.fullname" . }}-eth-beacon.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.ethereum.beacon.service.port }}" + --testnet-dir=/genesis + --init-slashing-protection + --suggested-fee-recipient="0xff00000000000000000000000000000000c0ffee" + --debug-level=debug + volumeMounts: + - name: shared-volume + mountPath: /data + - name: genesis + mountPath: /genesis-template + - name: validator-setup + mountPath: /validator-setup + resources: + {{- toYaml .Values.ethereum.validator.resources | nindent 12 }} + volumes: + - name: shared-volume + persistentVolumeClaim: + claimName: {{ include "aztec-network.fullname" . }}-eth-validator-pvc + # Beacon genesis is defined with eth-beacon + - name: genesis + configMap: + name: {{ include "aztec-network.fullname" . }}-eth-beacon-genesis + - name: validator-setup + emptyDir: {} +{{- if gt (.Values.ethereum.replicas | int) 0 }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "aztec-network.fullname" . }}-eth-validator-pvc + labels: + {{- include "aztec-network.labels" . | nindent 4 }} +spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: {{ .Values.ethereum.validator.storageSize }} +{{- end }} +--- +{{ end }} diff --git a/spartan/aztec-network/templates/reth.yaml b/spartan/aztec-network/templates/reth.yaml deleted file mode 100644 index 323b5846874..00000000000 --- a/spartan/aztec-network/templates/reth.yaml +++ /dev/null @@ -1,172 +0,0 @@ -{{- if not .Values.ethereum.externalHost }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "aztec-network.fullname" . }}-ethereum - labels: - {{- include "aztec-network.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.ethereum.replicas }} - selector: - matchLabels: - {{- include "aztec-network.selectorLabels" . | nindent 6 }} - app: ethereum - template: - metadata: - labels: - {{- include "aztec-network.selectorLabels" . | nindent 8 }} - app: ethereum - spec: - {{- if .Values.network.public }} - hostNetwork: true - {{- end }} - initContainers: - - name: prepare-genesis - image: node:18-alpine - command: ["/bin/sh", "-c"] - args: - - | - cd /tmp - npm init -y - npm install ethers@6 - cat > derive.js << 'EOF' - const { ethers } = require('ethers'); - const fs = require('fs'); - - async function main() { - const mnemonic = process.env.DEPLOYMENT_MNEMONIC; - const wallet = ethers.Wallet.fromPhrase(mnemonic); - - const genesis = JSON.parse(fs.readFileSync('/genesis-template/genesis.json', 'utf8')); - - genesis.alloc[wallet.address] = { - balance: '0x3635c9adc5dea00000', // 1000 ETH in wei - }; - - // Generate wallets for each index - const numValidators = {{ .Values.validator.replicas }}; - const numExtraAccounts = {{ .Values.ethereum.extraAccounts }}; - const totalAccounts = numValidators + numExtraAccounts; - - const path = "m/44'/60'/0'/0/"; - for (let i = 0; i < totalAccounts; i++) { - // Derive wallet for the current index - const childWallet = ethers.HDNodeWallet.fromPhrase( - mnemonic, - null, - `${path}${i}` - ); - - // Add the wallet's address and balance to the genesis allocation - genesis.alloc[childWallet.address] = { - balance: '0x3635c9adc5dea00000', // 1000 ETH in wei - }; - - console.log(`Added wallet ${i}: ${childWallet.address}`); - } - - - // We rely on the deterministic deployment proxy to deploy the contracts - // It comes preloaded on anvil (https://book.getfoundry.sh/tutorials/create2-tutorial) - // But we need to do it ourselves for reth - // Addresses/tx in https://github.com/Arachnid/deterministic-deployment-proxy/tree/master - const deployer = '0x3fab184622dc19b6109349b94811493bf2a45362' - genesis.alloc[deployer] = { - balance: '0x3635c9adc5dea00000' // 1000 ETH in wei - }; - - fs.writeFileSync('/genesis-output/genesis.json', JSON.stringify(genesis, null, 2)); - } - - main().catch(console.error); - EOF - node derive.js - env: - - name: DEPLOYMENT_MNEMONIC - value: {{ .Values.aztec.l1DeploymentMnemonic }} - volumeMounts: - - name: genesis-template - mountPath: /genesis-template - - name: genesis-output - mountPath: /genesis-output - containers: - - name: ethereum - image: "{{ .Values.images.reth.image }}" - imagePullPolicy: {{ .Values.images.reth.pullPolicy }} - command: ["/bin/sh", "-c"] - args: - - >- - reth node {{ include "helpers.flag" (list "http.addr" "0.0.0.0") }} - {{- include "helpers.flag" (list "http.port" .Values.ethereum.service.port) }} - {{- include "helpers.flag" (list "builder.gaslimit" .Values.ethereum.gasLimit) }} - {{- include "helpers.flag" (list "txpool.gas-limit" .Values.ethereum.gasLimit) }} - {{- include "helpers.flag" (list "dev.block-time" .Values.ethereum.blockTime) }} - --chain /genesis/genesis.json - --datadir /data - --dev - ports: - - containerPort: {{ .Values.ethereum.service.port }} - name: reth - volumeMounts: - - name: shared-volume - mountPath: /data - - name: genesis-output - mountPath: /genesis - resources: - {{- toYaml .Values.ethereum.resources | nindent 12 }} - volumes: - - name: shared-volume - persistentVolumeClaim: - claimName: {{ include "aztec-network.fullname" . }}-ethereum-pvc - - name: genesis-template - configMap: - name: {{ include "aztec-network.fullname" . }}-reth-genesis - - name: genesis-output - emptyDir: {} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "aztec-network.fullname" . }}-ethereum - labels: - {{- include "aztec-network.labels" . | nindent 4 }} -spec: - {{- if .Values.network.public }} - type: LoadBalancer - {{- else }} - type: ClusterIP - clusterIP: None - {{- end }} - selector: - {{- include "aztec-network.selectorLabels" . | nindent 4 }} - app: ethereum - ports: - - protocol: TCP - port: {{ .Values.ethereum.service.port }} - targetPort: {{ .Values.ethereum.service.targetPort }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "aztec-network.fullname" . }}-reth-genesis - labels: - {{- include "aztec-network.labels" . | nindent 4 }} -data: - genesis.json: | - {{ .Files.Get "files/config/genesis.json" | nindent 4 }} ---- -{{- if gt (.Values.ethereum.replicas | int) 0 }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "aztec-network.fullname" . }}-ethereum-pvc - labels: - {{- include "aztec-network.labels" . | nindent 4 }} -spec: - accessModes: ["ReadWriteOnce"] - resources: - requests: - storage: {{ .Values.ethereum.storageSize }} -{{- end }} ---- -{{ end }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/setup-l2-contracts.yaml b/spartan/aztec-network/templates/setup-l2-contracts.yaml index 807421d84cd..804ed7cc7e1 100644 --- a/spartan/aztec-network/templates/setup-l2-contracts.yaml +++ b/spartan/aztec-network/templates/setup-l2-contracts.yaml @@ -87,9 +87,9 @@ spec: - name: NAMESPACE value: {{ .Release.Namespace }} - name: EXTERNAL_ETHEREUM_HOST - value: "{{ .Values.ethereum.externalHost }}" + value: "{{ .Values.ethereum.execution.externalHost }}" - name: ETHEREUM_PORT - value: "{{ .Values.ethereum.service.port }}" + value: "{{ .Values.ethereum.execution.service.port }}" - name: EXTERNAL_BOOT_NODE_HOST value: "{{ .Values.bootNode.externalHost }}" - name: BOOT_NODE_PORT diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 546abfb3608..16f198d6223 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -34,6 +34,9 @@ images: reth: image: ghcr.io/paradigmxyz/reth:v1.0.8 pullPolicy: IfNotPresent + lighthouse: + image: sigp/lighthouse:v6.0.1 + pullPolicy: IfNotPresent aztec: slotDuration: 24 # in seconds, aka L2 slot duration. Must be a multiple of {{ ethereum.blockTime }} @@ -218,18 +221,44 @@ bot: otelExcludeMetrics: "" ethereum: - externalHost: "" replicas: 1 chainId: 1337 - blockTime: 12sec + blockTime: 12 extraAccounts: 10 # 1 billion gas limit # helps ensure we can deploy public contracts gasLimit: "1000000000" + # 10 times the default of 131072 + maxTxInputSizeBytes: "1310720" args: "" - service: - port: 8545 - targetPort: 8545 + execution: + externalHost: "" + service: + port: 8545 + targetPort: 8545 + nodePort: "" + resources: + requests: + memory: "4Gi" + cpu: "1" + storageSize: "80Gi" + beacon: + externalHost: "" + service: + port: 5052 + targetPort: 5052 + nodePort: "" + resources: + requests: + memory: "4Gi" + cpu: "1" + storageSize: "80Gi" + validator: + resources: + requests: + memory: "4Gi" + cpu: "1" + storageSize: "80Gi" readinessProbe: initialDelaySeconds: 5 periodSeconds: 10 diff --git a/spartan/aztec-network/values/ci-smoke.yaml b/spartan/aztec-network/values/ci-smoke.yaml index 4d6cc4ad481..255ead95e7e 100644 --- a/spartan/aztec-network/values/ci-smoke.yaml +++ b/spartan/aztec-network/values/ci-smoke.yaml @@ -29,10 +29,30 @@ bot: cpu: "200m" ethereum: - resources: - requests: - memory: "2Gi" - cpu: "200m" + execution: + resources: + requests: + memory: "2Gi" + cpu: "200m" + limits: + memory: "2Gi" + cpu: "200m" + beacon: + resources: + requests: + memory: "2Gi" + cpu: "200m" + limits: + memory: "2Gi" + cpu: "200m" + validator: + resources: + requests: + memory: "2Gi" + cpu: "200m" + limits: + memory: "2Gi" + cpu: "200m" proverAgent: resources: diff --git a/spartan/aztec-network/values/ci.yaml b/spartan/aztec-network/values/ci.yaml index caedad70d8a..c08e6e294ab 100644 --- a/spartan/aztec-network/values/ci.yaml +++ b/spartan/aztec-network/values/ci.yaml @@ -4,11 +4,31 @@ aztec: epochProofClaimWindow: 2 ethereum: - blockTime: 8sec - resources: - requests: - memory: "2Gi" - cpu: "200m" + blockTime: 8 + execution: + resources: + requests: + memory: "2Gi" + cpu: "200m" + limits: + memory: "2Gi" + cpu: "200m" + beacon: + resources: + requests: + memory: "2Gi" + cpu: "200m" + limits: + memory: "2Gi" + cpu: "200m" + validator: + resources: + requests: + memory: "2Gi" + cpu: "200m" + limits: + memory: "2Gi" + cpu: "200m" telemetry: enabled: true diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 5d71747966e..40fe9eeb7d3 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -126,6 +126,7 @@ function cleanup() { } trap cleanup SIGINT SIGTERM EXIT + # if we don't have a chaos values, remove any existing chaos experiments if [ -z "${CHAOS_VALUES:-}" ] && [ "$INSTALL_CHAOS_MESH" = "true" ]; then echo "Deleting existing network chaos experiments..." @@ -133,6 +134,40 @@ if [ -z "${CHAOS_VALUES:-}" ] && [ "$INSTALL_CHAOS_MESH" = "true" ]; then fi VALUES_PATH="$REPO/spartan/aztec-network/values/$VALUES_FILE" +DEFAULT_VALUES_PATH="$REPO/spartan/aztec-network/values.yaml" + +function read_values_file() { + local key="$1" + + value=$(yq -r ".$key" "$VALUES_PATH") + if [ -z "$value" ] || [ "$value" = "null" ]; then + value=$(yq -r ".$key" "$DEFAULT_VALUES_PATH") + fi + echo "$value" +} + +## Some configuration values are set in the eth-devnet/config/config.yaml file +## and are used to generate the genesis.json file. +## We need to read these values and pass them into the eth devnet create.sh script +## so that it can generate the genesis.json and config.yaml file with the correct values. +function generate_eth_devnet_config() { + export NUMBER_OF_KEYS=$(read_values_file "validator.replicas") + export NUMBER_OF_KEYS=$(read_values_file "validator.replicas") + export MNEMONIC=$(read_values_file "aztec.l1DeploymentMnemonic") + export BLOCK_TIME=$(read_values_file "ethereum.blockTime") + export GAS_LIMIT=$(read_values_file "ethereum.gasLimit") + export CHAIN_ID=$(read_values_file "ethereum.chainId") + + echo "Generating eth devnet config..." + echo "NUMBER_OF_KEYS: $NUMBER_OF_KEYS" + echo "MNEMONIC: $MNEMONIC" + echo "BLOCK_TIME: $BLOCK_TIME" + echo "GAS_LIMIT: $GAS_LIMIT" + echo "CHAIN_ID: $CHAIN_ID" + + $REPO/spartan/aztec-network/eth-devnet/create.sh +} +generate_eth_devnet_config # Install the Helm chart helm upgrade --install spartan "$REPO/spartan/aztec-network/" \ @@ -179,11 +214,10 @@ else fi # Get the values from the values file -VALUES=$(cat "$VALUES_PATH") -ETHEREUM_SLOT_DURATION=$(yq -r '.ethereum.blockTime' <<<"$VALUES") -AZTEC_SLOT_DURATION=$(yq -r '.aztec.slotDuration' <<<"$VALUES") -AZTEC_EPOCH_DURATION=$(yq -r '.aztec.epochDuration' <<<"$VALUES") -AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$(yq -r '.aztec.epochProofClaimWindow' <<<"$VALUES") +ETHEREUM_SLOT_DURATION=$(read_values_file "ethereum.blockTime") +AZTEC_SLOT_DURATION=$(read_values_file "aztec.slotDuration") +AZTEC_EPOCH_DURATION=$(read_values_file "aztec.epochDuration") +AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$(read_values_file "aztec.epochProofClaimWindow") # Run the test if $TEST is not empty if [ -n "$TEST" ]; then diff --git a/yarn-project/end-to-end/src/spartan/4epochs.test.ts b/yarn-project/end-to-end/src/spartan/4epochs.test.ts index 2e73cf2d1dd..4aa43307071 100644 --- a/yarn-project/end-to-end/src/spartan/4epochs.test.ts +++ b/yarn-project/end-to-end/src/spartan/4epochs.test.ts @@ -37,7 +37,7 @@ describe('token transfer test', () => { hostPort: config.HOST_PXE_PORT, }); await startPortForward({ - resource: `svc/${config.INSTANCE_NAME}-aztec-network-ethereum`, + resource: `svc/${config.INSTANCE_NAME}-aztec-network-eth-execution`, namespace: config.NAMESPACE, containerPort: config.CONTAINER_ETHEREUM_PORT, hostPort: config.HOST_ETHEREUM_PORT, diff --git a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts index 6a596d83966..06007d05b7f 100644 --- a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts +++ b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts @@ -76,7 +76,7 @@ describe('a test that passively observes the network in the presence of network hostPort: HOST_PXE_PORT, }); await startPortForward({ - resource: `svc/${config.INSTANCE_NAME}-aztec-network-ethereum`, + resource: `svc/${config.INSTANCE_NAME}-aztec-network-eth-execution`, namespace: NAMESPACE, containerPort: CONTAINER_ETHEREUM_PORT, hostPort: HOST_ETHEREUM_PORT, diff --git a/yarn-project/end-to-end/src/spartan/reorg.test.ts b/yarn-project/end-to-end/src/spartan/reorg.test.ts index ad221bbade7..78d0c394232 100644 --- a/yarn-project/end-to-end/src/spartan/reorg.test.ts +++ b/yarn-project/end-to-end/src/spartan/reorg.test.ts @@ -54,7 +54,7 @@ describe('reorg test', () => { hostPort: HOST_PXE_PORT, }); await startPortForward({ - resource: `svc/${config.INSTANCE_NAME}-aztec-network-ethereum`, + resource: `svc/${config.INSTANCE_NAME}-aztec-network-eth-execution`, namespace: NAMESPACE, containerPort: CONTAINER_ETHEREUM_PORT, hostPort: HOST_ETHEREUM_PORT, diff --git a/yarn-project/end-to-end/src/spartan/smoke.test.ts b/yarn-project/end-to-end/src/spartan/smoke.test.ts index 7c94b93b369..6ab4c31309f 100644 --- a/yarn-project/end-to-end/src/spartan/smoke.test.ts +++ b/yarn-project/end-to-end/src/spartan/smoke.test.ts @@ -38,7 +38,7 @@ describe('smoke test', () => { // Leaving this test skipped commented out because it requires the ethereum node // to be running and forwarded, e.g. - // kubectl port-forward -n smoke service/spartan-aztec-network-ethereum 8545:8545 + // kubectl port-forward -n smoke service/spartan-aztec-network-eth-execution 8545:8545 // also because it assumes foundry. it.skip('should be able to get rollup info', async () => { diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index 09e49baf262..57be542f17a 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -346,6 +346,8 @@ export const deployL1Contracts = async ( account.address.toString(), rollupConfigArgs, ]; + await deployer.waitForDeployments(); + const rollupAddress = await deployer.deploy(l1Artifacts.rollup, rollupArgs); logger.verbose(`Deployed Rollup at ${rollupAddress}`, rollupConfigArgs); diff --git a/yarn-project/telemetry-client/package.json b/yarn-project/telemetry-client/package.json index 887088da917..d2f76ca021e 100644 --- a/yarn-project/telemetry-client/package.json +++ b/yarn-project/telemetry-client/package.json @@ -88,4 +88,4 @@ "../../foundation/src/jest/setup.mjs" ] } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000000..11cbfd15729 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,12 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"root-workspace-0b6124@workspace:.": + version: 0.0.0-use.local + resolution: "root-workspace-0b6124@workspace:." + languageName: unknown + linkType: soft