From a95766444bc5470f4e67cb65955015fd5338d410 Mon Sep 17 00:00:00 2001 From: dailinsubjam Date: Fri, 19 Sep 2025 19:09:08 +0000 Subject: [PATCH] push --- espresso/docker-compose.yml | 30 ++++++++++++++++++++++++++++++ espresso/scripts/shutdown.sh | 24 ++++++++++++++++++++++++ espresso/scripts/startup.sh | 19 +++++++++++++++++-- op-batcher/batcher/espresso.go | 2 +- 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index b9cac92af88..3172bd8213d 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -412,6 +412,8 @@ services: - sh - -c - | + echo "Delaying op-batcher-tee for 45 minutes..." + sleep 2700 export DEPLOYMENT_MODE=local export L1_RPC_URL="http://127.0.0.1:${L1_HTTP_PORT}" export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" @@ -446,6 +448,34 @@ services: OP_PROPOSER_HD_PATH: "m/44'/60'/0'/0/1" OP_PROPOSER_GAME_TYPE: '1' + op-proposer-tee: + profiles: [ "tee" ] + build: + context: ../ + dockerfile: espresso/docker/op-stack/Dockerfile + target: op-proposer-target + image: op-proposer:espresso + depends_on: + l1-data-init: + condition: service_completed_successfully + l2-rollup: + condition: service_completed_successfully + op-node-sequencer: + condition: service_started + op-batcher-tee: + condition: service_started + volumes: + - ../packages/contracts-bedrock/lib/superchain-registry/ops/testdata/monorepo:/config + - ./deployment/deployer:/deployer + environment: + OP_PROPOSER_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT} + OP_PROPOSER_ROLLUP_RPC: http://op-node-sequencer:${ROLLUP_PORT} + OP_PROPOSER_PROPOSAL_INTERVAL: 6s + OP_PROPOSER_MNEMONIC: "test test test test test test test test test test test junk" + OP_PROPOSER_HD_PATH: "m/44'/60'/0'/0/1" + OP_PROPOSER_GAME_TYPE: '1' + + op-challenger: profiles: [ "default" ] build: diff --git a/espresso/scripts/shutdown.sh b/espresso/scripts/shutdown.sh index 7f966453860..6a72ed308bc 100755 --- a/espresso/scripts/shutdown.sh +++ b/espresso/scripts/shutdown.sh @@ -4,3 +4,27 @@ # This script shuts down devnet services. docker compose down -v + +# Stop and remove containers built from op-batcher-tee:espresso image +echo "Stopping containers built from op-batcher-tee:espresso image..." +CONTAINERS=$(docker ps -q --filter "ancestor=op-batcher-tee:espresso") +if [ ! -z "$CONTAINERS" ]; then + echo "Stopping containers: $CONTAINERS" + docker stop $CONTAINERS + docker rm $CONTAINERS + echo "Containers stopped and removed" +else + echo "No running containers found with op-batcher-tee:espresso image" +fi + +# Stop and remove batcher-enclaver containers that run the eif +echo "Stopping batcher-enclaver containers..." +ENCLAVE_CONTAINERS=$(docker ps -aq --filter "name=batcher-enclaver-") +if [ ! -z "$ENCLAVE_CONTAINERS" ]; then + echo "Stopping enclave containers: $ENCLAVE_CONTAINERS" + docker stop $ENCLAVE_CONTAINERS 2>/dev/null || true + docker rm $ENCLAVE_CONTAINERS 2>/dev/null || true + echo "Enclave containers stopped and removed" +else + echo "No batcher-enclaver containers found" +fi diff --git a/espresso/scripts/startup.sh b/espresso/scripts/startup.sh index 2283d024003..65480da1959 100755 --- a/espresso/scripts/startup.sh +++ b/espresso/scripts/startup.sh @@ -25,7 +25,7 @@ echo "✅ Contracts compilation complete" # Step 3: Shut down all containers echo "👉 Step 3: Shutting down all containers..." cd espresso -docker compose down -v --remove-orphans +./scripts/shutdown.sh echo "✅ All containers shut down" # Step 4: Prepare contract allocations @@ -36,7 +36,22 @@ echo "✅ Contract allocations prepared" # Step 5: Build docker compose echo "👉 Step 5: Building docker compose..." -docker compose build +if [ "$USE_TEE" = "True" ] || [ "$USE_TEE" = "true" ]; then + echo "👉 Checking for AWS Nitro Enclave support..." + if command -v nitro-cli &>/dev/null && \ + (nitro-cli describe-enclaves 2>/dev/null | grep -qE "EnclaveID|\[\]" || [ -e /dev/nitro_enclaves ]); then + echo "✅ AWS Nitro Enclave support detected" + else + echo "⚠️ WARNING: AWS Nitro Enclave support not detected! TEE components will fail." + read -p "Continue anyway? (y/N): " -n 1 -r + echo "" + [[ ! $REPLY =~ ^[Yy]$ ]] && { echo "❌ Startup cancelled."; exit 1; } + fi + echo "Building with TEE profile..." + COMPOSE_PROFILES=tee docker compose build +else + docker compose build +fi echo "✅ Docker compose build complete" # Step 6: Start services diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index d4e0b3426ad..1d20ac974fd 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -885,7 +885,7 @@ func (l *BlockLoader) nextBlockRange(newSyncStatus *eth.SyncStatus) (inclusiveBl if newSyncStatus.CurrentL1.Number < l.prevSyncStatus.CurrentL1.Number { // sequencer restarted and hasn't caught up yet - l.batcher.Log.Warn("sequencer currentL1 reversed", "new currentL1", newSyncStatus.CurrentL1.Number, "previous currentL1", l.prevSyncStatus.CurrentL1) + l.batcher.Log.Warn("sequencer currentL1 reversed", "new currentL1", newSyncStatus.CurrentL1.Number, "previous currentL1", l.prevSyncStatus.CurrentL1.Number) return inclusiveBlockRange{}, ActionRetry }