Skip to content

Commit 0213ba4

Browse files
rename steps
1 parent 5dc9f9d commit 0213ba4

File tree

3 files changed

+176
-15
lines changed

3 files changed

+176
-15
lines changed

.github/workflows/devnet-test-no-provers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
paths:
1111
- 'docker-compose*.yml'
1212
- 'surge-*.sh'
13-
- 'script/devnet-e2e-provision-check.sh'
13+
- 'script/devnet-provision-check.sh'
1414
- 'script/devnet-provision-check-ci.sh'
1515
- 'script/util/common.sh'
1616
- '.github/workflows/devnet-test-no-provers.yml'

script/devnet-provision-check-ci.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,38 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
99
source "$SCRIPT_DIR/util/common.sh"
1010

1111
# Configuration with defaults
12-
L1_PACKAGE_DIR="${L1_PACKAGE_DIR:-../surge-ethereum-package}"
12+
L1_PACKAGE_DIR="${L1_PACKAGE_DIR:-$PROJECT_ROOT/../surge-ethereum-package}"
1313
L1_ENVIRONMENT="${L1_ENVIRONMENT:-local}"
1414
L1_MODE="${L1_MODE:-silence}"
1515
L1_RPC_URL="${L1_RPC_URL:-http://localhost:32003}"
1616
L1_STABILIZE_WAIT="${L1_STABILIZE_WAIT:-20}"
1717
ENABLE_PROVER="${ENABLE_PROVER:-false}"
18-
ENV_FILE="${ENV_FILE:-.env.devnet}"
18+
ENV_FILE="${ENV_FILE:-$PROJECT_ROOT/.env.devnet}"
1919

2020
echo "Starting CI Devnet Provision Check (No Provers)"
2121
echo
2222

23-
# Navigate to project root
24-
cd "$PROJECT_ROOT"
25-
26-
# Step 0: Deploy L1 Devnet
27-
echo "Step 0: Deploy L1 Devnet"
23+
# Step 1: Deploy L1 Devnet
24+
echo "Step 1: Deploy L1 Devnet"
2825
deploy_l1 "$L1_PACKAGE_DIR" "$L1_ENVIRONMENT" "$L1_MODE"
2926
echo
3027

31-
# Step 0.5: Wait for L1 to be ready
32-
echo "Step 0.5: Verify L1 is ready"
28+
# Step 2: Verify L1 is ready
29+
echo "Step 2: Verify L1 is ready"
3330
print_info "Waiting ${L1_STABILIZE_WAIT} seconds for L1 to stabilize..."
3431
sleep "$L1_STABILIZE_WAIT"
3532

3633
wait_for_rpc "$L1_RPC_URL"
3734
echo
3835

39-
# Step 0.6: Configure environment for no-prover testing
36+
# Step 3: Configure environment for no-prover testing
4037
if [ "$ENABLE_PROVER" = "false" ]; then
41-
echo "Step 0.6: Configure environment for no-prover testing"
38+
echo "Step 3: Configure environment for no-prover testing"
4239
configure_env_no_provers "$ENV_FILE"
4340
echo
4441
fi
4542

46-
# Run the actual provision check
47-
echo "Running Devnet Provision Check"
48-
"$SCRIPT_DIR/devnet-e2e-provision-check.sh"
43+
# Step 4: Run L2 Devnet Provision Check
44+
echo "Step 4: Run L2 Devnet Provision Check"
45+
cd "$PROJECT_ROOT"
46+
"$SCRIPT_DIR/devnet-provision-check.sh"

