Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions espresso/.env
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER=1
ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG="info"
ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE="ghcr.io/espressosystems/attestation-verifier-zk:sha-f5d0a46"

# EigenDA Proxy
EIGENDA_PROXY_PORT=3100

L1_ENGINE_PORT=8551
L1_HTTP_PORT=8545
L1_BEACON_PORT=5052
Expand Down
5 changes: 4 additions & 1 deletion espresso/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ services:
condition: service_started
espresso-dev-node:
condition: service_started
eigenda-proxy:
condition: service_healthy
l2-genesis:
condition: service_completed_successfully
attestation-service-zk:
Expand Down Expand Up @@ -491,6 +493,7 @@ services:
export ROLLUP_RPC_URL="http://127.0.0.1:${ROLLUP_PORT}"
export ESPRESSO_URL1="http://127.0.0.1:${ESPRESSO_SEQUENCER_API_PORT}"
export ESPRESSO_ATTESTATION_SERVICE_URL="http://127.0.0.1:${ESPRESSO_ATTESTATION_VERIFIER_PORT}"
export EIGENDA_PROXY_URL="http://127.0.0.1:${EIGENDA_PROXY_PORT}"
/source/espresso/docker/op-batcher-tee/run-enclave.sh

# Legacy op-proposer (for non-succinct mode)
Expand Down Expand Up @@ -654,7 +657,7 @@ services:
image: ghcr.io/layr-labs/eigenda-proxy:2.2.1
platform: linux/amd64
ports:
- "${EIGENDA_PROXY_PORT:-3100}:3100"
- "${EIGENDA_PROXY_PORT}:3100"
environment:
EIGENDA_PROXY_STORAGE_BACKENDS_TO_ENABLE: V2
EIGENDA_PROXY_STORAGE_DISPERSAL_BACKEND: V2
Expand Down
18 changes: 17 additions & 1 deletion espresso/docker/op-batcher-tee/run-enclave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ set -e
: ${ESPRESSO_URL1:?Error: ESPRESSO_URL1 is required}
: ${OPERATOR_PRIVATE_KEY:?Error: OPERATOR_PRIVATE_KEY is required}
: ${ESPRESSO_ATTESTATION_SERVICE_URL:?Error: ESPRESSO_ATTESTATION_SERVICE_URL is required}
: ${EIGENDA_PROXY_URL:?Error: EIGENDA_PROXY_URL is required}

# Optional configuration with defaults
TAG="${TAG:-op-batcher-enclavetool}"
ESPRESSO_URL2="${ESPRESSO_URL2:-$ESPRESSO_URL1}" # Default to same as URL1 if not set
ESPRESSO_ORIGIN_HEIGHT_ESPRESSO="${ESPRESSO_ORIGIN_HEIGHT_ESPRESSO:-0}"
ESPRESSO_ORIGIN_HEIGHT_L2="${ESPRESSO_ORIGIN_HEIGHT_L2:-0}"
ENCLAVE_DEBUG="${ENCLAVE_DEBUG:-false}"
MONITOR_INTERVAL="${MONITOR_INTERVAL:-30}"
MEMORY_MB="${ENCLAVE_MEMORY_MB:-4096}"
Expand All @@ -30,6 +33,9 @@ echo "L2 RPC URL: $L2_RPC_URL"
echo "Rollup RPC URL: $ROLLUP_RPC_URL"
echo "Espresso URLs: $ESPRESSO_URL1, $ESPRESSO_URL2"
echo "Attestation service url: $ESPRESSO_ATTESTATION_SERVICE_URL"
echo "EigenDA Proxy URL: $EIGENDA_PROXY_URL"
echo "Espresso Origin Height: $ESPRESSO_ORIGIN_HEIGHT_ESPRESSO"
echo "L2 Origin Height: $ESPRESSO_ORIGIN_HEIGHT_L2"
echo "Debug Mode: $ENCLAVE_DEBUG"
echo "Monitor Interval: $MONITOR_INTERVAL seconds"
echo "Memory: ${MEMORY_MB}MB"
Expand All @@ -44,6 +50,8 @@ BATCHER_ARGS="$BATCHER_ARGS,--espresso.enabled=true"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.urls=$ESPRESSO_URL1"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.urls=$ESPRESSO_URL2"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.espresso-attestation-service=$ESPRESSO_ATTESTATION_SERVICE_URL"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.origin-height-espresso=$ESPRESSO_ORIGIN_HEIGHT_ESPRESSO"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.origin-height-l2=$ESPRESSO_ORIGIN_HEIGHT_L2"

# Use private key if provided, otherwise fall back to test mnemonic
if [ -n "$OP_BATCHER_PRIVATE_KEY" ]; then
Expand All @@ -56,11 +64,19 @@ else
fi

BATCHER_ARGS="$BATCHER_ARGS,--throttle-threshold=0"
BATCHER_ARGS="$BATCHER_ARGS,--max-channel-duration=1"
BATCHER_ARGS="$BATCHER_ARGS,--max-channel-duration=2"
BATCHER_ARGS="$BATCHER_ARGS,--target-num-frames=1"
BATCHER_ARGS="$BATCHER_ARGS,--max-pending-tx=32"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.fetch-api=true"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.light-client-addr=0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797"
BATCHER_ARGS="$BATCHER_ARGS,--espresso.espresso-attestation-service=$ESPRESSO_ATTESTATION_SERVICE_URL"
BATCHER_ARGS="$BATCHER_ARGS,--altda.enabled=true"
BATCHER_ARGS="$BATCHER_ARGS,--altda.da-server=$EIGENDA_PROXY_URL"
BATCHER_ARGS="$BATCHER_ARGS,--altda.da-service=true"
BATCHER_ARGS="$BATCHER_ARGS,--altda.max-concurrent-da-requests=32"
BATCHER_ARGS="$BATCHER_ARGS,--altda.put-timeout=30s"
BATCHER_ARGS="$BATCHER_ARGS,--altda.get-timeout=30s"
BATCHER_ARGS="$BATCHER_ARGS,--data-availability-type=calldata"

# Add debug arguments if enabled
if [ "$ENCLAVE_DEBUG" = "true" ]; then
Expand Down
2 changes: 2 additions & 0 deletions espresso/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ func (s *BatchStreamer[B]) Refresh(ctx context.Context, finalizedL1 eth.L1BlockR
// CheckBatch checks the validity of the given batch against the finalized L1
// block and the safe L1 origin.
func (s *BatchStreamer[B]) CheckBatch(ctx context.Context, batch B) (BatchValidity, int) {

// Make sure the finalized L1 block is initialized before checking the block number.
if s.FinalizedL1 == (eth.L1BlockRef{}) {
s.Log.Error("Finalized L1 block not initialized")
return BatchUndecided, 0
}
origin := (batch).L1Origin()

if origin.Number > s.FinalizedL1.Number {
// Signal to resync to wait for the L1 finality.
s.Log.Warn("L1 origin not finalized, pending resync", "finalized L1 block number", s.FinalizedL1.Number, "origin number", origin.Number)
Expand Down
4 changes: 3 additions & 1 deletion op-batcher/enclave-entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ launch_socat() {
return 1
}

# Return socat-proxied URL
# Return socat-proxied URL (strip trailing slash to avoid double-slash in paths)
local new_url
new_url="$(trurl --url "$original_url" --set host="127.0.0.1" --set port="$socat_port")"
# Remove trailing slash if present
new_url="${new_url%/}"
echo "$new_url"

return 0
Expand Down
Loading