diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index fd6cf65..fa0bc51 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -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 \ No newline at end of file + SIGNER_PRIVATE_KEY=$SIGNER_PRIVATE_KEY make holesky-test \ No newline at end of file diff --git a/Makefile b/Makefile index 7fa8537..bbda24e 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 6d0d96c..4a4b73a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/e2e/optimism_test.go b/e2e/optimism_test.go index eb8ae93..6ac7461 100644 --- a/e2e/optimism_test.go +++ b/e2e/optimism_test.go @@ -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" @@ -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() @@ -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) @@ -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) diff --git a/e2e/server_test.go b/e2e/server_test.go index 40fcda2..7ac2551 100644 --- a/e2e/server_test.go +++ b/e2e/server_test.go @@ -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" @@ -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) @@ -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{ @@ -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) @@ -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{ diff --git a/e2e/setup_test.go b/e2e/setup.go similarity index 99% rename from e2e/setup_test.go rename to e2e/setup.go index e4d05b2..54b6ff2 100644 --- a/e2e/setup_test.go +++ b/e2e/setup.go @@ -1,4 +1,4 @@ -package e2e_test +package e2e import ( "context" diff --git a/operator-setup b/operator-setup deleted file mode 160000 index 2a5a91f..0000000 --- a/operator-setup +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2a5a91f81f7ff92d28f8febbffbb889d3ca3a855