From 685e11ed6f394b065325fb86293db3389d01093a Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 14:27:07 -0600 Subject: [PATCH 1/9] Build lcli locally --- .../cerc-fixturenet-eth-lighthouse/Dockerfile | 2 +- .../cerc-fixturenet-plugeth-lighthouse/Dockerfile | 2 +- app/data/container-build/cerc-lighthouse-cli/build.sh | 7 +++++++ app/data/stacks/fixturenet-eth-loaded/stack.yml | 1 + app/data/stacks/fixturenet-eth-tx/stack.yml | 1 + app/data/stacks/fixturenet-plugeth-tx/stack.yml | 1 + 6 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 app/data/container-build/cerc-lighthouse-cli/build.sh diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile b/app/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile index 958d2b39..87f9bb60 100644 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile @@ -1,4 +1,4 @@ -FROM sigp/lcli:v4.1.0 AS lcli +FROM cerc/lighthouse-cli:local AS lcli FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen FROM cerc/fixturenet-eth-geth:local AS fnetgeth diff --git a/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile b/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile index 8701fe2d..ba92294b 100644 --- a/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile +++ b/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile @@ -1,4 +1,4 @@ -FROM sigp/lcli:v4.1.0 AS lcli +FROM cerc/lighthouse-cli:local AS lcli FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen FROM cerc/fixturenet-plugeth-plugeth:local AS fnetgeth diff --git a/app/data/container-build/cerc-lighthouse-cli/build.sh b/app/data/container-build/cerc-lighthouse-cli/build.sh new file mode 100755 index 00000000..a1d347cf --- /dev/null +++ b/app/data/container-build/cerc-lighthouse-cli/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Build cerc/lighthouse-cli + +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh + +project_dir=${CERC_REPO_BASE_DIR}/lighthouse +docker build -t cerc/lighthouse-cli:local -f ${project_dir}/lcli/Dockerfile ${build_command_args} ${project_dir} diff --git a/app/data/stacks/fixturenet-eth-loaded/stack.yml b/app/data/stacks/fixturenet-eth-loaded/stack.yml index 676e95e2..860e3aaf 100644 --- a/app/data/stacks/fixturenet-eth-loaded/stack.yml +++ b/app/data/stacks/fixturenet-eth-loaded/stack.yml @@ -9,6 +9,7 @@ repos: containers: - cerc/go-ethereum - cerc/lighthouse + - cerc/lighthouse-cli - cerc/fixturenet-eth-geth - cerc/fixturenet-eth-lighthouse - cerc/ipld-eth-server diff --git a/app/data/stacks/fixturenet-eth-tx/stack.yml b/app/data/stacks/fixturenet-eth-tx/stack.yml index 0281b262..185f813a 100644 --- a/app/data/stacks/fixturenet-eth-tx/stack.yml +++ b/app/data/stacks/fixturenet-eth-tx/stack.yml @@ -8,6 +8,7 @@ repos: containers: - cerc/go-ethereum - cerc/lighthouse + - cerc/lighthouse-cli - cerc/fixturenet-eth-geth - cerc/fixturenet-eth-lighthouse - cerc/tx-spammer diff --git a/app/data/stacks/fixturenet-plugeth-tx/stack.yml b/app/data/stacks/fixturenet-plugeth-tx/stack.yml index 49dea4c5..57d2c7ba 100644 --- a/app/data/stacks/fixturenet-plugeth-tx/stack.yml +++ b/app/data/stacks/fixturenet-plugeth-tx/stack.yml @@ -6,6 +6,7 @@ repos: - dboreham/foundry containers: - cerc/lighthouse + - cerc/lighthouse-cli - cerc/fixturenet-plugeth-plugeth - cerc/fixturenet-plugeth-lighthouse - cerc/tx-spammer From c120ee20864469b3551f074ae3aa9bd5e7426b45 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 14:29:07 -0600 Subject: [PATCH 2/9] Pull lighthouse repo --- app/data/stacks/fixturenet-eth-loaded/stack.yml | 1 + app/data/stacks/fixturenet-eth-tx/stack.yml | 3 ++- app/data/stacks/fixturenet-plugeth-tx/stack.yml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/data/stacks/fixturenet-eth-loaded/stack.yml b/app/data/stacks/fixturenet-eth-loaded/stack.yml index 860e3aaf..dd7e05fd 100644 --- a/app/data/stacks/fixturenet-eth-loaded/stack.yml +++ b/app/data/stacks/fixturenet-eth-loaded/stack.yml @@ -6,6 +6,7 @@ repos: - github.com/cerc-io/tx-spammer - github.com/cerc-io/ipld-eth-server - github.com/cerc-io/ipld-eth-db + - github.com/cerc-io/lighthouse containers: - cerc/go-ethereum - cerc/lighthouse diff --git a/app/data/stacks/fixturenet-eth-tx/stack.yml b/app/data/stacks/fixturenet-eth-tx/stack.yml index 185f813a..35e43575 100644 --- a/app/data/stacks/fixturenet-eth-tx/stack.yml +++ b/app/data/stacks/fixturenet-eth-tx/stack.yml @@ -4,7 +4,8 @@ decription: "Ethereum Fixturenet w/ tx-spammer" repos: - github.com/cerc-io/go-ethereum - github.com/cerc-io/tx-spammer - - dboreham/foundry + - github.com/dboreham/foundry + - github.com/cerc-io/lighthouse containers: - cerc/go-ethereum - cerc/lighthouse diff --git a/app/data/stacks/fixturenet-plugeth-tx/stack.yml b/app/data/stacks/fixturenet-plugeth-tx/stack.yml index 57d2c7ba..e6d8c615 100644 --- a/app/data/stacks/fixturenet-plugeth-tx/stack.yml +++ b/app/data/stacks/fixturenet-plugeth-tx/stack.yml @@ -3,7 +3,8 @@ name: fixturenet-plugeth-tx decription: "plugeth Ethereum Fixturenet w/ tx-spammer" repos: - github.com/cerc-io/tx-spammer - - dboreham/foundry + - github.com/dboreham/foundry + - github.com/cerc-io/lighthouse containers: - cerc/lighthouse - cerc/lighthouse-cli From 223aacb16ff1b66e5bc7d8616461c2086546dd9a Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 14:30:01 -0600 Subject: [PATCH 3/9] Enable portable lcli build --- app/data/container-build/cerc-lighthouse-cli/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/container-build/cerc-lighthouse-cli/build.sh b/app/data/container-build/cerc-lighthouse-cli/build.sh index a1d347cf..75719ef4 100755 --- a/app/data/container-build/cerc-lighthouse-cli/build.sh +++ b/app/data/container-build/cerc-lighthouse-cli/build.sh @@ -4,4 +4,4 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh project_dir=${CERC_REPO_BASE_DIR}/lighthouse -docker build -t cerc/lighthouse-cli:local -f ${project_dir}/lcli/Dockerfile ${build_command_args} ${project_dir} +docker build -t cerc/lighthouse-cli:local --build-arg PORTABLE=true -f ${project_dir}/lcli/Dockerfile ${build_command_args} ${project_dir} From 47164cb5f52209e29c87c7d94f775e4a302e796e Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 16:12:16 -0600 Subject: [PATCH 4/9] Test updated lcli command --- .../cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh index ab3ad2af..18b0ecf8 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh @@ -31,7 +31,7 @@ lcli \ --genesis-delay $GENESIS_DELAY \ --genesis-fork-version $GENESIS_FORK_VERSION \ --altair-fork-epoch $ALTAIR_FORK_EPOCH \ - --merge-fork-epoch $MERGE_FORK_EPOCH \ + --bellatrix-fork-epoch $MERGE_FORK_EPOCH \ --eth1-id $ETH1_CHAIN_ID \ --eth1-follow-distance 1 \ --seconds-per-slot $SECONDS_PER_SLOT \ From 609128d004bd4766b955e18887e60302f4540c4b Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 16:42:44 -0600 Subject: [PATCH 5/9] Blind fix for lcli error --- .../cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh index 18b0ecf8..64450bb8 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh @@ -27,6 +27,7 @@ lcli \ --deposit-contract-address $ETH1_DEPOSIT_CONTRACT_ADDRESS \ --testnet-dir $TESTNET_DIR \ --min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \ + --validator-count $VALIDATOR_COUNT --min-genesis-time $GENESIS_TIME \ --genesis-delay $GENESIS_DELAY \ --genesis-fork-version $GENESIS_FORK_VERSION \ From aa4c52c174b118a5570c716a4a0d60647c4ca1dd Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 16:43:38 -0600 Subject: [PATCH 6/9] Fix typo --- .../cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh index 64450bb8..2245fe0e 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh @@ -27,7 +27,7 @@ lcli \ --deposit-contract-address $ETH1_DEPOSIT_CONTRACT_ADDRESS \ --testnet-dir $TESTNET_DIR \ --min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \ - --validator-count $VALIDATOR_COUNT + --validator-count $VALIDATOR_COUNT \ --min-genesis-time $GENESIS_TIME \ --genesis-delay $GENESIS_DELAY \ --genesis-fork-version $GENESIS_FORK_VERSION \ From 3748fa38b181a62988092618c5bd17596285313e Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 23:01:43 -0600 Subject: [PATCH 7/9] Update ldcli options --- .../cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh index ab3ad2af..2245fe0e 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh @@ -27,11 +27,12 @@ lcli \ --deposit-contract-address $ETH1_DEPOSIT_CONTRACT_ADDRESS \ --testnet-dir $TESTNET_DIR \ --min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \ + --validator-count $VALIDATOR_COUNT \ --min-genesis-time $GENESIS_TIME \ --genesis-delay $GENESIS_DELAY \ --genesis-fork-version $GENESIS_FORK_VERSION \ --altair-fork-epoch $ALTAIR_FORK_EPOCH \ - --merge-fork-epoch $MERGE_FORK_EPOCH \ + --bellatrix-fork-epoch $MERGE_FORK_EPOCH \ --eth1-id $ETH1_CHAIN_ID \ --eth1-follow-distance 1 \ --seconds-per-slot $SECONDS_PER_SLOT \ From fd40aedadda730507a555f5203af1d146bf3ae75 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 4 Jun 2023 23:03:48 -0600 Subject: [PATCH 8/9] Add lcli container to fixturenet-eth stack --- app/data/stacks/fixturenet-eth/stack.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/data/stacks/fixturenet-eth/stack.yml b/app/data/stacks/fixturenet-eth/stack.yml index ccd2526a..ae06e2d2 100644 --- a/app/data/stacks/fixturenet-eth/stack.yml +++ b/app/data/stacks/fixturenet-eth/stack.yml @@ -3,10 +3,12 @@ name: fixturenet-eth decription: "Ethereum Fixturenet" repos: - github.com/cerc-io/go-ethereum + - github.com/cerc-io/lighthouse - github.com/dboreham/foundry containers: - cerc/go-ethereum - cerc/lighthouse + - cerc/lighthouse-cli - cerc/fixturenet-eth-geth - cerc/fixturenet-eth-lighthouse - cerc/foundry From 91d3613247bbbad4b3a7974450cdd9c32021ecea Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Mon, 5 Jun 2023 15:45:07 -0500 Subject: [PATCH 9/9] Include --eth1-block-hash --- .../cerc-fixturenet-eth-geth/Dockerfile | 12 ++++++++++++ .../genesis/cl/build_cl.sh | 1 + .../genesis/cl/vars.env | 2 ++ 3 files changed, 15 insertions(+) diff --git a/app/data/container-build/cerc-fixturenet-eth-geth/Dockerfile b/app/data/container-build/cerc-fixturenet-eth-geth/Dockerfile index 666f9117..dc81eb06 100644 --- a/app/data/container-build/cerc-fixturenet-eth-geth/Dockerfile +++ b/app/data/container-build/cerc-fixturenet-eth-geth/Dockerfile @@ -22,6 +22,18 @@ COPY run-el.sh /opt/testnet/run.sh RUN cd /opt/testnet && make genesis-el COPY --from=geth /usr/local/bin/geth /usr/local/bin/ + +# Snag the genesis block info. RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey +RUN cp -rp ~/ethdata ~/tmpeth && \ + geth --datadir ~/tmpeth init /opt/testnet/build/el/geth.json && \ + geth --datadir ~/tmpeth --http & \ + sleep 5 && \ + curl -q --location 'localhost:8545' \ + --header 'Content-Type: application/json' \ + --data '{ "jsonrpc": "2.0", "id": 14, "method": "eth_getBlockByNumber", "params": ["0x0", false] }' \ + -o /opt/testnet/build/el/genesis_block.json && \ + killall -9 geth && \ + rm -rf ~/tmpeth ENTRYPOINT ["/opt/testnet/run.sh"] diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh index 2245fe0e..50b3e4e6 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh @@ -34,6 +34,7 @@ lcli \ --altair-fork-epoch $ALTAIR_FORK_EPOCH \ --bellatrix-fork-epoch $MERGE_FORK_EPOCH \ --eth1-id $ETH1_CHAIN_ID \ + --eth1-block-hash $ETH1_BLOCK_HASH \ --eth1-follow-distance 1 \ --seconds-per-slot $SECONDS_PER_SLOT \ --seconds-per-eth1-block $SECONDS_PER_ETH1_BLOCK \ diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env index b8c27349..f2060a9a 100644 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env @@ -42,7 +42,9 @@ VC_ARGS=${VC_ARGS:-""} EXECUTION_ENDPOINT=${EXECUTION_ENDPOINT:-http://localhost:8551} ETH1_GENESIS_JSON=${ETH1_GENESIS_JSON:-"../build/el/geth.json"} +ETH1_GENESIS_BLOCK_JSON=${ETH1_GENESIS_BLOCK_JSON:-"../build/el/genesis_block.json"} ETH1_CONFIG_YAML=${ETH1_CONFIG_YAML:-"../el/el-config.yaml"} +ETH1_BLOCK_HASH=${ETH1_BLOCK_HASH:-`cat $ETH1_GENESIS_BLOCK_JSON | jq -r '.result.hash' | cut -d'x' -f2`} ETH1_CHAIN_ID=${ETH1_CHAIN_ID:-`cat $ETH1_GENESIS_JSON | jq -r '.config.chainId'`} ETH1_TTD=${ETH1_TTD:-`cat $ETH1_GENESIS_JSON | jq -r '.config.terminalTotalDifficulty'`}