Skip to content

Commit

Permalink
feat: OP Stack integration test - cleanups and refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Jun 10, 2024
1 parent a49da0e commit 9fdd74e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 28 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,8 @@ jobs:
run: |
go mod download
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Generate devnet allocations
run: make op-devnet-allocs

- name: Run E2E Tests
- name: Run holesky tests
env:
SIGNER_PRIVATE_KEY: ${{ secrets.SIGNER_PRIVATE_KEY }}
run: |
SIGNER_PRIVATE_KEY=$SIGNER_PRIVATE_KEY make e2e-test
SIGNER_PRIVATE_KEY=$SIGNER_PRIVATE_KEY make holesky-test
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ run-server:
clean:
rm bin/eigenda-proxy

test:
test: optimism-test
go test -v ./...

optimism-test:
OPTIMISM=true go test -timeout 50m -v ./e2e/... -deploy-config ../.devnet/devnetL1.json

e2e-test:
holesky-test:
TESTNET=true go test -timeout 50m -v ./e2e/server_test.go -testnet-integration

.PHONY: lint
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ The `raw commitment` for EigenDA is encoding certificate and kzg fields.

## Testing

Some unit tests have been introduced to assert the correctness of:
### Unit
Unit tests can be ran via invoking `make test`.

* DA Certificate encoding/decoding logic
* commitment verification logic
### Holesky
A holesky integration test can be ran using `make holesky-test` to assert proper dispersal/retrieval against a public network. Please **note** that EigenDA Holesky network which is subject to rate-limiting and slow confirmation times *(i.e, >10 minutes per blob confirmation)*. Please advise EigenDA's [inabox](https://github.com/Layr-Labs/eigenda/tree/master/inabox#readme) if you'd like to spin-up a local DA network for faster iteration testing.

Unit tests can be ran via `make test`.

Otherwise E2E tests (`test/e2e_test.go`) exists which asserts that a commitment can be generated when inserting some arbitrary data to the server and can be read using the commitment for a key lookup via the client. These can be ran via `make e2e-test`. Please **note** that this test uses the EigenDA Holesky network which is subject to rate-limiting and slow confirmation times *(i.e, >10 minutes per blob confirmation)*. Please advise EigenDA's [inabox](https://github.com/Layr-Labs/eigenda/tree/master/inabox#readme) if you'd like to spin-up a local DA network for faster iteration testing.
### Optimism
An E2E test exists which spins up a local OP sequencer instance using the [op-e2e](https://github.com/ethereum-optimism/optimism/tree/develop/op-e2e) framework for asserting correct interaction behaviors with batch submission and state derivation. These tests can be ran via `make optimism-test`.

**NOTE:**

## Downloading Mainnet SRS

Expand Down
11 changes: 4 additions & 7 deletions e2e/optimism_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package e2e_test
import (
"testing"

"github.com/Layr-Labs/eigenda-proxy/e2e"

"github.com/ethereum-optimism/optimism/op-e2e/actions"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
Expand Down Expand Up @@ -69,10 +71,6 @@ func NewL2PlasmaDA(t actions.Testing, daHost string) *L2PlasmaDA {
plasmaCfg, err := sd.RollupCfg.GetOPPlasmaConfig()
require.NoError(t, err)

// // set lower finalization times
// plasmaCfg.ChallengeWindow = 1
// plasmaCfg.ResolveWindow = 1

daMgr := plasma.NewPlasmaDAWithStorage(log, plasmaCfg, storage, &plasma.NoopMetrics{})

enabled := sd.RollupCfg.PlasmaEnabled()
Expand Down Expand Up @@ -107,13 +105,12 @@ func (a *L2PlasmaDA) ActL1Finalized(t actions.Testing) {
a.sequencer.ActL1FinalizedSignal(t)
}

// TestOptimism ... Creates a new SysTestSuite
func TestOptimism(gt *testing.T) {
if !runOptimismIntegrationTests {
gt.Skip("Skipping OP Stack integration test")
}

proxyTS, close := CreateTestSuite(gt, true)
proxyTS, close := e2e.CreateTestSuite(gt, true)
defer close()

t := actions.NewDefaultTesting(gt)
Expand Down Expand Up @@ -160,7 +157,7 @@ func TestOptimism(gt *testing.T) {
op_stack.sequencer.ActL2PipelineFull(t)
op_stack.ActL1Finalized(t)

// assert that EigenDA proxy was written and read from
// assert that EigenDA proxy's was written and read from
stat := proxyTS.Server.Store().Stats()

require.Equal(t, stat.Entries, 1)
Expand Down
10 changes: 6 additions & 4 deletions e2e/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import (
"time"

"github.com/Layr-Labs/eigenda-proxy/client"

"github.com/Layr-Labs/eigenda-proxy/common"
"github.com/Layr-Labs/eigenda-proxy/e2e"
"github.com/Layr-Labs/eigenda/api/clients/codecs"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
op_plasma "github.com/ethereum-optimism/optimism/op-plasma"
Expand All @@ -18,7 +20,7 @@ func TestHoleskyWithPlasmaClient(t *testing.T) {
t.Skip("Skipping testnet integration test")
}

ts, kill := CreateTestSuite(t, false)
ts, kill := e2e.CreateTestSuite(t, false)
defer kill()

daClient := op_plasma.NewDAClient(ts.Address(), false, false)
Expand Down Expand Up @@ -46,7 +48,7 @@ func TestHoleskyWithProxyClient(t *testing.T) {
t.Skip("Skipping testnet integration test")
}

ts, kill := CreateTestSuite(t, false)
ts, kill := e2e.CreateTestSuite(t, false)
defer kill()

cfg := &client.Config{
Expand Down Expand Up @@ -98,7 +100,7 @@ func TestMemStoreWithPlasmaClient(t *testing.T) {
t.Skip("Skipping non-testnet integration test")
}

ts, kill := CreateTestSuite(t, true)
ts, kill := e2e.CreateTestSuite(t, true)
defer kill()

daClient := op_plasma.NewDAClient(ts.Address(), false, false)
Expand Down Expand Up @@ -126,7 +128,7 @@ func TestMemStoreWithProxyClient(t *testing.T) {
t.Skip("Skipping non-testnet integration test")
}

ts, kill := CreateTestSuite(t, true)
ts, kill := e2e.CreateTestSuite(t, true)
defer kill()

cfg := &client.Config{
Expand Down
2 changes: 1 addition & 1 deletion e2e/setup_test.go → e2e/setup.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e_test
package e2e

import (
"context"
Expand Down
1 change: 0 additions & 1 deletion operator-setup
Submodule operator-setup deleted from 2a5a91

0 comments on commit 9fdd74e

Please sign in to comment.