Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e tests): missing new eigenda-client required config fields #196

Merged
merged 9 commits into from
Oct 31, 2024
6 changes: 1 addition & 5 deletions .github/workflows/holesky-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ name: holesky-test
on:
push:
branches: [ "main" ]
# pull_request_target is needed so that external contributors that create PRs from a forked repo
# have access to the secrets needed to run the tests. There are security implications to this,
# see https://stackoverflow.com/questions/74957218/what-is-the-difference-between-pull-request-and-pull-request-target-event-in-git
# MAKE SURE TO ONLY ALLOW RUNNING THIS WORKFLOW AFTER REVIEWING THE PR!
pull_request_target:
pull_request:
branches: [ "main" ]

jobs:
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"go.testEnvVars": {
"INTEGRATION": "true"
// Only one of INTEGRATION or TESTNET should be true.
"INTEGRATION": "true",
"TESTNET": "false",
// To test against TESTNET, set SIGNER_PRIVATE_KEY and ETHEREUM_RPC.
"SIGNER_PRIVATE_KEY": "",
"ETHEREUM_RPC": "https://ethereum-holesky-rpc.publicnode.com"
},
"go.testFlags": [
"-test.parallel",
Expand Down
3 changes: 3 additions & 0 deletions e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ var (
func ParseEnv() {
runIntegrationTests = os.Getenv("INTEGRATION") == "true" || os.Getenv("INTEGRATION") == "1"
runTestnetIntegrationTests = os.Getenv("TESTNET") == "true" || os.Getenv("TESTNET") == "1"
if runIntegrationTests && runTestnetIntegrationTests {
panic("only one of INTEGRATION=true or TESTNET=true env var can be set")
}
}

// TestMain ... run main controller
Expand Down
5 changes: 4 additions & 1 deletion e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,21 @@ func TestSuiteConfig(testCfg *Cfg) server.CLIConfig {
panic(err)
}

svcManagerAddr := "0xD4A7E1Bd8015057293f0D0A557088c286942e84b" // holesky testnet
eigendaCfg := server.Config{
EdaClientConfig: clients.EigenDAClientConfig{
RPC: holeskyDA,
StatusQueryTimeout: time.Minute * 45,
StatusQueryRetryInterval: pollInterval,
DisableTLS: false,
SignerPrivateKeyHex: pk,
EthRpcUrl: ethRPC,
SvcManagerAddr: svcManagerAddr,
},
VerifierConfig: verify.Config{
VerifyCerts: false,
RPCURL: ethRPC,
SvcManagerAddr: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b", // incompatible with non holeskly networks
SvcManagerAddr: svcManagerAddr,
EthConfirmationDepth: 0,
KzgConfig: &kzg.KzgConfig{
G1Path: "../resources/g1.point",
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ go 1.22
toolchain go1.22.0

require (
github.com/Layr-Labs/eigenda v0.8.5-0.20241028201743-5fe3e910a22d
// TODO: merge https://github.com/Layr-Labs/eigenda/pull/849 first
// and then update this dep to the merged commit.
github.com/Layr-Labs/eigenda v0.8.5-0.20241030205712-b301232f7804
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: adf580f

github.com/consensys/gnark-crypto v0.12.1
github.com/ethereum-optimism/optimism v1.9.4-0.20240927020138-a9c7f349d10b
github.com/ethereum/go-ethereum v1.14.11
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e h1:ZIWapoIRN1VqT8GR8jAwb1Ie9GyehWjVcGh32Y2MznE=
github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/Layr-Labs/eigenda v0.8.5-0.20241028201743-5fe3e910a22d h1:s5U1TaWhC1J2rwc9IQdU/COGvuXALCKMd9GbONUZMxc=
github.com/Layr-Labs/eigenda v0.8.5-0.20241028201743-5fe3e910a22d/go.mod h1:sqUNf9Ak+EfAX82jDxrb4QbT/g3DViWD3b7YIk36skk=
github.com/Layr-Labs/eigenda v0.8.5-0.20241030205712-b301232f7804 h1:QMxICWvIHOfzTGBEATKF/c8EWLcPVl3V2yF/QkN5BK8=
github.com/Layr-Labs/eigenda v0.8.5-0.20241030205712-b301232f7804/go.mod h1:sqUNf9Ak+EfAX82jDxrb4QbT/g3DViWD3b7YIk36skk=
github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240507215523-7e4891d5099a h1:L/UsJFw9M31FD/WgXTPFB0oxbq9Cu4Urea1xWPMQS7Y=
github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240507215523-7e4891d5099a/go.mod h1:OF9lmS/57MKxS0xpSpX0qHZl0SKkDRpvJIvsGvMN1y8=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
Expand Down
5 changes: 3 additions & 2 deletions server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,12 @@ func (svr *Server) handleGetOPGenericCommitment(w http.ResponseWriter, r *http.R
}

func (svr *Server) handleGetShared(ctx context.Context, w http.ResponseWriter, comm []byte, meta commitments.CommitmentMeta) error {
svr.log.Info("Processing GET request", "commitment", hex.EncodeToString(comm), "commitmentMeta", meta)
commitmentHex := hex.EncodeToString(comm)
svr.log.Info("Processing GET request", "commitment", commitmentHex, "commitmentMeta", meta)
input, err := svr.sm.Get(ctx, comm, meta.Mode)
if err != nil {
err = MetaError{
Err: fmt.Errorf("get request failed with commitment %v: %w", comm, err),
Err: fmt.Errorf("get request failed with commitment %v: %w", commitmentHex, err),
Meta: meta,
}
if errors.Is(err, ErrNotFound) {
Expand Down
4 changes: 3 additions & 1 deletion server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

// withMetrics is a middleware that records metrics for the route path.
// It does not write anything to the response, that is the job of the handlers.
func withMetrics(
handleFn func(http.ResponseWriter, *http.Request) error,
m metrics.Metricer,
Expand All @@ -30,9 +31,10 @@ func withMetrics(
}
return err
}
// we assume that every route will set the status header
// TODO: some routes don't have a version byte, such as /put simple commitments
versionByte, err := parseVersionByte(w, r)
if err != nil {
// we assume that every route will set the status header
recordDur(w.Header().Get("status"), string(mode), string(versionByte))
return fmt.Errorf("metrics middleware: error parsing version byte: %w", err)
}
Expand Down
Loading