script/devnet-provision-check.sh

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
7+
8+
# Source common utilities if available, otherwise define locally
9+
if [ -f "$SCRIPT_DIR/util/common.sh" ]; then
10+
source "$SCRIPT_DIR/util/common.sh"
11+
else
12+
print_success() { echo "[SUCCESS] $1"; }
13+
print_error() { echo "[ERROR] $1"; }
14+
print_info() { echo "[INFO] $1"; }
15+
fi
16+
17+
# Ensure we're in the project root
18+
cd "$PROJECT_ROOT"
19+
20+
echo "Starting Devnet Provision Check (No Provers)"
21+
echo
22+
23+
# Step 1: Clean up any existing deployment
24+
echo "Step 1: Cleanup existing deployment"
25+
print_info "Running surge-remover.sh --devnet-non-interactive"
26+
if ./surge-remover.sh --devnet-non-interactive; then
27+
print_success "Cleanup completed"
28+
else
29+
print_error "Cleanup failed"
30+
exit 1
31+
fi
32+
echo
33+
34+
# Step 2: Prepare environment
35+
echo "Step 2: Prepare environment"
36+
if [ ! -f .env ]; then
37+
print_info "Copying .env.devnet to .env"
38+
cp .env.devnet .env
39+
print_success ".env file created"
40+
else
41+
print_info ".env file already exists"
42+
fi
43+
echo
44+
45+
# Step 3: Deploy protocol
46+
echo "Step 3: Deploy protocol (L1 contracts)"
47+
print_info "Running surge-protocol-deployer.sh --devnet-non-interactive"
48+
if ./surge-protocol-deployer.sh --devnet-non-interactive; then
49+
print_success "Protocol deployment completed"
50+
else
51+
print_error "Protocol deployment failed"
52+
exit 1
53+
fi
54+
echo
55+
56+
# Step 4: Verify protocol deployment artifacts
57+
echo "Step 4: Verify protocol deployment"
58+
if [ ! -f "deployment/deploy_l1.json" ]; then
59+
print_error "deploy_l1.json not found"
60+
exit 1
61+
else
62+
print_success "deploy_l1.json found"
63+
fi
64+
65+
if [ ! -f "deployment/proposer_wrappers.json" ]; then
66+
print_error "proposer_wrappers.json not found"
67+
exit 1
68+
else
69+
print_success "proposer_wrappers.json found"
70+
fi
71+
echo
72+
73+
# Step 5: Deploy stack
74+
echo "Step 5: Deploy L2 stack"
75+
print_info "Running surge-stack-deployer.sh --devnet-non-interactive"
76+
if ./surge-stack-deployer.sh --devnet-non-interactive; then
77+
print_success "Stack deployment completed"
78+
else
79+
print_error "Stack deployment failed"
80+
exit 1
81+
fi
82+
echo
83+
84+
# Step 6: Verify services are running
85+
echo "Step 6: Verify services"
86+
print_info "Checking running containers"
87+
docker compose ps
88+
echo
89+
90+
print_info "Checking critical containers are healthy..."
91+
# Check L2 execution client container
92+
if docker compose ps | grep "l2-nethermind-execution-client" | grep -q "(healthy)"; then
93+
print_success "L2 execution client container is healthy"
94+
else
95+
print_error "L2 execution client container is not healthy"
96+
exit 1
97+
fi
98+
99+
# Check other critical containers are running
100+
CRITICAL_CONTAINERS=("l2-taiko-consensus-client" "l2-taiko-proposer-client" "relayer-l1-indexer" "relayer-l2-indexer")
101+
for container in "${CRITICAL_CONTAINERS[@]}"; do
102+
if docker compose ps | grep "$container" | grep -q "Up"; then
103+
print_success "$container is running"
104+
else
105+
print_error "$container is not running"
106+
exit 1
107+
fi
108+
done
109+
echo
110+
111+
# Step 7: Health check L2 RPC endpoints
112+
echo "Step 7: Health check L2 RPC endpoints"
113+
print_info "Waiting 30 seconds for services to stabilize..."
114+
sleep 30
115+
116+
print_info "Testing L2 RPC endpoint at http://localhost:8547"
117+
if curl -f http://localhost:8547 -X POST -H "Content-Type: application/json" \
118+
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 2>/dev/null; then
119+
echo
120+
print_success "L2 execution client RPC is responding"
121+
else
122+
echo
123+
print_error "L2 execution client RPC health check failed"
124+
exit 1
125+
fi
126+
127+
print_info "Testing L2 WebSocket endpoint at ws://localhost:8548"
128+
if curl -f http://localhost:8548 -X POST -H "Content-Type: application/json" \
129+
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 2>/dev/null; then
130+
echo
131+
print_success "L2 WebSocket endpoint is responding"
132+
else
133+
echo
134+
print_error "L2 WebSocket endpoint health check failed"
135+
exit 1
136+
fi
137+
echo
138+
139+
# Step 8: Check for errors in logs
140+
echo "Step 8: Check for errors in logs"
141+
print_info "Checking for errors in container logs (last 50 lines)"
142+
if docker compose logs --tail=50 | grep -i "error\|fatal\|panic" | grep -v "error_code" | head -20; then
143+
print_info "Found some errors in logs (review above)"
144+
else
145+
print_success "No critical errors found in recent logs"
146+
fi
147+
echo
148+
149+
# Final summary
150+
echo "=========================================="
151+
echo "Provision Check Summary"
152+
echo "=========================================="
153+
print_success "All provision checks passed!"
154+
echo
155+
print_info "Services are running. You can now:"
156+
echo " - Access L2 RPC: http://localhost:8547"
157+
echo " - Access L2 Blockscout: http://localhost:3000"
158+
echo " - Access L1 RPC: http://localhost:32003"
159+
echo " - View logs: docker compose logs -f"
160+
echo
161+
print_info "To clean up when done:"
162+
echo " ./surge-remover.sh --devnet-non-interactive"
163+
echo

0 commit comments

Comments
 (0)