Compare commits

...

23 Commits
main ... main

Author SHA1 Message Date
fca61c0981 Update .gitea/workflows/triggers/publish-fixturenet-eth-images
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 23m27s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 18m23s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest) (push) Successful in 30m52s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest-arm) (push) Successful in 31m3s
2024-08-29 18:06:43 +00:00
f20687674a Add ipld-eth-server to plugeth fixturenet (#21)
All checks were successful
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 19m1s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest-arm) (push) Successful in 28m42s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest) (push) Successful in 32m24s
Part of cerc-io/stack-orchestrator#905.

Reviewed-on: cerc-io/fixturenet-eth-stacks#21
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2024-08-05 19:15:58 +00:00
61bad072f8 Support validator withdrawals (#19)
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 23m28s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 24m11s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest) (push) Successful in 31m30s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest-arm) (push) Successful in 42m4s
Adds CL spec settings to enable validator withdrawals and expedite them by reducing the delays between withdrawal (and validator exit) initiation and execution.

To create a testnet genesis Beacon state where withdrawals and exits are possible, this also depends on cerc-io/lighthouse#1.

Reviewed-on: cerc-io/fixturenet-eth-stacks#19
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2024-08-05 14:06:43 +00:00
f2d11f314c Trigger container publish job
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 22m15s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 20m8s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest) (push) Successful in 28m30s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest-arm) (push) Successful in 38m11s
2024-08-01 14:10:08 +00:00
7ef20f94b3 Trigger container publish job
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 21m45s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 19m47s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest) (push) Successful in 28m22s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest-arm) (push) Successful in 34m1s
2024-07-31 19:37:02 +00:00
27503949ab Add Slack alerts for CI test failures (#20)
Some checks failed
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Has been cancelled
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest) (push) Has been cancelled
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (ubuntu-latest-arm) (push) Has been cancelled
To replace the alerts in the stack-orchestrator repo.

