diff --git a/e2e/main_test.go b/e2e/main_test.go index 274cab6..dc89ce4 100644 --- a/e2e/main_test.go +++ b/e2e/main_test.go @@ -84,6 +84,5 @@ func requireOPClientSetGet(t *testing.T, ts e2e.TestSuite, blob []byte, precompu preimage, err := daClient.GetInput(ts.Ctx, commit) require.NoError(t, err) require.Equal(t, blob, preimage) - requireDispersalRetrievalEigenDA(t, ts.Metrics.HTTPServerRequestsTotal, commitments.OptimismKeccak) } diff --git a/e2e/optimism_test.go b/e2e/optimism_test.go index db7be2c..b388f8e 100644 --- a/e2e/optimism_test.go +++ b/e2e/optimism_test.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" ) diff --git a/e2e/safety_checks_test.go b/e2e/safety_checks_test.go index c71f061..28402b7 100644 --- a/e2e/safety_checks_test.go +++ b/e2e/safety_checks_test.go @@ -14,6 +14,11 @@ import ( "github.com/stretchr/testify/require" ) +func isNilPtrDerefPanic(err string) bool { + return strings.Contains(err, "panic") && strings.Contains(err, "SIGSEGV") && + strings.Contains(err, "nil pointer dereference") +} + // TestOpClientKeccak256MalformedInputs tests the NewDAClient from altda by setting and getting against []byte("") // preimage. It sets the precompute option to false on the NewDAClient. func TestOpClientKeccak256MalformedInputs(t *testing.T) { diff --git a/e2e/server_test.go b/e2e/server_test.go index 136120f..30d16a3 100644 --- a/e2e/server_test.go +++ b/e2e/server_test.go @@ -1,12 +1,13 @@ package e2e_test import ( - "strings" "testing" "time" + "github.com/Layr-Labs/eigenda-proxy/client" "github.com/Layr-Labs/eigenda-proxy/commitments" "github.com/Layr-Labs/eigenda-proxy/store" + "github.com/stretchr/testify/require" "github.com/Layr-Labs/eigenda-proxy/e2e" ) @@ -15,11 +16,6 @@ func useMemory() bool { return !runTestnetIntegrationTests } -func isNilPtrDerefPanic(err string) bool { - return strings.Contains(err, "panic") && strings.Contains(err, "SIGSEGV") && - strings.Contains(err, "nil pointer dereference") -} - func TestOptimismClientWithKeccak256Commitment(t *testing.T) { if !runIntegrationTests && !runTestnetIntegrationTests { t.Skip("Skipping test as INTEGRATION or TESTNET env var not set") @@ -145,12 +141,27 @@ func TestProxyReadFallback(t *testing.T) { testCfg := e2e.TestConfig(useMemory()) testCfg.UseS3Fallback = true // ensure that blob memstore eviction times result in near immediate activation - testCfg.Expiration = time.Nanosecond * 1 + testCfg.Expiration = time.Millisecond * 1 tsConfig := e2e.TestSuiteConfig(testCfg) ts, kill := e2e.CreateTestSuite(tsConfig) defer kill() + cfg := &client.Config{ + URL: ts.Address(), + } + daClient := client.New(cfg) + expectedBlob := e2e.Rand[[]byte](1_000_000) + t.Log("Setting input data on proxy server...") + blobInfo, err := daClient.SetData(ts.Ctx, expectedBlob) + require.NoError(t, err) + + time.Sleep(1 * time.Second) + t.Log("Getting input data from proxy server...") + actualBlob, err := daClient.GetData(ts.Ctx, blobInfo) + require.NoError(t, err) + require.Equal(t, expectedBlob, actualBlob) + requireSimpleClientSetGet(t, ts, e2e.Rand[[]byte](1_000_000)) requireWriteReadSecondary(t, ts.Metrics.SecondaryRequestsTotal, store.S3BackendType) requireDispersalRetrievalEigenDA(t, ts.Metrics.HTTPServerRequestsTotal, commitments.SimpleCommitmentMode) diff --git a/metrics/memory.go b/metrics/memory.go index e6f6ffa..6f6c8b7 100644 --- a/metrics/memory.go +++ b/metrics/memory.go @@ -70,7 +70,7 @@ func (cm *CountMap) Get(labels ...string) (uint64, error) { val, exists := cm.m.Load(key.Hex()) if !exists { - return 0, fmt.Errorf("value doesn't exist") + return 0, fmt.Errorf("value doesn't exist for key %s", key.String()) } uint64Val, ok := val.(uint64) if !ok {