Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
enable blob docker (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored Feb 2, 2024
2 parents f725fc1 + d6523d6 commit f8e5b36
Show file tree
Hide file tree
Showing 14 changed files with 330 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
with:
repository: taikoxyz/taiko-mono
path: ${{ env.TAIKO_MONO_DIR }}
ref: alpha-6
ref: alpha-6_eip4844

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
7 changes: 7 additions & 0 deletions internal/docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
consensus/beacondata
consensus/genesis.ssz
consensus/validatordata
execution/geth
execution/geth.ipc
execution/genesis.json
taikogeth/taiko-geth
29 changes: 29 additions & 0 deletions internal/docker/consensus/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
CONFIG_NAME: interop
PRESET_BASE: interop

# Genesis
GENESIS_FORK_VERSION: 0x20000089

# Altair
ALTAIR_FORK_EPOCH: 0
ALTAIR_FORK_VERSION: 0x20000090

# Merge
BELLATRIX_FORK_EPOCH: 0
BELLATRIX_FORK_VERSION: 0x20000091
TERMINAL_TOTAL_DIFFICULTY: 0

# Capella
CAPELLA_FORK_EPOCH: 0
CAPELLA_FORK_VERSION: 0x20000092
MAX_WITHDRAWALS_PER_PAYLOAD: 16

DENEB_FORK_EPOCH: 0
DENEB_FORK_VERSION: 0x20000093

# Time parameters
SECONDS_PER_SLOT: 3
SLOTS_PER_EPOCH: 3

# Deposit contract
DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242
186 changes: 186 additions & 0 deletions internal/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
version: "3.9"

services:
# Creates a genesis state for the beacon chain using a YAML configuration file and
# a deterministic set of 64 validators.
create-beacon-chain-genesis:
image: "gcr.io/prysmaticlabs/prysm/cmd/prysmctl:latest"
command:
- testnet
- generate-genesis
- --fork=deneb
- --num-validators=64
- --genesis-time-delay=15
- --output-ssz=/consensus/genesis.ssz
- --chain-config-file=/consensus/config.yml
- --geth-genesis-json-in=/execution/genesis.json
- --geth-genesis-json-out=/execution/genesis.json
volumes:
- ./consensus:/consensus
- ./execution:/execution

# Removes the database of the go-ethereum execution client to ensure we start from a clean state.
# (geth has a `removedb` option, but it asks for a keyboard confirmation, so we use this instead)
geth-remove-db:
image: "alpine:latest"
command: rm -rf /execution/geth
volumes:
- ./execution:/execution

# Sets up the genesis configuration for the go-ethereum client from a JSON file.
geth-genesis:
image: "ethereum/client-go:v1.13.11"
command: --datadir=/execution init /execution/genesis.json
volumes:
- ./execution:/execution
- ./execution/genesis.json:/execution/genesis.json
depends_on:
create-beacon-chain-genesis:
condition: service_completed_successfully
geth-remove-db:
condition: service_completed_successfully

# Runs a Prysm beacon chain from a specified genesis state created in the previous step
# and connects to go-ethereum in the same network as the execution client.
# The account used in go-ethereum is set as the suggested fee recipient for transactions
# proposed via the validators attached to the beacon node.
beacon-chain:
image: "gcr.io/prysmaticlabs/prysm/beacon-chain:stable"
container_name: beacon-chain
command:
- --datadir=/consensus/beacondata
# No peers to sync with in this testnet, so setting to 0
- --min-sync-peers=0
- --genesis-state=/consensus/genesis.ssz
- --bootstrap-node=
- --interop-eth1data-votes
# The chain configuration file used for setting up Prysm
- --chain-config-file=/consensus/config.yml
# We specify the chain id used by our execution client
- --contract-deployment-block=0
- --chain-id=${CHAIN_ID:-32382}
- --rpc-host=0.0.0.0
- --grpc-gateway-host=0.0.0.0
- --execution-endpoint=http://geth:8551
- --accept-terms-of-use
- --jwt-secret=/execution/jwtsecret
- --suggested-fee-recipient=0x123463a4b065722e99115d6c222f267d9cabb524
- --minimum-peers-per-subnet=0
- --enable-debug-rpc-endpoints
- --force-clear-db
depends_on:
create-beacon-chain-genesis:
condition: service_completed_successfully
ports:
- "4000"
volumes:
- ./consensus:/consensus
- ./execution:/execution
- ./execution/jwtsecret:/execution/jwtsecret

# Runs the go-ethereum execution client with the specified, unlocked account and necessary
# APIs to allow for proof-of-stake consensus via Prysm.
geth:
image: "ethereum/client-go:v1.13.11"
container_name: geth
command:
- --http
- --http.api=eth,net,web3
- --http.addr=0.0.0.0
- --http.corsdomain=*
- --ws
- --ws.api=eth,net,web3
- --ws.addr=0.0.0.0
- --ws.origins=*
- --authrpc.vhosts=*
- --authrpc.addr=0.0.0.0
- --authrpc.jwtsecret=/execution/jwtsecret
- --datadir=/execution
- --allow-insecure-unlock
- --unlock=0x123463a4b065722e99115d6c222f267d9cabb524
- --password=/execution/geth_password.txt
- --nodiscover
- --syncmode=full
ports:
- "8545"
- "8546"
depends_on:
geth-genesis:
condition: service_completed_successfully
beacon-chain:
condition: service_started
volumes:
- ./execution:/execution
- ./execution/jwtsecret:/execution/jwtsecret
- ./execution/geth_password.txt:/execution/geth_password.txt

# We run a validator client with 64, deterministically-generated keys that match
# The validator keys present in the beacon chain genesis state generated a few steps above.
validator:
image: "gcr.io/prysmaticlabs/prysm/validator:stable"
container_name: validator
command:
- --beacon-rpc-provider=beacon-chain:4000
- --datadir=/consensus/validatordata
- --accept-terms-of-use
- --interop-num-validators=64
- --interop-start-index=0
- --chain-config-file=/consensus/config.yml
- --force-clear-db
depends_on:
beacon-chain:
condition: service_started
volumes:
- ./consensus:/consensus

l2_execution_engine:
container_name: l2_node
image: gcr.dockerproxy.com/evmchain/taiko-geth:taiko
restart: unless-stopped
pull_policy: always
volumes:
- ./taikogeth:/host
ports:
- "8545"
- "8546"
- "8551"
command:
- --nodiscover
- --gcmode
- archive
- --syncmode
- full
- --datadir
- /host/taiko-geth
- --networkid
- "167001"
- --metrics
- --metrics.expensive
- --metrics.addr
- "0.0.0.0"
- --http
- --http.addr
- "0.0.0.0"
- --http.vhosts
- "*"
- --http.corsdomain
- "*"
- --ws
- --ws.addr
- "0.0.0.0"
- --ws.origins
- "*"
- --authrpc.addr
- "0.0.0.0"
- --authrpc.port
- "8551"
- --authrpc.vhosts
- "*"
- --authrpc.jwtsecret
- /host/jwt.hex
- --allow-insecure-unlock
- --http.api
- admin,debug,eth,net,web3,txpool,miner,taiko
- --ws.api
- admin,debug,eth,net,web3,txpool,miner,taiko
- --taiko
17 changes: 10 additions & 7 deletions internal/docker/docker_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# check until L1 chain is ready
L1_PROBE_URL=http://localhost:$(docker port l1_node | grep '0.0.0.0' | awk -F ':' '{print $2}')
L1_PROBE_URL=http://localhost:$(docker port geth | grep '0.0.0.0' | awk -F ':' 'NR==1 {print $2}')
until cast chain-id --rpc-url "$L1_PROBE_URL" 2> /dev/null; do
sleep 1
done
Expand All @@ -15,20 +15,23 @@ until cast chain-id --rpc-url "$L2_PROBE_URL" 2> /dev/null; do
done


L1_NODE_PORT=$(docker port l1_node | grep '0.0.0.0' | awk -F ':' '{print $2}')
export L1_NODE_HTTP_ENDPOINT=http://localhost:$L1_NODE_PORT
export L1_NODE_WS_ENDPOINT=ws://localhost:$L1_NODE_PORT
L1_BEACON_PORT=$(docker port beacon-chain | grep '0.0.0.0' | awk -F ':' '{print $2}')
export L1_BEACON_HTTP_ENDPOINT=http://localhost:$L1_BEACON_PORT
export L1_NODE_HTTP_ENDPOINT=http://localhost:$(docker port geth | grep '0.0.0.0' | awk -F ':' 'NR==1 {print $2}')
export L1_NODE_WS_ENDPOINT=ws://localhost:$(docker port geth | grep '0.0.0.0' | awk -F ':' 'NR==2 {print $2}')

export L2_EXECUTION_ENGINE_HTTP_ENDPOINT=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==1 {print $2}')
export L2_EXECUTION_ENGINE_WS_ENDPOINT=ws://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==2 {print $2}')
export L2_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==3 {print $2}')
export JWT_SECRET=$DIR/nodes/jwt.hex

echo -e "L1_NODE PORTS: \n$(docker port l1_node)"
echo -e "L2_NODE PORTS: \n$(docker port l2_node)"

echo
echo -e "L1_NODE PORTS: \n$(docker port geth)"
echo "L1_BEACON_HTTP_ENDPOINT: $L1_BEACON_HTTP_ENDPOINT"
echo "L1_NODE_HTTP_ENDPOINT: $L1_NODE_HTTP_ENDPOINT"
echo "L1_NODE_WS_ENDPOINT: $L1_NODE_WS_ENDPOINT"
echo
echo -e "L2_NODE PORTS: \n$(docker port l2_node)"
echo "L2_EXECUTION_ENGINE_HTTP_ENDPOINT: $L2_EXECUTION_ENGINE_HTTP_ENDPOINT"
echo "L2_EXECUTION_ENGINE_WS_ENDPOINT: $L2_EXECUTION_ENGINE_WS_ENDPOINT"
echo "L2_EXECUTION_ENGINE_AUTH_ENDPOINT: $L2_EXECUTION_ENGINE_AUTH_ENDPOINT"
Loading

0 comments on commit f8e5b36

Please sign in to comment.