Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ad6b9b8
feat: add comprehensive monitoring guide for OP Stack chains
krofax Oct 15, 2025
6f9f05b
feat: update monitoring tutorial for OP Stack with op-dispute-mon
krofax Oct 20, 2025
1aa12e8
fix: correct JSON structure and improve documentation navigation
krofax Oct 20, 2025
79ad879
feat: add dispute monitor setup and update documentation
krofax Oct 20, 2025
dcb9520
feat: enhance dispute monitor configuration and setup
krofax Oct 21, 2025
131da54
refactor: update monitoring chain tutorial and remove obsolete files
krofax Oct 21, 2025
8bda9ca
refactor: update op-dispute-setup tutorial for improved address retri…
krofax Oct 21, 2025
e6418ad
feat: add monitoring step to op-dispute-setup tutorial
krofax Oct 21, 2025
757dc78
fix: update links and improve formatting in op-dispute-setup tutorial
krofax Oct 21, 2025
4f43766
refactor: enhance op-dispute-setup tutorial for clarity and structure
krofax Oct 21, 2025
6caca6a
refactor: streamline op-dispute-setup tutorial for improved clarity a…
krofax Oct 21, 2025
b55e9d2
refactor: enhance op-dispute-setup tutorial for clarity and usability
krofax Oct 21, 2025
5712f87
refactor: remove redundant steps in op-dispute-setup tutorial
krofax Oct 21, 2025
901f215
refactor: update op-dispute-setup tutorial for improved clarity and m…
krofax Oct 21, 2025
14d1b74
refactor: update op-dispute-setup tutorial with enhanced metrics and …
krofax Oct 21, 2025
65d4139
refactor: enhance op-dispute-setup tutorial with additional metrics a…
krofax Oct 21, 2025
83b30b2
refactor: simplify op-dispute-setup tutorial by removing outdated met…
krofax Oct 21, 2025
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
8 changes: 8 additions & 0 deletions create-l2-rollup-example/.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ OP_PROPOSER_PROPOSAL_INTERVAL="3600s"
OP_PROPOSER_GAME_TYPE="0"
OP_PROPOSER_POLL_INTERVAL="20s"

# Dispute monitor environment variables
# ROLLUP_RPC="http://op-node:8547"
# PROPOSER_ADDRESS="<auto-generated>"
# CHALLENGER_ADDRESS="<auto-generated>"
# OP_DISPUTE_MON_GAME_FACTORY_ADDRESS="<auto-generated>"
# OP_DISPUTE_MON_NETWORK="op-sepolia"
# OP_DISPUTE_MON_MONITOR_INTERVAL="10s"

# ==========================================
# DEVELOPMENT: Local Network (Alternative to Sepolia)
# ==========================================
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set -e

# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"

# Change to dispute-mon directory
cd "$SCRIPT_DIR/.."

# Load environment variables
source .env

# Path to op-dispute-mon binary
DISPUTE_MON_BIN="$PROJECT_ROOT/optimism/op-dispute-mon/bin/op-dispute-mon"

# Check if binary exists
if [ ! -f "$DISPUTE_MON_BIN" ]; then
echo "Error: op-dispute-mon binary not found at $DISPUTE_MON_BIN"
echo "Please build op-dispute-mon first:"
echo " cd $PROJECT_ROOT/optimism/op-dispute-mon"
echo " make op-dispute-mon"
exit 1
fi

echo "Starting op-dispute-mon..."
echo "Game Factory: $GAME_FACTORY_ADDRESS"
echo "Proposer: $PROPOSER_ADDRESS"
echo "Challenger: $CHALLENGER_ADDRESS"

$DISPUTE_MON_BIN \
--l1-eth-rpc=$L1_RPC_URL \
--rollup-rpc=$ROLLUP_RPC \
--game-factory-address=$GAME_FACTORY_ADDRESS \
--honest-actors=$PROPOSER_ADDRESS,$CHALLENGER_ADDRESS \
--network=$NETWORK \
--monitor-interval=$MONITOR_INTERVAL \
--log.level=$LOG_LEVEL \
--log.format=$LOG_FORMAT \
--metrics.enabled=$METRICS_ENABLED \
--metrics.addr=$METRICS_ADDR \
--metrics.port=$METRICS_PORT
29 changes: 29 additions & 0 deletions create-l2-rollup-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,34 @@ services:
op-node:
condition: service_healthy

