diff --git a/compose/docker-compose-fixturenet-optimism.yml b/compose/docker-compose-fixturenet-optimism.yml index 08e9c61..2354419 100644 --- a/compose/docker-compose-fixturenet-optimism.yml +++ b/compose/docker-compose-fixturenet-optimism.yml @@ -8,13 +8,16 @@ services: hostname: fixturenet-optimism-contracts env_file: - ../config/fixturenet-optimism/l1-params.env + - ../config/fixturenet-optimism/l2-params.env environment: - CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} - CERC_L1_CHAIN_ID: ${CERC_L1_CHAIN_ID} - CERC_L1_RPC: ${CERC_L1_RPC} - CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL} - CERC_L1_ADDRESS: ${CERC_L1_ADDRESS} - CERC_L1_PRIV_KEY: ${CERC_L1_PRIV_KEY} + - CERC_SCRIPT_DEBUG + - CERC_L1_CHAIN_ID + - CERC_L1_RPC + - CERC_L1_ACCOUNTS_CSV_URL + - CERC_L1_ADDRESS + - CERC_L1_PRIV_KEY + - CERC_L1_BLOCK_TIME + - CERC_L2_BLOCK_TIME volumes: - ../config/network/wait-for-it.sh:/wait-for-it.sh - ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/deploy-contracts.sh @@ -86,8 +89,9 @@ services: env_file: - ../config/fixturenet-optimism/l1-params.env environment: - CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} - CERC_L1_RPC: ${CERC_L1_RPC} + - CERC_SCRIPT_DEBUG + - CERC_L1_RPC + - CERC_L1_BLOCK_TIME volumes: - ../config/fixturenet-optimism/run-op-node.sh:/run-op-node.sh - l1_deployment:/l1-deployment:ro @@ -147,9 +151,10 @@ services: env_file: - ../config/fixturenet-optimism/l1-params.env environment: - CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} - CERC_L1_RPC: ${CERC_L1_RPC} - CERC_L1_CHAIN_ID: ${CERC_L1_CHAIN_ID} + - CERC_SCRIPT_DEBUG + - CERC_L1_RPC + - CERC_L1_CHAIN_ID + - CERC_L1_BLOCK_TIME volumes: - ../config/network/wait-for-it.sh:/wait-for-it.sh - ../config/fixturenet-optimism/run-op-proposer.sh:/run-op-proposer.sh diff --git a/config/fixturenet-optimism/l1-params.env b/config/fixturenet-optimism/l1-params.env index 5353e62..b7c993f 100644 --- a/config/fixturenet-optimism/l1-params.env +++ b/config/fixturenet-optimism/l1-params.env @@ -6,6 +6,9 @@ DEFAULT_CERC_L1_RPC="http://fixturenet-eth-geth-1:8545" DEFAULT_CERC_L1_HOST="fixturenet-eth-geth-1" DEFAULT_CERC_L1_PORT=8545 +# Default block time to match L1 fixturenet config +DEFAULT_CERC_L1_BLOCK_TIME=3 + # URL to get CSV with credentials for accounts on L1 # that are used to send balance to Optimism Proxy contract # (enables them to do transactions on L2) diff --git a/config/fixturenet-optimism/l2-params.env b/config/fixturenet-optimism/l2-params.env new file mode 100644 index 0000000..a18c13c --- /dev/null +++ b/config/fixturenet-optimism/l2-params.env @@ -0,0 +1,2 @@ +# Default L2 block time. Must be <= L1 block time. +DEFAULT_CERC_L2_BLOCK_TIME=1 diff --git a/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh b/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh index d8ab7be..9cec8e2 100755 --- a/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh +++ b/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh @@ -124,8 +124,8 @@ GS_SEQUENCER_ADDRESS=$SEQ \ L1_RPC_URL=$CERC_L1_RPC \ L1_CHAIN_ID=$CERC_L1_CHAIN_ID \ L2_CHAIN_ID=42069 \ -L1_BLOCK_TIME=12 \ -L2_BLOCK_TIME=2 \ +L1_BLOCK_TIME=${CERC_L1_BLOCK_TIME:-$DEFAULT_CERC_L1_BLOCK_TIME} \ +L2_BLOCK_TIME=${CERC_L2_BLOCK_TIME:-$DEFAULT_CERC_L2_BLOCK_TIME} \ $config_build_script echo "Writing deployment config." diff --git a/config/fixturenet-optimism/run-op-node.sh b/config/fixturenet-optimism/run-op-node.sh index 862de17..0b1e5e2 100755 --- a/config/fixturenet-optimism/run-op-node.sh +++ b/config/fixturenet-optimism/run-op-node.sh @@ -5,6 +5,7 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then fi CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}" +CERC_L1_BLOCK_TIME="${CERC_L1_BLOCK_TIME:-$DEFAULT_CERC_L1_BLOCK_TIME}" # Start op-node rollup_config=/l2-config/rollup.json @@ -27,4 +28,6 @@ exec op-node \ --p2p.sequencer.key="${SEQ_KEY#0x}" \ --l1=$CERC_L1_RPC \ --l1.rpckind=$rpc_kind \ - --l1.beacon=http://fixturenet-eth-lighthouse-1:8001 + --l1.beacon=http://fixturenet-eth-lighthouse-1:8001 \ + --l1.http-poll-interval="${CERC_L1_BLOCK_TIME}s" \ + --l1.epoch-poll-interval="$((CERC_L1_BLOCK_TIME * 32))s" diff --git a/config/fixturenet-optimism/run-op-proposer.sh b/config/fixturenet-optimism/run-op-proposer.sh index 15ed1cb..28dc561 100755 --- a/config/fixturenet-optimism/run-op-proposer.sh +++ b/config/fixturenet-optimism/run-op-proposer.sh @@ -6,6 +6,7 @@ fi CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}" CERC_L1_CHAIN_ID="${CERC_L1_CHAIN_ID:-${DEFAULT_CERC_L1_CHAIN_ID}}" +CERC_L1_BLOCK_TIME="${CERC_L1_BLOCK_TIME:-${DEFAULT_CERC_L1_BLOCK_TIME}}" DEPLOYMENT_CONTEXT="$CERC_L1_CHAIN_ID" # Start op-proposer @@ -14,7 +15,7 @@ PROPOSER_KEY=$(cat /l2-accounts/accounts.json | jq -r .ProposerKey) L2OO_ADDR=$(cat /l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json | jq -r .L2OutputOracleProxy) exec op-proposer \ - --poll-interval=12s \ + --poll-interval="${CERC_L1_BLOCK_TIME}s" \ --rpc.port=8560 \ --rollup-rpc=$ROLLUP_RPC \ --l2oo-address="${L2OO_ADDR#0x}" \