Reviewed-on: cerc-io/fixturenet-eth-stacks#20
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2024-07-31 19:30:21 +00:00
fe5e10fdbc Fix status script fork check (#18)
All checks were successful
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 18m37s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (push) Successful in 27m28s
Fixes the `status.sh` script to recognize Capella and Deneb as post-Merge forks.

Fixes cerc-io/fixturenet-eth-stacks#17.

Reviewed-on: cerc-io/fixturenet-eth-stacks#18
2024-07-24 03:28:58 +00:00
4c886dbdd1 Add geth API flags for statediff (#16)
All checks were successful
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 18m15s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (push) Successful in 27m20s
Patch for Plugeth stack. `statediff` RPC API is currently only used by ipld-eth-server.

Reviewed-on: cerc-io/fixturenet-eth-stacks#16
2024-07-13 11:08:17 +00:00
0d63b95f7d Add Plugeth stack (#14)
All checks were successful
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 17m31s
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (push) Successful in 26m34s
Adds definitions for Plugeth stack and `ipld-eth-db`.

Uses cerc-io/stack-orchestrator#851 in tests.

Reviewed-on: cerc-io/fixturenet-eth-stacks#14
2024-07-10 01:28:09 +00:00
f20f91422b Use state.scheme=hash (#15)
All checks were successful
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 18m34s
As of [Geth 1.14](https://github.com/ethereum/go-ethereum/releases/tag/v1.14.0), state storage defaults to `--state.scheme=path` mode for new DBs. This doesn't yet support archiving, so for now we need to explicitly use the old `hash` scheme.

Reviewed-on: cerc-io/fixturenet-eth-stacks#15
2024-07-10 01:27:58 +00:00
e1faeb9eca Trigger container publish job
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 20m45s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 19m17s
2024-06-20 15:50:32 +00:00
af0c6a9143 Add an option to allow unprotected txs in geth (#8)
All checks were successful
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 18m50s
Part of [Update Optimism stack to use Bedrock release](https://www.notion.so/Update-Optimism-stack-to-use-Bedrock-release-e44a490247724a6095a9fbc19fba3bcd)
- Add an env option (`CERC_ALLOW_UNPROTECTED_TXS`) to allow unprotected (non `EIP155`) txs in fixturenet geth node (disables replay protection)
  - Required by `fixturenet-optimism`

Reviewed-on: cerc-io/fixturenet-eth-stacks#8
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-06-05 12:55:29 +00:00
fc8abf7bc4 Enable run on trigger
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 26m31s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 18m13s
2024-06-04 10:41:07 -06:00
0002a90523 Rename for clarity
All checks were successful
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 29m35s
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Successful in 29m55s
2024-06-04 10:00:01 -06:00
4296951f60 Tidy up job
All checks were successful
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Successful in 36m25s
Publish Ethereum Fixturenet Stack Container Images / Publish Ethereum Fixturenet Stack Container Images (push) Successful in 36m46s
2024-06-04 08:43:28 -06:00
c4a45b7f04 Merge pull request 'Add job for image publication' (#12) from dboreham/publish-container-images into main
Some checks are pending
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Waiting to run
Publish Ethereum Fixturenet Stack Container Images / Run Ethereum Fixturenet stack test (push) Waiting to run
Reviewed-on: cerc-io/fixturenet-eth-stacks#12
2024-06-04 14:40:07 +00:00
e6f2ec632f Add job for image publication 2024-06-04 08:38:23 -06:00
99ea065389 Use geth v1.14 (#7)
All checks were successful
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Successful in 24m49s
Co-authored-by: David Boreham <david@bozemanpass.com>
Reviewed-on: cerc-io/fixturenet-eth-stacks#7
2024-05-31 18:07:20 +00:00
5f7798f392 Change schedule to try to get gitea to re-index
All checks were successful
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Successful in 21m18s
2024-05-20 11:50:52 +00:00
759aeb245f Update .gitea/workflows/fixturenet-eth-stack.yml
All checks were successful
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Successful in 21m11s
2024-05-17 02:36:45 +00:00
270cdd6eb3 Update .gitea/workflows/fixturenet-eth-stack.yml
Some checks failed
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Has been cancelled
2024-05-17 02:36:17 +00:00
0430199348 Try making schedule definition exactly the same as in SO
All checks were successful
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Successful in 21m4s
2024-05-15 09:09:38 -06:00
897a4bc997 Remove geth2 ports (#9)
Some checks failed
Ethereum Fixturenet Stack Test / Run Ethereum Fixturenet stack test (push) Failing after 55s
Not exposing the geth-2 ports will allow us to use `deploy init --map-ports-to-host any-same` without creating conflicts.

Reviewed-on: cerc-io/fixturenet-eth-stacks#9
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-05-08 21:53:38 +00:00
39 changed files with 716 additions and 218 deletions

View File

@ -0,0 +1,43 @@
name: Publish Ethereum Fixturenet Stack Container Images
on:
push:
branches: 'main'
paths:
- '!**'
- '.gitea/workflows/triggers/publish-fixturenet-eth-images'
- '.gitea/workflows/publish-fixturenet-eth-images.yml'
jobs:
publish:
name: "Publish Ethereum Fixturenet Stack Container Images"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
# At present the stock setup-python action fails on Linux/aarch64
# Conditional steps below workaroud this by using deadsnakes for that case only
- name: "Install Python for ARM on Linux"
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
uses: deadsnakes/action@v3.0.1
with:
python-version: '3.8'
- name: "Install Python cases other than ARM on Linux"
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install stack orchestrator"
run: ./scripts/install-so.sh
- name: "Build containers"
run: |
PATH=$PATH:~/bin
laconic-so --quiet --stack $(pwd)/stack-orchestrator/stacks/fixturenet-eth setup-repositories
laconic-so --stack $(pwd)/stack-orchestrator/stacks/fixturenet-eth build-containers
- name: "Publish container images"
run: |
PATH=$PATH:~/bin
echo ${{ secrets.CICD_PUBLISH_TOKEN }} | docker login git.vdb.to -u cerccicd --password-stdin
laconic-so --stack $(pwd)/stack-orchestrator/stacks/fixturenet-eth build-containers --publish-images --image-registry git.vdb.to/cerc-io

View File

@ -1,14 +1,11 @@
name: Ethereum Fixturenet Stack Test name: Test Ethereum Fixturenet Stack
on: on:
pull_request:
branches: '*'
push: push:
branches: branches: '*'
- main pull_request:
- ci-test
schedule: # Note: coordinate with other tests to not overload runners at the same time of day schedule: # Note: coordinate with other tests to not overload runners at the same time of day
- cron: '17 25 * * *' - cron: '12 01 * * *'
jobs: jobs:
test: test:
@ -37,3 +34,20 @@ jobs:
run: | run: |
PATH=$PATH:~/bin PATH=$PATH:~/bin
./tests/fixturenet-eth-stack/run-test.sh ./tests/fixturenet-eth-stack/run-test.sh
- name: Notify Vulcanize Slack on CI failure
if: ${{ always() && github.ref_name == 'main' }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }}
- name: Notify DeepStack Slack on CI failure
if: ${{ always() && github.ref_name == 'main' }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }}

View File

@ -0,0 +1,56 @@
name: Test Ethereum Plugeth Fixturenet Stack
on:
push:
branches: '*'
pull_request:
schedule: # Note: coordinate with other tests to not overload runners at the same time of day
- cron: '14 01 * * *'
jobs:
test:
name: "Test fixturenet-plugeth stack"
strategy:
matrix:
os: [ubuntu-latest, ubuntu-latest-arm]
runs-on: ${{ matrix.os }}
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
# At present the stock setup-python action fails on Linux/aarch64
# Conditional steps below workaroud this by using deadsnakes for that case only
- name: "Install Python for ARM on Linux"
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
uses: deadsnakes/action@v3.0.1
with:
python-version: 3.11
- name: "Install Python cases other than ARM on Linux"
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Print Python version"
run: python3 --version
- name: "Install stack orchestrator"
run: ./scripts/install-so.sh
- name: "Run stack tests"
run: |
PATH=$PATH:~/bin
./tests/fixturenet-plugeth-stack/run-test.sh
- name: Notify Vulcanize Slack on CI failure
if: ${{ always() && github.ref_name == 'main' }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }}
- name: Notify DeepStack Slack on CI failure
if: ${{ always() && github.ref_name == 'main' }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }}

View File

@ -0,0 +1,2 @@
# Change this file to trigger the job publish-fixturenet-eth-images.yml
5

View File

@ -1,5 +1,3 @@
version: '3.7'
services: services:
fixturenet-eth-bootnode-geth: fixturenet-eth-bootnode-geth:
restart: always restart: always
@ -22,9 +20,8 @@ services:
- SYS_PTRACE - SYS_PTRACE
environment: environment:
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true} CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
CERC_STATEDIFF_DB_NODE_ID: 1
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_ALLOW_UNPROTECTED_TXS: ${CERC_ALLOW_UNPROTECTED_TXS:-false}
env_file: env_file:
- ../config/fixturenet-eth/fixturenet-eth.env - ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-eth-geth:local image: cerc/fixturenet-eth-geth:local
@ -62,9 +59,6 @@ services:
- fixturenet-eth-bootnode-geth - fixturenet-eth-bootnode-geth
volumes: volumes:
- fixturenet_eth_geth_2_data:/root/ethdata - fixturenet_eth_geth_2_data:/root/ethdata
ports:
- "8545"
- "8546"
fixturenet-eth-bootnode-lighthouse: fixturenet-eth-bootnode-lighthouse:
restart: always restart: always

View File

@ -0,0 +1,135 @@
services:
fixturenet-eth-bootnode-geth:
restart: always
hostname: fixturenet-eth-bootnode-geth
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
environment:
RUN_BOOTNODE: "true"
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
image: cerc/fixturenet-plugeth-plugeth:local
volumes:
- fixturenet_plugeth_bootnode_geth_data:/root/ethdata
- fixturenet_plugeth_bootnode_geth_config:/opt/testnet/build/el
ports:
- "9898"
- "30303"
fixturenet-eth-geth-1:
restart: always
hostname: fixturenet-eth-geth-1
cap_add:
- SYS_PTRACE
environment:
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
CERC_STATEDIFF_DB_NODE_ID: 1
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_ALLOW_UNPROTECTED_TXS: ${CERC_ALLOW_UNPROTECTED_TXS:-false}
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
- ../config/fixturenet-plugeth/statediff.env
image: cerc/fixturenet-plugeth-plugeth:local
volumes:
- fixturenet_plugeth_geth_1_data:/root/ethdata
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8545/"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
depends_on:
- fixturenet-eth-bootnode-geth
ports:
- "8545"
- "8546"
- "40000"
- "6060"
fixturenet-eth-geth-2:
restart: always
hostname: fixturenet-eth-geth-2
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8545/"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
environment:
CERC_KEEP_RUNNING_AFTER_GETH_EXIT: "true"
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-plugeth-plugeth:local
depends_on:
- fixturenet-eth-bootnode-geth
volumes:
- fixturenet_plugeth_geth_2_data:/root/ethdata
ports:
- "8545"
- "8546"
fixturenet-eth-bootnode-lighthouse:
restart: always
hostname: fixturenet-eth-bootnode-lighthouse
environment:
RUN_BOOTNODE: "true"
image: cerc/fixturenet-eth-lighthouse:local
fixturenet-eth-lighthouse-1:
restart: always
hostname: fixturenet-eth-lighthouse-1
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8001/eth/v2/beacon/blocks/head"]
interval: 30s
timeout: 10s
retries: 10
start_period: 30s
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
environment:
NODE_NUMBER: "1"
ETH1_ENDPOINT: "http://fixturenet-eth-geth-1:8545"
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-1:8551"
image: cerc/fixturenet-eth-lighthouse:local
volumes:
- fixturenet_plugeth_lighthouse_1_data:/opt/testnet/build/cl
depends_on:
fixturenet-eth-bootnode-lighthouse:
condition: service_started
fixturenet-eth-geth-1:
condition: service_healthy
ports:
- "8001"
fixturenet-eth-lighthouse-2:
restart: always
hostname: fixturenet-eth-lighthouse-2
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8001/eth/v2/beacon/blocks/head"]
interval: 30s
timeout: 10s
retries: 10
start_period: 30s
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
environment:
NODE_NUMBER: "2"
ETH1_ENDPOINT: "http://fixturenet-eth-geth-2:8545"
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-2:8551"
LIGHTHOUSE_GENESIS_STATE_URL: "http://fixturenet-eth-lighthouse-1:8001/eth/v2/debug/beacon/states/0"
image: cerc/fixturenet-eth-lighthouse:local
volumes:
- fixturenet_plugeth_lighthouse_2_data:/opt/testnet/build/cl
depends_on:
fixturenet-eth-bootnode-lighthouse:
condition: service_started
fixturenet-eth-geth-2:
condition: service_healthy
volumes:
fixturenet_plugeth_bootnode_geth_data:
fixturenet_plugeth_bootnode_geth_config:
fixturenet_plugeth_geth_1_data:
fixturenet_plugeth_geth_2_data:
fixturenet_plugeth_lighthouse_1_data:
fixturenet_plugeth_lighthouse_2_data:

View File

@ -0,0 +1,28 @@
services:
migrations:
restart: on-failure
depends_on:
ipld-eth-db:
condition: service_healthy
image: cerc/ipld-eth-db:local
environment:
DATABASE_USER: "vdbm"
DATABASE_NAME: "cerc_testing"
DATABASE_PASSWORD: "password"
DATABASE_HOSTNAME: "ipld-eth-db"
DATABASE_PORT: 5432
ipld-eth-db:
image: timescale/timescaledb:latest-pg14
restart: always
environment:
POSTGRES_USER: "vdbm"
POSTGRES_DB: "cerc_testing"
POSTGRES_PASSWORD: "password"
ports:
- "127.0.0.1:8077:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "vdbm"]
interval: 2s
timeout: 1s
retries: 3

View File

@ -0,0 +1,43 @@
services:
ipld-eth-server:
restart: unless-stopped
depends_on:
ipld-eth-db:
condition: service_healthy
image: cerc/ipld-eth-server:local
environment:
SERVER_HTTP_PATH: 0.0.0.0:8081
SERVER_GRAPHQL: "true"
SERVER_GRAPHQLPATH: 0.0.0.0:8082
ETH_CHAIN_CONFIG: "/opt/config/chain.json"
DATABASE_NAME: cerc_testing
DATABASE_HOSTNAME: ipld-eth-db
DATABASE_PORT: 5432
DATABASE_USER: "vdbm"
DATABASE_PASSWORD: "password"
ETH_FORWARD_ETH_CALLS: "false"
ETH_FORWARD_GET_STORAGE_AT: "false"
ETH_PROXY_ON_ERROR: "false"
METRICS: "true"
PROM_HTTP: "true"
PROM_HTTP_ADDR: "0.0.0.0"
PROM_HTTP_PORT: "8090"
LOG_LEVEL: "debug"
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
volumes:
- fixturenet_plugeth_bootnode_geth_config:/opt/config
ports:
- "8081"
- "8082"
- "8090"
- "40000"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "8081"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
volumes:
fixturenet_plugeth_bootnode_geth_config:

View File

@ -11,15 +11,8 @@ JWT="0x6cdcac3501046a08e186730dd8bd136cfaf0fdc1fc955f6e15ad3068c0ff2af0"
# URL to download the ENR of the lighthouse bootnode (generated at first start). # URL to download the ENR of the lighthouse bootnode (generated at first start).
ENR_URL="http://fixturenet-eth-bootnode-lighthouse:3000/bootnode/enr.dat" ENR_URL="http://fixturenet-eth-bootnode-lighthouse:3000/bootnode/enr.dat"
# DB connection settings for statediffing (see docker-compose-db.yml) CERC_GETH_VMODULE="rpc/*=5"
CERC_STATEDIFF_DB_HOST="ipld-eth-db"
CERC_STATEDIFF_DB_PORT=5432
CERC_STATEDIFF_DB_NAME="cerc_testing"
CERC_STATEDIFF_DB_USER="vdbm"
CERC_STATEDIFF_DB_PASSWORD="password"
CERC_STATEDIFF_DB_GOOSE_MIN_VER=${CERC_STATEDIFF_DB_GOOSE_MIN_VER:-18}
CERC_STATEDIFF_DB_LOG_STATEMENTS="${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false}"
CERC_STATEDIFF_WORKERS=2
CERC_GETH_VMODULE="statediff/*=5,rpc/*=5"
CERC_GETH_VERBOSITY=${CERC_GETH_VERBOSITY:-3} CERC_GETH_VERBOSITY=${CERC_GETH_VERBOSITY:-3}
# --debug-level
DEBUG_LEVEL=${LIGHTHOUSE_DEBUG_LEVEL:-info}

View File

@ -0,0 +1,12 @@
# DB connection settings for statediffing (see docker-compose-db.yml)
CERC_STATEDIFF_DB_HOST="ipld-eth-db"
CERC_STATEDIFF_DB_PORT=5432
CERC_STATEDIFF_DB_NAME="cerc_testing"
CERC_STATEDIFF_DB_USER="vdbm"
CERC_STATEDIFF_DB_PASSWORD="password"
CERC_STATEDIFF_DB_GOOSE_MIN_VER=${CERC_STATEDIFF_DB_GOOSE_MIN_VER:-21}
CERC_STATEDIFF_DB_LOG_STATEMENTS="${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false}"
CERC_STATEDIFF_WORKERS=2
CERC_GETH_HTTP_APIS="eth,web3,net,admin,personal,debug,statediff"
CERC_GETH_WS_APIS="eth,web3,net,admin,personal,debug,statediff"

View File

@ -0,0 +1,19 @@
FROM ethpandaops/ethereum-genesis-generator:3.0.0 AS ethgen
# Build genesis config
ADD genesis /opt/genesis
WORKDIR /opt/genesis
RUN make genesis-el
RUN jq ".config" build/el/geth.json > build/el/chain.json
FROM golang:1.21-alpine as builder
COPY --from=ethgen /opt/genesis /opt/genesis
# Snag the genesis block info.
RUN CGO_ENABLED=0 go install github.com/cerc-io/eth-dump-genblock@v0.2.0
RUN eth-dump-genblock /opt/genesis/build/el/geth.json > /opt/genesis/build/el/genesis_block.json
FROM alpine:latest
COPY --from=builder /opt/genesis /opt/genesis

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Build cerc/fixturenet-eth-genesis-postmerge
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/fixturenet-eth-genesis-postmerge:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR

View File

@ -6,7 +6,7 @@ genesis: genesis-el
.PHONY: genesis-el .PHONY: genesis-el
genesis-el: genesis-el:
cd el; ./build_el.sh cd el && . /apps/el-gen/.venv/bin/activate && ./build_el.sh
.PHONY: clean .PHONY: clean
clean: clean:

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
# See: https://github.com/skylenet/ethereum-genesis-generator/blob/master/entrypoint.sh
rm -rf ../build/el
mkdir -p ../build/el
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
envsubst < el-config.yaml > $tmp_dir/genesis-config.yaml
python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \
jq 'del(.config.pragueTime)' \
> ../build/el/geth.json
python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv

View File

@ -10,22 +10,8 @@ el_premine_addrs: {}
chain_id: 1212 chain_id: 1212
deposit_contract_address: "0x1212121212121212121212121212121212121212" deposit_contract_address: "0x1212121212121212121212121212121212121212"
genesis_timestamp: 0 genesis_timestamp: 0
terminal_total_difficulty: 1000 genesis_delay: 0
homestead_block: 1 deneb_fork_epoch: 0
eip150_block: 1 # note: only needed as workaround https://github.com/ethpandaops/ethereum-genesis-generator/pull/105
eip155_block: 1 electra_fork_epoch: 0
eip158_block: 1 slot_duration_in_seconds: 3
byzantium_block: 1
constantinople_block: 1
petersburg_block: 1
istanbul_block: 1
berlin_block: 1
london_block: 1
merge_fork_block: 1
clique:
enabled: false
signers:
- 36d56343bc308d4ffaac2f793d121aba905fa6cc
- 5e762d4a3847cadaf40a4b0c39574b0ff6698c78
- 15d7acc1019fdf8ab4f0f7bd31ec1487ecb5a2bd

View File

@ -1,28 +0,0 @@
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
FROM golang:1.20-alpine as builder
RUN apk add --no-cache python3 py3-pip
COPY genesis /opt/genesis
# Install ethereum-genesis-generator tools
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
COPY --from=ethgen /apps /apps
RUN cd /apps/el-gen && pip3 install --break-system-packages -r requirements.txt
# web3==5.24.0 used by el-gen is broken on python 3.11
RUN pip3 install --break-system-packages --upgrade "web3==6.5.0"
RUN pip3 install --break-system-packages --upgrade "typing-extensions"
# Build genesis config
RUN apk add --no-cache make bash envsubst jq
RUN cd /opt/genesis && make genesis-el
# Snag the genesis block info.
RUN go install github.com/cerc-io/eth-dump-genblock@latest
RUN eth-dump-genblock /opt/genesis/build/el/geth.json > /opt/genesis/build/el/genesis_block.json
FROM alpine:latest
COPY --from=builder /opt/genesis /opt/genesis

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
# Build cerc/fixturenet-eth-genesis-premerge
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/fixturenet-eth-genesis-premerge:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR

View File

@ -1,40 +0,0 @@
#!/usr/bin/env bash
set -e
# See: https://github.com/skylenet/ethereum-genesis-generator/blob/master/entrypoint.sh
rm -rf ../build/el
mkdir -p ../build/el
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
envsubst < el-config.yaml > $tmp_dir/genesis-config.yaml
ttd=`cat $tmp_dir/genesis-config.yaml | grep terminal_total_difficulty | awk '{ print $2 }'`
homestead_block=`cat $tmp_dir/genesis-config.yaml | grep homestead_block | awk '{ print $2 }'`
eip150_block=`cat $tmp_dir/genesis-config.yaml | grep eip150_block | awk '{ print $2 }'`
eip155_block=`cat $tmp_dir/genesis-config.yaml | grep eip155_block | awk '{ print $2 }'`
eip158_block=`cat $tmp_dir/genesis-config.yaml | grep eip158_block | awk '{ print $2 }'`
byzantium_block=`cat $tmp_dir/genesis-config.yaml | grep byzantium_block | awk '{ print $2 }'`
constantinople_block=`cat $tmp_dir/genesis-config.yaml | grep constantinople_block | awk '{ print $2 }'`
petersburg_block=`cat $tmp_dir/genesis-config.yaml | grep petersburg_block | awk '{ print $2 }'`
istanbul_block=`cat $tmp_dir/genesis-config.yaml | grep istanbul_block | awk '{ print $2 }'`
berlin_block=`cat $tmp_dir/genesis-config.yaml | grep berlin_block | awk '{ print $2 }'`
london_block=`cat $tmp_dir/genesis-config.yaml | grep london_block | awk '{ print $2 }'`
merge_fork_block=`cat $tmp_dir/genesis-config.yaml | grep merge_fork_block | awk '{ print $2 }'`
python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \
jq ".config.terminalTotalDifficulty=$ttd" | \
jq ".config.homesteadBlock=$homestead_block" | \
jq ".config.eip150Block=$eip150_block" | \
jq ".config.eip155Block=$eip155_block" | \
jq ".config.eip158Block=$eip158_block" | \
jq ".config.byzantiumBlock=$byzantium_block" | \
jq ".config.constantinopleBlock=$constantinople_block" | \
jq ".config.petersburgBlock=$petersburg_block" | \
jq ".config.istanbulBlock=$istanbul_block" | \
jq ".config.berlinBlock=$berlin_block" | \
jq ".config.londonBlock=$london_block" | \
jq ".config.mergeForkBlock=$merge_fork_block" | \
jq ".config.mergeNetsplitBlock=$merge_fork_block" \
> ../build/el/geth.json
python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv

View File

@ -1,5 +1,5 @@
FROM cerc/fixturenet-eth-genesis-premerge:local as fnetgen FROM cerc/fixturenet-eth-genesis-postmerge:local as fnetgen
FROM ethereum/client-go:release-1.11 as geth FROM ethereum/client-go:release-1.14 as geth
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile # Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
FROM golang:1.21-alpine as delve FROM golang:1.21-alpine as delve
@ -16,6 +16,8 @@ COPY --from=geth /usr/local/bin/geth /usr/local/bin/
COPY --from=fnetgen /opt/genesis /opt/testnet COPY --from=fnetgen /opt/genesis /opt/testnet
# Initialize the geth db with our config # Initialize the geth db with our config
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey RUN geth --datadir ~/ethdata --state.scheme hash \
init /opt/testnet/build/el/geth.json && \
rm -f ~/ethdata/geth/nodekey
ENTRYPOINT ["/opt/testnet/run.sh"] ENTRYPOINT ["/opt/testnet/run.sh"]

View File

@ -6,7 +6,7 @@ fi
ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2` ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2`
NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'` NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'`
NETRESTRICT=`ip addr | grep 'inet ' | grep -v '127.0' | head -1 | awk '{print $2}'` NETRESTRICT=`ip addr | grep -w inet | grep -v '127.0' | awk '{print $2}'`
CERC_ETH_DATADIR="${CERC_ETH_DATADIR:-$HOME/ethdata}" CERC_ETH_DATADIR="${CERC_ETH_DATADIR:-$HOME/ethdata}"
CERC_PLUGINS_DIR="${CERC_PLUGINS_DIR:-/usr/local/lib/plugeth}" CERC_PLUGINS_DIR="${CERC_PLUGINS_DIR:-/usr/local/lib/plugeth}"
@ -50,6 +50,64 @@ else
echo -n "$JWT" > /opt/testnet/build/el/jwtsecret echo -n "$JWT" > /opt/testnet/build/el/jwtsecret
if [ "$CERC_RUN_STATEDIFF" == "detect" ] && [ -n "$CERC_STATEDIFF_DB_HOST" ]; then
dig_result=$(dig $CERC_STATEDIFF_DB_HOST +short)
dig_status_code=$?
if [[ $dig_status_code = 0 && -n $dig_result ]]; then
echo "Statediff DB at $CERC_STATEDIFF_DB_HOST"
CERC_RUN_STATEDIFF="true"
else
echo "No statediff DB available."
CERC_RUN_STATEDIFF="false"
fi
fi
STATEDIFF_OPTS=""
if [ "$CERC_RUN_STATEDIFF" == "true" ]; then
ready=0
echo "Waiting for statediff DB..."
while [ $ready -eq 0 ]; do
sleep 1
export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD"
result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \
-p "$CERC_STATEDIFF_DB_PORT" \
-U "$CERC_STATEDIFF_DB_USER" \
-d "$CERC_STATEDIFF_DB_NAME" \
-t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }')
if [ -n "$result" ]; then
echo "DB ready."
if [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then
ready=1
else
echo "DB not at required version (want $CERC_STATEDIFF_DB_GOOSE_MIN_VER, have $result)"
fi
fi
done
STATEDIFF_OPTS="--statediff \
--statediff.db.host=$CERC_STATEDIFF_DB_HOST \
--statediff.db.name=$CERC_STATEDIFF_DB_NAME \
--statediff.db.nodeid=$CERC_STATEDIFF_DB_NODE_ID \
--statediff.db.password=$CERC_STATEDIFF_DB_PASSWORD \
--statediff.db.port=$CERC_STATEDIFF_DB_PORT \
--statediff.db.user=$CERC_STATEDIFF_DB_USER \
--statediff.db.logstatements=${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false} \
--statediff.db.copyfrom=${CERC_STATEDIFF_DB_COPY_FROM:-true} \
--statediff.waitforsync=true \
--statediff.workers=${CERC_STATEDIFF_WORKERS:-1} \
--statediff.writing=true"
if [ -d "${CERC_PLUGINS_DIR}" ]; then
# With plugeth, we separate the statediff options by prefixing with ' -- '
STATEDIFF_OPTS="--pluginsdir "${CERC_PLUGINS_DIR}" -- ${STATEDIFF_OPTS}"
fi
fi
OTHER_OPTS=""
if [ "$CERC_ALLOW_UNPROTECTED_TXS" == "true" ]; then
# Allow for unprotected (non EIP155) txs to be submitted via RPC
OTHER_OPTS+=" --rpc.allow-unprotected-txs"
fi
$START_CMD \ $START_CMD \
--datadir="${CERC_ETH_DATADIR}" \ --datadir="${CERC_ETH_DATADIR}" \
--bootnodes="${ENODE}" \ --bootnodes="${ENODE}" \
@ -69,17 +127,19 @@ else
--http.corsdomain="*" \ --http.corsdomain="*" \
--networkid="${NETWORK_ID}" \ --networkid="${NETWORK_ID}" \
--netrestrict="${NETRESTRICT}" \ --netrestrict="${NETRESTRICT}" \
--state.scheme hash \
--gcmode archive \ --gcmode archive \
--txlookuplimit=0 \ --txlookuplimit=0 \
--cache.preimages \ --cache.preimages \
--syncmode=full \ --syncmode=full \
--mine \ --mine \
--miner.threads=1 \
--metrics \ --metrics \
--metrics.addr="0.0.0.0" \ --metrics.addr="0.0.0.0" \
--verbosity=${CERC_GETH_VERBOSITY:-3} \ --verbosity=${CERC_GETH_VERBOSITY:-3} \
--log.vmodule="${CERC_GETH_VMODULE}" \ --log.vmodule="${CERC_GETH_VMODULE}" \
--miner.etherbase="${ETHERBASE}" \ --miner.etherbase="${ETHERBASE}" \
${OTHER_OPTS} \
${STATEDIFF_OPTS} \
& &
geth_pid=$! geth_pid=$!

View File

@ -1,6 +1,5 @@
FROM cerc/lighthouse-cli:local AS lcli FROM cerc/lighthouse-cli:local AS lcli
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen FROM cerc/fixturenet-eth-genesis-postmerge:local AS fnetgen
FROM cerc/fixturenet-eth-genesis-premerge:local AS fnetgen
FROM cerc/lighthouse:local FROM cerc/lighthouse:local
@ -12,16 +11,13 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-reco
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY genesis /opt/testnet
COPY run-cl.sh /opt/testnet/run.sh
COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
COPY --from=ethgen /apps /apps
COPY --from=fnetgen /opt/genesis/el /opt/testnet/el COPY --from=fnetgen /opt/genesis/el /opt/testnet/el
COPY --from=fnetgen /opt/genesis/build/el /opt/testnet/build/el COPY --from=fnetgen /opt/genesis/build/el /opt/testnet/build/el
COPY genesis /opt/testnet
COPY run-cl.sh /opt/testnet/run.sh
RUN cd /opt/testnet && make genesis-cl RUN cd /opt/testnet && make genesis-cl
# Work around some bugs in lcli where the default path is always used. # Work around some bugs in lcli where the default path is always used.

View File

@ -10,7 +10,6 @@ set -Eeuo pipefail
source ./vars.env source ./vars.env
SUBSCRIBE_ALL_SUBNETS= SUBSCRIBE_ALL_SUBNETS=
DEBUG_LEVEL=${DEBUG_LEVEL:-debug}
# Get positional arguments # Get positional arguments
data_dir=$DATADIR/node_${NODE_NUMBER} data_dir=$DATADIR/node_${NODE_NUMBER}

View File

@ -9,8 +9,6 @@ set -Eeuo pipefail
source ./vars.env source ./vars.env
DEBUG_LEVEL=${1:-info}
echo "Starting bootnode" echo "Starting bootnode"
# Clean up existing ENR dir to avoid node connectivity issues on a restart # Clean up existing ENR dir to avoid node connectivity issues on a restart

View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# See https://github.com/sigp/lighthouse/scripts/local_testnet/setup.sh
# #
# Deploys the deposit contract and makes deposits for $VALIDATOR_COUNT insecure deterministic validators. # Deploys the deposit contract and makes deposits for $VALIDATOR_COUNT insecure deterministic validators.
# Produces a testnet specification and a genesis state where the genesis time # Produces a testnet specification and a genesis state where the genesis time
@ -24,23 +25,31 @@ echo "(Note: errors of the form 'WARN: Scrypt parameters are too weak...' below
lcli \ lcli \
new-testnet \ new-testnet \
--spec $SPEC_PRESET \ --spec $SPEC_PRESET \
--deposit-contract-address $ETH1_DEPOSIT_CONTRACT_ADDRESS \
--testnet-dir $TESTNET_DIR \ --testnet-dir $TESTNET_DIR \
--deposit-contract-address $ETH1_DEPOSIT_CONTRACT_ADDRESS \
--min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \ --min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \
--validator-count $VALIDATOR_COUNT \ --validator-count $VALIDATOR_COUNT \
--min-genesis-time $GENESIS_TIME \ --min-genesis-time $GENESIS_TIME \
--genesis-delay $GENESIS_DELAY \ --genesis-delay $GENESIS_DELAY \
--genesis-fork-version $GENESIS_FORK_VERSION \ --genesis-fork-version $GENESIS_FORK_VERSION \
--altair-fork-epoch $ALTAIR_FORK_EPOCH \ --altair-fork-epoch $ALTAIR_FORK_EPOCH \
--bellatrix-fork-epoch $MERGE_FORK_EPOCH \ --bellatrix-fork-epoch $BELLATRIX_FORK_EPOCH \
--capella-fork-epoch $CAPELLA_FORK_EPOCH \
--deneb-fork-epoch $DENEB_FORK_EPOCH \
--eth1-id $ETH1_CHAIN_ID \ --eth1-id $ETH1_CHAIN_ID \
--eth1-block-hash $ETH1_BLOCK_HASH \ --eth1-block-hash $ETH1_BLOCK_HASH \
--eth1-follow-distance 1 \ --eth1-follow-distance 1 \
--seconds-per-slot $SECONDS_PER_SLOT \ --seconds-per-slot $SECONDS_PER_SLOT \
--seconds-per-eth1-block $SECONDS_PER_ETH1_BLOCK \ --seconds-per-eth1-block $SECONDS_PER_ETH1_BLOCK \
--interop-genesis-state \
--force --force
echo Specification generated at $TESTNET_DIR. # Patch the spec with settings not supported by lcli
sed -i "/^SHARD_COMMITTEE_PERIOD:/s/:.*/: $SHARD_COMMITTEE_PERIOD/" $TESTNET_DIR/config.yaml
sed -i "/^MIN_VALIDATOR_WITHDRAWABILITY_DELAY:/s/:.*/: $MIN_VALIDATOR_WITHDRAWABILITY_DELAY/" $TESTNET_DIR/config.yaml
sed -i "/^MAX_SEED_LOOKAHEAD:/s/:.*/: $MAX_SEED_LOOKAHEAD/" $TESTNET_DIR/config.yaml
echo Specification and genesis.ssz generated at $TESTNET_DIR.
echo "Generating $VALIDATOR_COUNT validators concurrently... (this may take a while)" echo "Generating $VALIDATOR_COUNT validators concurrently... (this may take a while)"
lcli \ lcli \
@ -50,13 +59,3 @@ lcli \
--node-count $BN_COUNT --node-count $BN_COUNT
echo Validators generated with keystore passwords at $DATADIR. echo Validators generated with keystore passwords at $DATADIR.
echo "Building genesis state... (this might take a while)"
lcli \
interop-genesis \
--spec $SPEC_PRESET \
--genesis-time $GENESIS_TIME \
--testnet-dir $TESTNET_DIR \
$GENESIS_VALIDATOR_COUNT
echo Created genesis state in $TESTNET_DIR

View File

@ -8,8 +8,6 @@ set -Eeuo pipefail
source ./vars.env source ./vars.env
DEBUG_LEVEL=info
BUILDER_PROPOSALS= BUILDER_PROPOSALS=
# Get options # Get options

View File

@ -25,7 +25,9 @@ BOOTNODE_PORT=${BOOTNODE_PORT:-4242}
# Hard fork configuration # Hard fork configuration
ALTAIR_FORK_EPOCH=${ALTAIR_FORK_EPOCH:-0} ALTAIR_FORK_EPOCH=${ALTAIR_FORK_EPOCH:-0}
MERGE_FORK_EPOCH=${MERGE_FORK_EPOCH:-0} BELLATRIX_FORK_EPOCH=${BELLATRIX_FORK_EPOCH:-0}
CAPELLA_FORK_EPOCH=${CAPELLA_FORK_EPOCH:-0}
DENEB_FORK_EPOCH=${DENEB_FORK_EPOCH:-0}
# Spec version (mainnet or minimal) # Spec version (mainnet or minimal)
SPEC_PRESET=${SPEC_PRESET:-mainnet} SPEC_PRESET=${SPEC_PRESET:-mainnet}
@ -36,6 +38,13 @@ SECONDS_PER_SLOT=${SECONDS_PER_SLOT:-3}
# Seconds per Eth1 block # Seconds per Eth1 block
SECONDS_PER_ETH1_BLOCK=${SECONDS_PER_ETH1_BLOCK:-1} SECONDS_PER_ETH1_BLOCK=${SECONDS_PER_ETH1_BLOCK:-1}
# Min epochs between validator activation and exit
SHARD_COMMITTEE_PERIOD=2
# Min epochs between validator exit and withdrawal
MIN_VALIDATOR_WITHDRAWABILITY_DELAY=1
# Delay for validator activation/exit
MAX_SEED_LOOKAHEAD=1
# Command line arguments for validator client # Command line arguments for validator client
VC_ARGS=${VC_ARGS:-""} VC_ARGS=${VC_ARGS:-""}

View File

@ -9,7 +9,7 @@ STATUSES=(
"beacon phase0" "beacon phase0"
"beacon altair" "beacon altair"
"beacon bellatrix pre-merge" "beacon bellatrix pre-merge"
"beacon bellatrix merge" "beacon post-merge"
"block number $MIN_BLOCK_NUM" "block number $MIN_BLOCK_NUM"
) )
STATUS=0 STATUS=0
@ -69,14 +69,22 @@ while [ $STATUS -lt ${#STATUSES[@]} ]; do
;; ;;
2) 2)
result=`wget --no-check-certificate --quiet -O - "$LIGHTHOUSE_BASE_URL/eth/v2/beacon/blocks/head" | jq -r '.version'` result=`wget --no-check-certificate --quiet -O - "$LIGHTHOUSE_BASE_URL/eth/v2/beacon/blocks/head" | jq -r '.version'`
if [ ! -z "$result" ] && ([ "$result" == "altair" ] || [ "$result" == "bellatrix" ]); then if [ ! -z "$result" ]; then
inc_status case "$result" in
"altair" | "bellatrix" | "capella" | "deneb")
inc_status
;;
esac
fi fi
;; ;;
3) 3)
result=`wget --no-check-certificate --quiet -O - "$LIGHTHOUSE_BASE_URL/eth/v2/beacon/blocks/head" | jq -r '.version'` result=`wget --no-check-certificate --quiet -O - "$LIGHTHOUSE_BASE_URL/eth/v2/beacon/blocks/head" | jq -r '.version'`
if [ ! -z "$result" ] && [ "$result" == "bellatrix" ]; then if [ ! -z "$result" ]; then
inc_status case "$result" in
"bellatrix" | "capella" | "deneb")
inc_status
;;
esac
fi fi
;; ;;
4) 4)

View File

@ -0,0 +1,27 @@
FROM cerc/fixturenet-eth-genesis-postmerge:local as fnetgen
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
FROM golang:1.21-alpine as delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
FROM cerc/plugeth-statediff:local as statediff
# FIXME: fork of plugeth, use stock after upstreaming patches
FROM cerc/plugeth:local as geth
FROM alpine:3.18
RUN apk add --no-cache bash wget python3 bind-tools postgresql-client
COPY run-el.sh /opt/testnet/run.sh
COPY --from=delve /go/bin/dlv /usr/local/bin/
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
COPY --from=fnetgen /opt/genesis /opt/testnet
COPY --from=statediff /usr/local/lib/statediff.so /usr/local/lib/plugeth/
# Initialize the geth db with our config
RUN geth --datadir ~/ethdata --state.scheme hash \
init /opt/testnet/build/el/geth.json && \
rm -f ~/ethdata/geth/nodekey
ENTRYPOINT ["/opt/testnet/run.sh"]

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Build cerc/fixturenet-plugeth-plugeth
set -x
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/run-el.sh ${SCRIPT_DIR}/
docker build -t cerc/fixturenet-plugeth-plugeth:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR

View File

@ -1,9 +1,10 @@
ARG TAG_SUFFIX="-modern" FROM sigp/lighthouse:v5.1.2
FROM sigp/lighthouse:v4.3.0${TAG_SUFFIX}
RUN apt-get update; apt-get install bash netcat curl less jq wget -y; RUN apt-get update && apt-get -y upgrade \
&& apt-get -y install bash netcat curl less jq wget \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /root/ WORKDIR /root
ADD start-lighthouse.sh . ADD start-lighthouse.sh .
ENTRYPOINT [ "./start-lighthouse.sh" ] ENTRYPOINT [ "./start-lighthouse.sh" ]

View File

@ -6,4 +6,4 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
# See: https://stackoverflow.com/a/246128/1701505 # See: https://stackoverflow.com/a/246128/1701505
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/lighthouse:local ${build_command_args} --build-arg TAG_SUFFIX="" ${SCRIPT_DIR} docker build -t cerc/lighthouse:local ${build_command_args} ${SCRIPT_DIR}

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Build cerc/plugeth-statediff
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
# Pass Go auth token if present
if [[ -n "${CERC_GO_AUTH_TOKEN}" ]]; then
build_command_args="${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN}"
fi
docker build -t cerc/plugeth-statediff:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth-statediff

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Build cerc/plugeth
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
# Pass Go auth token if present
if [[ -n "${CERC_GO_AUTH_TOKEN}" ]]; then
build_command_args="${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN}"
fi
docker build -t cerc/plugeth:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth

View File

@ -59,60 +59,6 @@ $ laconic-so --stack ~/cerc/fixturenet-eth-stacks/stacks/fixturenet-eth deploy e
3 3
``` ```
## Additional pieces
Several other containers can used with the basic `fixturenet-eth`:
* `ipld-eth-db` (enables statediffing)
* `ipld-eth-server` (GQL and Ethereum API server, requires `ipld-eth-db`)
* `ipld-eth-beacon-db` and `ipld-eth-beacon-indexer` (for indexing Beacon chain blocks)
* `eth-probe` (captures eth1 tx gossip)
* `keycloak` (nginx proxy with keycloak auth for API authentication)
* `tx-spammer` (generates and sends automated transactions to the fixturenet)
It is not necessary to use them all at once, but a complete example follows:
```
# Setup
$ laconic-so setup-repositories --include git.vdb.to/cerc-io/go-ethereum,git.vdb.to/cerc-io/ipld-eth-db,git.vdb.to/cerc-io/ipld-eth-server,github.com/cerc-io/ipld-eth-beacon-db,github.com/cerc-io/ipld-eth-beacon-indexer,github.com/cerc-io/eth-probe,git.vdb.to/cerc-io/tx-spammer
# Build
$ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer
# Deploy
$ laconic-so deploy-system --include db,fixturenet-eth,ipld-eth-server,ipld-eth-beacon-db,ipld-eth-beacon-indexer,eth-probe,keycloak,tx-spammer up
# Status
$ container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh
Waiting for geth to generate DAG.... done
Waiting for beacon phase0.... done
Waiting for beacon altair.... done
Waiting for beacon bellatrix pre-merge.... done
Waiting for beacon bellatrix merge.... done
$ docker ps -f 'name=laconic' --format 'table {{.Names}}\t{{.Ports}}' | cut -d'-' -f3- | sort
NAMES PORTS
eth-probe-db-1 0.0.0.0:55849->5432/tcp
eth-probe-mq-1
eth-probe-probe-1
fixturenet-eth-bootnode-geth-1 8545-8546/tcp, 30303/udp, 0.0.0.0:55847->9898/tcp, 0.0.0.0:55848->30303/tcp
fixturenet-eth-bootnode-lighthouse-1
fixturenet-eth-geth-1-1 8546/tcp, 30303/tcp, 30303/udp, 0.0.0.0:55851->8545/tcp
fixturenet-eth-geth-2-1 8545-8546/tcp, 30303/tcp, 30303/udp
fixturenet-eth-lighthouse-1-1 0.0.0.0:55858->8001/tcp
fixturenet-eth-lighthouse-2-1
ipld-eth-beacon-db-1 127.0.0.1:8076->5432/tcp
ipld-eth-beacon-indexer-1
ipld-eth-db-1 127.0.0.1:8077->5432/tcp
ipld-eth-server-1 127.0.0.1:8081-8082->8081-8082/tcp
keycloak-1 8443/tcp, 0.0.0.0:55857->8080/tcp
keycloak-db-1 0.0.0.0:55850->5432/tcp
keycloak-nginx-1 0.0.0.0:55859->80/tcp
migrations-1
tx-spammer-1
```
## Clean up ## Clean up
Stop all services running in the background: Stop all services running in the background:

View File

@ -6,7 +6,7 @@ repos:
containers: containers:
- cerc/lighthouse - cerc/lighthouse
- cerc/lighthouse-cli - cerc/lighthouse-cli
- cerc/fixturenet-eth-genesis-premerge - cerc/fixturenet-eth-genesis-postmerge
- cerc/fixturenet-eth-geth - cerc/fixturenet-eth-geth
- cerc/fixturenet-eth-lighthouse - cerc/fixturenet-eth-lighthouse
pods: pods:

View File

@ -0,0 +1,23 @@
version: "1.1"
name: fixturenet-plugeth
description: "Plugeth Ethereum Indexing Fixturenet"
repos:
- git.vdb.to/cerc-io/plugeth@statediff
- git.vdb.to/cerc-io/plugeth-statediff
- git.vdb.to/cerc-io/lighthouse
- git.vdb.to/cerc-io/ipld-eth-db
- git.vdb.to/cerc-io/ipld-eth-server@v5
containers:
- cerc/plugeth-statediff
- cerc/plugeth
- cerc/fixturenet-eth-genesis-postmerge
- cerc/fixturenet-plugeth-plugeth
- cerc/lighthouse
- cerc/lighthouse-cli
- cerc/fixturenet-eth-lighthouse
- cerc/ipld-eth-db
- cerc/ipld-eth-server
pods:
- fixturenet-plugeth
- ipld-eth-db
- ipld-eth-server

View File

@ -0,0 +1,132 @@
#!/usr/bin/env bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
SO_COMMAND=laconic-so
test_name="Fixturenet eth stack deploy test"
echo "Running ${test_name}"
stack_name=$(pwd)/stack-orchestrator/stacks/fixturenet-plugeth
test_fail_exit () {
local fail_message=$1
echo "${test_name}: ${fail_message}"
echo "${test_name}: FAILED"
exit 1
}
log_info () {
local message=$1
echo "$(date +"%Y-%m-%d %T"): ${message}"
}
get_block_number () {
local result=$(wget -q -O- "$1" \
--header "Content-Type: application/json" \
--post-data '{"id": 1, "jsonrpc": "2.0", "method": "eth_blockNumber"}' | \
jq -r '.result')
printf "%d" $result
}
# Sanity check the stack dir exists
if [ ! -d "${stack_name}" ]; then
test_fail_exit "stack directory not present"
exit 1
fi
# Set a non-default repo dir
export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir
reported_version_string=$( $SO_COMMAND version )
echo "SO version is: ${reported_version_string}"
echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
rm -rf $CERC_REPO_BASE_DIR
mkdir -p $CERC_REPO_BASE_DIR
$SO_COMMAND --stack ${stack_name} setup-repositories
echo "Building containers"
$SO_COMMAND --stack ${stack_name} build-containers
test_deployment_dir=$CERC_REPO_BASE_DIR/test-deployment-dir
test_deployment_spec=$CERC_REPO_BASE_DIR/test-deployment-spec.yml
$SO_COMMAND --stack ${stack_name} deploy init --output $test_deployment_spec
# Check the file now exists
if [ ! -f "$test_deployment_spec" ]; then
test_fail_exit "deploy init test: spec file not present"
fi
echo "deploy init test: passed"
$SO_COMMAND --stack ${stack_name} deploy create --spec-file $test_deployment_spec --deployment-dir $test_deployment_dir
# Check the deployment dir exists
if [ ! -d "$test_deployment_dir" ]; then
test_fail_exit "deploy create test: deployment directory not present"
fi
echo "deploy create test: passed"
dump_logs () {
echo "Test failed. Logs from stack:"
$SO_COMMAND deployment --dir $test_deployment_dir logs
}
trap dump_logs ERR
$SO_COMMAND deployment --dir $test_deployment_dir start
geth_endpoint=localhost:$($SO_COMMAND deployment --dir $test_deployment_dir port fixturenet-eth-geth-1 8545 | cut -d: -f2)
timeout=900 # 15 minutes
log_info "Getting initial block number. Timeout set to $timeout seconds"
start_time=$(date +%s)
elapsed_time=0
initial_block_number=0
while [ "$initial_block_number" -eq 0 ] && [ $elapsed_time -lt $timeout ]; do
sleep 10
log_info "Waiting for initial block..."
initial_block_number=$(get_block_number $geth_endpoint)
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
done
subsequent_block_number=$initial_block_number
# if initial block was 0 after timeout, assume chain did not start successfully and skip finding subsequent block
if [[ $initial_block_number -gt 0 ]]; then
timeout=300
log_info "Getting subsequent block number. Timeout set to $timeout seconds"
start_time=$(date +%s)
elapsed_time=0
# wait for 5 blocks or timeout
while [ "$subsequent_block_number" -le $((initial_block_number + 5)) ] && [ $elapsed_time -lt $timeout ]; do
sleep 10
log_info "Waiting for five blocks or $timeout seconds..."
subsequent_block_number=$(get_block_number $geth_endpoint)
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
done
fi
# will return 0 if either of the above loops timed out
block_number_difference=$((subsequent_block_number - initial_block_number))
log_info "Results of block height queries:"
echo "Initial block height: $initial_block_number"
echo "Subsequent block height: $subsequent_block_number"
# Block height difference should be between 1 and some small number
[[ $block_number_difference -gt 1 && $block_number_difference -lt 100 ]]
# Check that the block hash is present in the ipld-eth-db
echo "Querying ipld-eth-db for block number $subsequent_block_number"
block_hash_query="SELECT block_hash from eth.header_cids where block_number = $subsequent_block_number"
block_hash=$(
$SO_COMMAND deployment --dir $test_deployment_dir exec ipld-eth-db \
"psql -qtA -U vdbm -c '$block_hash_query' cerc_testing"
)
echo "Block hash in ipld-eth-db: $block_hash"
[[ -n $block_hash ]]
echo "Test passed."