Skip to content

Commit 0415033

Browse files
Add EigenDA V2 CI infrastructure
1 parent b4ece8e commit 0415033

File tree

3 files changed

+268
-12
lines changed

3 files changed

+268
-12
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: EigenDA V2 CI
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
pull_request:
7+
paths:
8+
- 'eigenda/**'
9+
- 'system_tests/eigenda_v2_test.go'
10+
- 'scripts/start-eigenda-proxy.sh'
11+
- '.github/workflows/eigenda-v2-ci.yml'
12+
13+
jobs:
14+
eigenda-v2-tests:
15+
runs-on: linux-2xl
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- uses: ./.github/actions/ci-setup
23+
24+
- name: Start EigenDA V2 Proxy
25+
run: |
26+
# Start V2 proxy (will skip if image not available)
27+
./scripts/start-eigenda-proxy.sh v2 || echo "V2 proxy not available yet, skipping"
28+
continue-on-error: true
29+
30+
- name: Build Nitro
31+
run: make -j8 build test-go-deps
32+
env:
33+
CARGO_BUILD_JOBS: 2
34+
35+
- name: Run V2 Integration Tests
36+
run: |
37+
# Run V2 tests with special build tag
38+
# Tests are currently skipped but will run when V2 is ready
39+
go test -timeout 600s \
40+
-tags eigendav2test \
41+
-v \
42+
./system_tests \
43+
-run "TestEigenDAV2" || echo "V2 tests skipped (not yet implemented)"
44+
env:
45+
GOMEMLIMIT: 6GiB
46+
GOGC: 80
47+
continue-on-error: true
48+
49+
- name: Check for V2 TODOs
50+
run: |
51+
echo "=== V2 Implementation TODOs ==="
52+
echo ""
53+
echo "Proxy Script TODOs:"
54+
grep -n "TODO" scripts/start-eigenda-proxy.sh || echo "None"
55+
echo ""
56+
echo "Test TODOs:"
57+
grep -n "TODO" system_tests/eigenda_v2_test.go | head -20 || echo "None"
58+
echo ""
59+
echo "Run './scripts/start-eigenda-proxy.sh v2' to test V2 proxy startup"
60+
echo "Run 'go test -tags eigendav2test ./system_tests -run TestEigenDAV2' to run V2 tests"
61+
62+
- name: Upload Test Logs
63+
if: always()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: eigenda-v2-test-logs
67+
path: |
68+
system_tests/*.log
69+
/tmp/eigenda-v2-*.log
70+
if-no-files-found: ignore

scripts/start-eigenda-proxy.sh

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,67 @@
11
#!/usr/bin/env bash
22

3-
echo "==== Pull eigenda-proxy container ===="
4-
docker pull ghcr.io/layr-labs/eigenda-proxy:2.3.1
3+
set -euo pipefail
54

6-
echo "==== Starting eigenda-proxy container ===="
5+
# Version parameter: v1 or v2 (default: v1)
6+
VERSION="${1:-v1}"
77

8-
# proxy has a bug currently which forces the use of the service manager address
8+
# Configuration based on version
9+
case "$VERSION" in
10+
v1)
11+
PROXY_IMAGE="ghcr.io/layr-labs/eigenda-proxy:2.3.1"
12+
CONTAINER_NAME="eigenda-proxy-nitro-test-instance"
13+
STORAGE_BACKENDS="V1"
14+
DISPERSAL_BACKEND="V1"
15+
APIS_TO_ENABLE="standard"
16+
;;
17+
v2)
18+
# TODO: Update with actual V2 proxy image tag when available
19+
PROXY_IMAGE="ghcr.io/layr-labs/eigenda-proxy:3.0.0"
20+
CONTAINER_NAME="eigenda-proxy-v2-nitro-test-instance"
21+
# TODO: Confirm V2 backend configuration with EigenDA team
22+
STORAGE_BACKENDS="V2"
23+
DISPERSAL_BACKEND="V2"
24+
# TODO: Confirm if this should be "alt-da", "altda", or "custom-da"
25+
APIS_TO_ENABLE="alt-da"
26+
;;
27+
*)
28+
echo "Error: Unknown version '$VERSION'. Use 'v1' or 'v2'"
29+
exit 1
30+
;;
31+
esac
32+
33+
echo "==== Pull eigenda-proxy $VERSION container ===="
34+
docker pull "$PROXY_IMAGE"
35+
36+
echo "==== Starting eigenda-proxy $VERSION container ===="
37+
38+
# proxy has a bug currently which forces the use of the service manager address
939
# & eth rpc despite cert verification being disabled.
1040

11-
docker run -d --name eigenda-proxy-nitro-test-instance \
41+
docker run -d --name "$CONTAINER_NAME" \
1242
-p 4242:6666 \
1343
-e EIGENDA_PROXY_ADDR=0.0.0.0 \
1444
-e EIGENDA_PROXY_PORT=6666 \
15-
-e EIGENDA_PROXY_STORAGE_BACKENDS_TO_ENABLE=V1 \
16-
-e EIGENDA_PROXY_STORAGE_DISPERSAL_BACKEND=V1 \
17-
-e EIGENDA_PROXY_APIS_TO_ENABLE=standard \
45+
-e EIGENDA_PROXY_STORAGE_BACKENDS_TO_ENABLE="$STORAGE_BACKENDS" \
46+
-e EIGENDA_PROXY_STORAGE_DISPERSAL_BACKEND="$DISPERSAL_BACKEND" \
47+
-e EIGENDA_PROXY_APIS_TO_ENABLE="$APIS_TO_ENABLE" \
1848
-e EIGENDA_PROXY_MEMSTORE_ENABLED=true \
1949
-e EIGENDA_PROXY_MEMSTORE_EXPIRATION=120m \
2050
-e EIGENDA_PROXY_EIGENDA_ETH_RPC=http://localhost:6969 \
2151
-e EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR="0x0000000000000000000000000000000000000000" \
2252
-e EIGENDA_PROXY_EIGENDA_CERT_VERIFICATION_DISABLED=true \
23-
ghcr.io/layr-labs/eigenda-proxy:2.3.1
53+
"$PROXY_IMAGE"
2454

2555
# shellcheck disable=SC2181
2656
if [ $? -ne 0 ]; then
27-
echo "==== Failed to start eigenda-proxy container ===="
57+
echo "==== Failed to start eigenda-proxy $VERSION container ===="
2858
exit 1
2959
fi
3060

31-
echo "==== eigenda-proxy container started ===="
61+
echo "==== eigenda-proxy $VERSION container started ===="
62+
echo "Container name: $CONTAINER_NAME"
63+
echo "Version: $VERSION"
64+
echo "Image: $PROXY_IMAGE"
3265

33-
## TODO - support teardown or embed a docker client wrapper that spins up and tears down resource
66+
## TODO - support teardown or embed a docker client wrapper that spins up and tears down resource
3467
# within system tests. Since this is only used by one system test, it's not a large priority atm.

system_tests/eigenda_v2_test.go

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
// Copyright 2021-2022, Offchain Labs, Inc.
2+
// For license information, see https://github.com/nitro/blob/master/LICENSE
3+
4+
//go:build eigendav2test
5+
// +build eigendav2test
6+
7+
package arbtest
8+
9+
import (
10+
"context"
11+
"math/big"
12+
"testing"
13+
"time"
14+
15+
"github.com/ethereum/go-ethereum/core/types"
16+
"github.com/ethereum/go-ethereum/ethclient"
17+
18+
"github.com/offchainlabs/nitro/arbnode"
19+
)
20+
21+
const (
22+
// V2 proxy URL - same port as V1 for now
23+
proxyV2URL = "http://127.0.0.1:4242"
24+
)
25+
26+
// TestEigenDAV2Integration is the main integration test for EigenDA V2
27+
// This test validates the V2 proxy and ALT DA spec integration
28+
func TestEigenDAV2Integration(t *testing.T) {
29+
// TODO: Uncomment when V2 proxy is available
30+
t.Skip("V2 proxy not yet available - placeholder test")
31+
32+
// Test V2 proxy reachability
33+
testEigenDAV2ProxyReachability(t)
34+
35+
// Test V2 batch posting via ALT DA spec
36+
testEigenDAV2BatchPosting(t)
37+
38+
// Test backward compatibility (V2 node reading V1 certs)
39+
testV2ReadsV1Certificates(t)
40+
}
41+
42+
// testEigenDAV2ProxyReachability tests that the EigenDA V2 proxy is accessible
43+
func testEigenDAV2ProxyReachability(t *testing.T) {
44+
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
45+
defer cancel()
46+
47+
// TODO: Implement V2-specific health check
48+
// V2 may use different health endpoint or method than V1's memconfig
49+
// For now, placeholder that would need to be updated based on V2 API
50+
51+
t.Logf("✅ EigenDA V2 proxy reachability test placeholder")
52+
t.Logf(" URL: %s", proxyV2URL)
53+
t.Logf(" TODO: Implement actual V2 health check when proxy available")
54+
55+
_ = ctx // Use context to avoid unused variable error
56+
}
57+
58+
// testEigenDAV2BatchPosting tests batch posting through V2 proxy
59+
func testEigenDAV2BatchPosting(t *testing.T) {
60+
ctx, cancel := context.WithCancel(context.Background())
61+
defer cancel()
62+
63+
// Setup similar to V1 but with V2 config
64+
builder := NewNodeBuilder(ctx).DefaultConfig(t, true)
65+
builder.parallelise = false
66+
builder.BuildL1(t)
67+
68+
// Setup with V2 proxy
69+
builder.nodeConfig.EigenDA.Enable = true
70+
builder.nodeConfig.EigenDA.Rpc = proxyV2URL
71+
// TODO: Add V2-specific config if needed (may require new config fields)
72+
73+
builder.L2Info.GenerateAccount("User2")
74+
builder.BuildL2OnL1(t)
75+
76+
// Setup second node for sync testing
77+
l1NodeConfigB := arbnode.ConfigDefaultL1NonSequencerTest()
78+
l1NodeConfigB.BlockValidator.Enable = false
79+
l1NodeConfigB.EigenDA.Enable = true
80+
l1NodeConfigB.EigenDA.Rpc = proxyV2URL
81+
82+
nodeBParams := SecondNodeParams{
83+
nodeConfig: l1NodeConfigB,
84+
initData: &builder.L2Info.ArbInitData,
85+
}
86+
l2B, cleanupB := builder.Build2ndNode(t, &nodeBParams)
87+
defer cleanupB()
88+
89+
// Verify batch posting works with V2
90+
checkEigenDAV2BatchPosting(t, ctx, builder.L1.Client, builder.L2.Client,
91+
builder.L1Info, builder.L2Info, big.NewInt(1e12), l2B.Client)
92+
93+
builder.L2.cleanup()
94+
}
95+
96+
// testV2ReadsV1Certificates tests backward compatibility
97+
// This is CRITICAL: V2 nodes must be able to read V1 certificates
98+
func testV2ReadsV1Certificates(t *testing.T) {
99+
t.Skip("Backward compatibility test - requires both V1 and V2 setup")
100+
101+
// TODO: Implement backward compatibility test
102+
// 1. Start V1 proxy and post batches
103+
// 2. Stop V1 proxy
104+
// 3. Start V2 proxy
105+
// 4. Start V2 node
106+
// 5. Verify V2 node can read V1 certificates from sequencer inbox
107+
// 6. Verify V2 node can sync from L1 with V1 batches
108+
109+
t.Logf("TODO: Implement V1 -> V2 backward compatibility test")
110+
}
111+
112+
// checkEigenDAV2BatchPosting is similar to V1's checkEigenDABatchPosting
113+
// but may need adjustments for V2 certificate format
114+
func checkEigenDAV2BatchPosting(t *testing.T, ctx context.Context, l1client, l2clientA *ethclient.Client, l1info, l2info info, expectedBalance *big.Int, l2ClientsToCheck ...*ethclient.Client) {
115+
// Prepare and send transaction
116+
tx := l2info.PrepareTx("Owner", "User2", l2info.TransferGas, big.NewInt(1e12), nil)
117+
err := l2clientA.SendTransaction(ctx, tx)
118+
Require(t, err)
119+
120+
_, err = EnsureTxSucceeded(ctx, l2clientA, tx)
121+
Require(t, err)
122+
123+
// Give the inbox reader time to pick up the delayed message
124+
time.Sleep(time.Millisecond * 100)
125+
126+
// Create L1 blocks to process delayed inbox message
127+
for i := 0; i < 100; i++ {
128+
SendWaitTestTransactions(t, ctx, l1client, []*types.Transaction{
129+
l1info.PrepareTx("Faucet", "User", 30000, big.NewInt(1e12), nil),
130+
})
131+
}
132+
133+
// Verify transaction processed and balance correct on all clients
134+
for _, client := range l2ClientsToCheck {
135+
_, err = WaitForTx(ctx, client, tx.Hash(), time.Second*100)
136+
Require(t, err)
137+
138+
l2balance, err := client.BalanceAt(ctx, l2info.GetAddress("User2"), nil)
139+
Require(t, err)
140+
141+
if l2balance.Cmp(expectedBalance) != 0 {
142+
Fatal(t, "Unexpected balance:", l2balance, "expected:", expectedBalance)
143+
}
144+
}
145+
146+
t.Logf("✅ V2 batch posting successful, balance verified: %s", expectedBalance.String())
147+
}
148+
149+
// TestEigenDAV2ProxyReachability is a standalone test for CI
150+
// Can be run independently to just check if V2 proxy is up
151+
func TestEigenDAV2ProxyReachability(t *testing.T) {
152+
testEigenDAV2ProxyReachability(t)
153+
}

0 commit comments

Comments
 (0)