Add option to enable statediffing for the fixturenet geth. #32

Merged
telackey merged 3 commits from telackey/fxnet_statediff into main 2022-11-01 17:44:34 +00:00
6 changed files with 48 additions and 44 deletions

View File

@ -1,32 +0,0 @@
version: "3.2"
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
command: ["postgres", "-c", "log_statement=all"]
environment:
POSTGRES_USER: "vdbm"
POSTGRES_DB: "cerc_testing"
POSTGRES_PASSWORD: "password"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
ports:
- "127.0.0.1:8077:5432"

View File

@ -1,20 +1,31 @@
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
# TODO: figure out if this is needed -- it doesn't seem to make sense in the context of the
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
# current version of cerc/ipld-eth-db/Dockerfile, which is only the migrations code, not the DB itself
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
# The sibling component docker-compose-db-sharding.yml looks more plausible
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
version: "3.2" version: "3.2"
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
services: services:
ipld-eth-db: migrations:
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
restart: always restart: on-failure
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
depends_on:
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
ipld-eth-db:
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
condition: service_healthy
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
image: cerc/ipld-eth-db:local image: cerc/ipld-eth-db:local
environment:
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
DATABASE_USER: "vdbm"
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
DATABASE_NAME: "cerc_testing"
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
DATABASE_PASSWORD: "password"
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
DATABASE_HOSTNAME: "ipld-eth-db"
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
DATABASE_PORT: 5432
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
ipld-eth-db:
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
image: timescale/timescaledb:latest-pg14
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
restart: always
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
environment: environment:
POSTGRES_USER: "vdbm" POSTGRES_USER: "vdbm"
POSTGRES_DB: "cerc_testing" POSTGRES_DB: "cerc_testing"
POSTGRES_PASSWORD: "password" POSTGRES_PASSWORD: "password"
healthcheck: healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"] test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 5s interval: 30s
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
timeout: 3s timeout: 10s
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
retries: 5 retries: 10
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
start_period: 3s
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.
ports: ports:
- "127.0.0.1:8077:5432" - "127.0.0.1:8077:5432"
command: ["postgres", "-c", "log_statement=all"]
Review

This probably isn't exactly what we need (log all statements). I'd just leave out the command directive until we have time to configure the db properly.

This probably isn't exactly what we need (log all statements). I'd just leave out the `command` directive until we have time to configure the db properly.
Review

I can do that, this was just what the original file had.

I can do that, this was just what the original file had.

View File

@ -21,10 +21,14 @@ services:
fixturenet-eth-geth-2: fixturenet-eth-geth-2:
hostname: fixturenet-eth-geth-2 hostname: fixturenet-eth-geth-2
environment:
CERC_RUN_STATEDIFF: "true"
CERC_STATEDIFF_DB_NODE_ID: 2
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
depends_on: depends_on:
- migrations
- fixturenet-eth-bootnode-geth - fixturenet-eth-bootnode-geth
fixturenet-eth-bootnode-lighthouse: fixturenet-eth-bootnode-lighthouse:

View File

@ -7,4 +7,12 @@ ENODE="enode://af22c29c316ad069cf48a09a4ad5cf04a251b411e45098888d114c6dd7f489a13
# JWT shared by geth and lighthouse for authentication. # JWT shared by geth and lighthouse for authentication.
JWT="0x6cdcac3501046a08e186730dd8bd136cfaf0fdc1fc955f6e15ad3068c0ff2af0" JWT="0x6cdcac3501046a08e186730dd8bd136cfaf0fdc1fc955f6e15ad3068c0ff2af0"
# 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_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"

View File

@ -17,6 +17,19 @@ else
echo -n "$JWT" > /opt/testnet/build/el/jwtsecret echo -n "$JWT" > /opt/testnet/build/el/jwtsecret
STATEDIFF_OPTS=""
if [ "$CERC_RUN_STATEDIFF" == "true" ]; then
STATEDIFF_OPTS="--statediff=true \
--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.waitforsync=true \
--statediff.writing=true"
fi
geth \ geth \
--bootnodes="${ENODE}" \ --bootnodes="${ENODE}" \
--allow-insecure-unlock \ --allow-insecure-unlock \
@ -28,7 +41,7 @@ else
--authrpc.addr="0.0.0.0" \ --authrpc.addr="0.0.0.0" \
--authrpc.vhosts="*" \ --authrpc.vhosts="*" \
--authrpc.jwtsecret="/opt/testnet/build/el/jwtsecret" \ --authrpc.jwtsecret="/opt/testnet/build/el/jwtsecret" \
--networkid=${NETWORK_ID} \ --networkid="${NETWORK_ID}" \
--netrestrict="${NETRESTRICT}" \ --netrestrict="${NETRESTRICT}" \
--gcmode archive \ --gcmode archive \
--txlookuplimit=0 \ --txlookuplimit=0 \
@ -36,5 +49,5 @@ else
--syncmode=full \ --syncmode=full \
--mine \ --mine \
--miner.threads=1 \ --miner.threads=1 \
--miner.etherbase=${ETHERBASE} 2>&1 | tee /var/log/geth.log --miner.etherbase="${ETHERBASE}" ${STATEDIFF_OPTS} 2>&1 | tee /var/log/geth.log
fi fi

View File

@ -1,5 +1,5 @@
contract contract
db-sharding db
eth-statediff-fill-service eth-statediff-fill-service
go-ethereum-foundry go-ethereum-foundry
ipld-eth-beacon-db ipld-eth-beacon-db