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 49 additions and 44 deletions
Showing only changes of commit ed9de91260 - Show all commits

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,32 @@
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"
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:
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.
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.
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.
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.
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
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.
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.
environment:
POSTGRES_USER: "vdbm"
POSTGRES_DB: "cerc_testing"
POSTGRES_PASSWORD: "password"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 5s
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
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
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.
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.
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.
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.
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:
- "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:
hostname: fixturenet-eth-geth-2
environment:
RUN_STATEDIFF: "true"
STATEDIFF_DB_NODE_ID: 2
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-eth-geth:local
depends_on:
- migrations
- fixturenet-eth-bootnode-geth
fixturenet-eth-bootnode-lighthouse:

View File

@ -7,4 +7,12 @@ ENODE="enode://af22c29c316ad069cf48a09a4ad5cf04a251b411e45098888d114c6dd7f489a13
# JWT shared by geth and lighthouse for authentication.
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"
# DB connection settings for statediffing (see docker-compose-db.yml)
STATEDIFF_DB_HOST="ipld-eth-db"
STATEDIFF_DB_PORT=5432
STATEDIFF_DB_NAME="cerc_testing"
STATEDIFF_DB_USER="vdbm"
STATEDIFF_DB_PASSWORD="password"

View File

@ -17,6 +17,19 @@ else
echo -n "$JWT" > /opt/testnet/build/el/jwtsecret
STATEDIFF_OPTS=""
if [ "$RUN_STATEDIFF" == "true" ]; then
STATEDIFF_OPTS="--statediff=true \
--statediff.db.host=$STATEDIFF_DB_HOST \
--statediff.db.name=$STATEDIFF_DB_NAME \
--statediff.db.nodeid=$STATEDIFF_DB_NODE_ID \
--statediff.db.password=$STATEDIFF_DB_PASSWORD \
--statediff.db.port=$STATEDIFF_DB_PORT \
--statediff.db.user=$STATEDIFF_DB_USER \
--statediff.waitforsync=true \
--statediff.writing=true"
fi
geth \
--bootnodes="${ENODE}" \
--allow-insecure-unlock \
@ -28,7 +41,7 @@ else
--authrpc.addr="0.0.0.0" \
--authrpc.vhosts="*" \
--authrpc.jwtsecret="/opt/testnet/build/el/jwtsecret" \
--networkid=${NETWORK_ID} \
--networkid="${NETWORK_ID}" \
--netrestrict="${NETRESTRICT}" \
--gcmode archive \
--txlookuplimit=0 \
@ -36,5 +49,5 @@ else
--syncmode=full \
--mine \
--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

View File

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