# Dispute Monitor
dispute-mon:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-dispute-mon:v1.4.2-rc.1
container_name: dispute-mon
volumes:
- ./dispute-mon:/workspace
working_dir: /workspace
ports:
- "7300:7300"
env_file:
- ./dispute-mon/.env
- .env
environment:
- OP_DISPUTE_MON_L1_ETH_RPC=${L1_RPC_URL}
- OP_DISPUTE_MON_ROLLUP_RPC=${ROLLUP_RPC}
- OP_DISPUTE_MON_HONEST_ACTORS=${PROPOSER_ADDRESS},${CHALLENGER_ADDRESS}
- OP_DISPUTE_MON_GAME_FACTORY_ADDRESS=${GAME_FACTORY_ADDRESS}
- OP_DISPUTE_MON_MONITOR_INTERVAL=10s
- OP_DISPUTE_MON_NETWORK=op-sepolia
- OP_DISPUTE_MON_LOG_LEVEL=debug
- OP_DISPUTE_MON_LOG_FORMAT=logfmt
- OP_DISPUTE_MON_METRICS_ADDR=0.0.0.0
- OP_DISPUTE_MON_METRICS_ENABLED=true
- OP_DISPUTE_MON_METRICS_PORT=7300
depends_on:
op-node:
condition: service_healthy
restart: unless-stopped

volumes:
op_geth_data:
1 change: 0 additions & 1 deletion create-l2-rollup-example/optimism
Submodule optimism deleted from a094d0
48 changes: 47 additions & 1 deletion create-l2-rollup-example/scripts/setup-rollup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ SEQUENCER_DIR="$ROLLUP_DIR/sequencer"
BATCHER_DIR="$ROLLUP_DIR/batcher"
PROPOSER_DIR="$ROLLUP_DIR/proposer"
CHALLENGER_DIR="$ROLLUP_DIR/challenger"
DISPUTE_MON_DIR="$ROLLUP_DIR/dispute-mon"

# Logging functions
log_info() {
Expand Down Expand Up @@ -427,6 +428,49 @@ generate_challenger_prestate() {
log_success "Challenger prestate generation complete: $ROLLUP_DIR/challenger/${PRESTATE_HASH}.bin.gz"
}

# Setup dispute monitor
setup_dispute_monitor() {
log_info "Setting up dispute monitor..."

mkdir -p "$DISPUTE_MON_DIR"
cd "$DISPUTE_MON_DIR"

# Get required addresses from state.json
GAME_FACTORY_ADDRESS=$(jq -r '.opChainDeployments[0].DisputeGameFactoryProxy' "$DEPLOYER_DIR/.deployer/state.json")
PROPOSER_ADDRESS=$(jq -r '.appliedIntent.chains[0].roles.proposer' "$DEPLOYER_DIR/.deployer/state.json")
CHALLENGER_ADDRESS=$(jq -r '.appliedIntent.chains[0].roles.challenger' "$DEPLOYER_DIR/.deployer/state.json")

log_info "Game Factory: $GAME_FACTORY_ADDRESS"
log_info "Proposer: $PROPOSER_ADDRESS"
log_info "Challenger: $CHALLENGER_ADDRESS"

# Create environment file for dispute monitor
cat > .env << EOF
# Rollup RPC Configuration
ROLLUP_RPC=http://op-node:8547

# Contract Addresses
OP_DISPUTE_MON_GAME_FACTORY_ADDRESS=$GAME_FACTORY_ADDRESS

# Honest Actors
PROPOSER_ADDRESS=$PROPOSER_ADDRESS
CHALLENGER_ADDRESS=$CHALLENGER_ADDRESS

# Network Configuration
OP_DISPUTE_MON_NETWORK=op-sepolia

# Monitoring Configuration
OP_DISPUTE_MON_MONITOR_INTERVAL=10s
EOF

# Create logs directory
mkdir -p logs

log_success "Dispute monitor configuration created"
log_info "Dispute monitor will start with 'docker-compose up -d' from project root"
log_info "To verify it's working, run: curl -s http://localhost:7300/metrics | grep -E \"op_dispute_mon_(games|ignored)\" | head -10"
}

# Add op-deployer to PATH if it exists in the workspace
if [ -f "$(dirname "$0")/../op-deployer" ]; then
OP_DEPLOYER_PATH="$(cd "$(dirname "$0")/.." && pwd)/op-deployer"
Expand Down Expand Up @@ -457,9 +501,11 @@ main() {
setup_proposer
generate_challenger_prestate
setup_challenger
setup_dispute_monitor

log_success "OP Stack L2 Rollup deployment complete!"
log_info "Run 'docker-compose up -d' to start all services"
log_info "Run 'docker-compose up -d' to start all services (including dispute monitor)"
log_info "Dispute monitor metrics: http://localhost:7300/metrics"
}

# Handle command line arguments for standalone function calls
Expand Down
Loading