From cbf53e111392d36d56524315b0d3311afb50c84c Mon Sep 17 00:00:00 2001 From: ethenotethan Date: Mon, 3 Feb 2025 00:33:50 +0700 Subject: [PATCH 1/2] chore: Update compose with secondary store setup && minor refactors (#270) * chore: Update compose with secondary store setup && minor refactors * chore: Minor code comment --- docker-compose.yaml | 76 ++++++++++++++++++++---- scripts/create-test-s3-bucket.sh | 15 +++++ server/load_store.go | 8 ++- store/generated_key/memstore/memstore.go | 3 +- store/manager.go | 2 + store/secondary.go | 9 +-- 6 files changed, 93 insertions(+), 20 deletions(-) create mode 100755 scripts/create-test-s3-bucket.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index 559a0f54..7416ed8f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,22 +1,82 @@ +## The following is a proxy instance +## pointed to redis for storage caching and S3 +## for storage failovers + services: + ## Used as secondary read failover target + minio: + image: minio/minio:latest + container_name: minio + environment: + - MINIO_ROOT_USER=minioadmin + - MINIO_ROOT_PASSWORD=minioadmin + ports: + - "9000:9000" + - "9001:9001" + command: server /data + volumes: + - minio_data:/data + + minio-init: + ## Seed test bucket + image: minio/mc:latest + depends_on: + - minio + entrypoint: ["/bin/sh", "-c", "/usr/bin/create-bucket.sh"] + volumes: + - ./scripts/create-test-s3-bucket.sh:/usr/bin/create-bucket.sh + + redis: + image: redis:latest + container_name: redis + command: redis-server --requirepass redispassword + environment: + - REDIS_PASSWORD=redispassword + ports: + - "6379:6379" + eigenda_proxy: + depends_on: + - minio-init build: context: . dockerfile: Dockerfile container_name: eigenda-proxy environment: + - EIGENDA_PROXY_LOG_LEVEL=debug - EIGENDA_PROXY_ADDR=0.0.0.0 - EIGENDA_PROXY_PORT=4242 - - EIGENDA_PROXY_MEMSTORE_ENABLED=false + ## Turn this off to talk to actual eigenda network + - EIGENDA_PROXY_MEMSTORE_ENABLED=true - EIGENDA_PROXY_MEMSTORE_EXPIRATION=45m - - EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX=$PRIVATE_KEY + - EIGENDA_PROXY_EIGENDA_CERT_VERIFICATION_DISABLED=true + - EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX=${PRIVATE_KEY} - EIGENDA_PROXY_EIGENDA_DISPERSER_RPC=disperser-holesky.eigenda.xyz:443 - EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR=0xD4A7E1Bd8015057293f0D0A557088c286942e84b - - EIGENDA_PROXY_EIGENDA_ETH_RPC=$ETH_RPC + - EIGENDA_PROXY_EIGENDA_ETH_RPC=https://ethereum-holesky-rpc.publicnode.com - EIGENDA_PROXY_EIGENDA_ETH_CONFIRMATION_DEPTH=0 - EIGENDA_PROXY_METRICS_ADDR=0.0.0.0 - EIGENDA_PROXY_METRICS_ENABLED=true - EIGENDA_PROXY_METRICS_PORT=7300 + ## S3 + - EIGENDA_PROXY_S3_CREDENTIAL_TYPE=static + - EIGENDA_PROXY_S3_ACCESS_KEY_ID=minioadmin + - EIGENDA_PROXY_S3_ACCESS_KEY_SECRET=minioadmin + - EIGENDA_PROXY_S3_BUCKET=eigenda-proxy-test + - EIGENDA_PROXY_S3_PATH="" + - EIGENDA_PROXY_S3_ENDPOINT=minio:9000 + - EIGENDA_PROXY_S3_ENABLE_TLS=false + + # Redis Configuration + - EIGENDA_PROXY_REDIS_DB=0 + - EIGENDA_PROXY_REDIS_ENDPOINT=redis:6379 + - EIGENDA_PROXY_REDIS_PASSWORD=redispassword + - EIGENDA_PROXY_REDIS_EVICTION=24h0m0s + + ## Secondary routing + - EIGENDA_PROXY_STORAGE_FALLBACK_TARGETS=s3 + - EIGENDA_PROXY_STORAGE_CACHE_TARGETS=redis + ports: - 4242:4242 - 7300:7300 @@ -44,14 +104,6 @@ services: depends_on: - prometheus - traffic-generator: - image: alpine:latest - build: scripts/ - container_name: traffic_generator - depends_on: - - eigenda_proxy - volumes: - - ./scripts/:/scripts/ - volumes: grafana-data: + minio_data: \ No newline at end of file diff --git a/scripts/create-test-s3-bucket.sh b/scripts/create-test-s3-bucket.sh new file mode 100755 index 00000000..3d850fd7 --- /dev/null +++ b/scripts/create-test-s3-bucket.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Wait 2 seconds to ensure minio is finished bootstrapping +# TODO: Update this to do event based polling on minio server directly vs semi-arbitrary timeout +sleep 2s + +# Configure MinIO client (mc) +echo "Configuring MinIO client..." +mc alias set local http://minio:9000 minioadmin minioadmin + +# Ensure the bucket exists +echo "Creating bucket: eigenda-proxy-test..." +mc mb local/eigenda-proxy-test || echo "Bucket already exists." + +echo "Bucket setup complete." diff --git a/server/load_store.go b/server/load_store.go index cb75a6ae..befe5e0a 100644 --- a/server/load_store.go +++ b/server/load_store.go @@ -121,7 +121,7 @@ func LoadStoreManager(ctx context.Context, cfg CLIConfig, log log.Logger, m metr return nil, err } - // create secondary storage router + // create secondary storage manager fallbacks := populateTargets(cfg.EigenDAConfig.StorageConfig.FallbackTargets, s3Store, redisStore) caches := populateTargets(cfg.EigenDAConfig.StorageConfig.CacheTargets, s3Store, redisStore) secondary := store.NewSecondaryManager(log, m, caches, fallbacks) @@ -135,6 +135,10 @@ func LoadStoreManager(ctx context.Context, cfg CLIConfig, log log.Logger, m metr } } - log.Info("Creating storage router", "eigenda backend type", eigenDA != nil, "s3 backend type", s3Store != nil) + log.Info("Created storage backends", + "eigenda", eigenDA != nil, + "s3", s3Store != nil, + "redis", redisStore != nil, + ) return store.NewManager(eigenDA, s3Store, log, secondary) } diff --git a/store/generated_key/memstore/memstore.go b/store/generated_key/memstore/memstore.go index dce04571..59cf18cb 100644 --- a/store/generated_key/memstore/memstore.go +++ b/store/generated_key/memstore/memstore.go @@ -83,7 +83,6 @@ func (e *MemStore) pruningLoop(ctx context.Context) { return case <-timer.C: - e.l.Debug("pruning expired blobs") e.pruneExpired() } } @@ -99,7 +98,7 @@ func (e *MemStore) pruneExpired() { delete(e.keyStarts, commit) delete(e.store, commit) - e.l.Info("blob pruned", "commit", commit) + e.l.Debug("blob pruned", "commit", commit) } } } diff --git a/store/manager.go b/store/manager.go index 93721d89..fe831f72 100644 --- a/store/manager.go +++ b/store/manager.go @@ -129,11 +129,13 @@ func (m *Manager) Put(ctx context.Context, cm commitments.CommitmentMode, key, v // 2 - Put blob into secondary storage backends if m.secondary.Enabled() && m.secondary.AsyncWriteEntry() { // publish put notification to secondary's subscription on PutNotify topic + m.log.Debug("Publishing data to async secondary stores") m.secondary.Topic() <- PutNotify{ Commitment: commit, Value: value, } } else if m.secondary.Enabled() && !m.secondary.AsyncWriteEntry() { // secondary is available only for synchronous writes + m.log.Debug("Publishing data to single threaded secondary stores") err := m.secondary.HandleRedundantWrites(ctx, commit, value) if err != nil { m.log.Error("Secondary insertions failed", "error", err.Error()) diff --git a/store/secondary.go b/store/secondary.go index 9814095c..82251648 100644 --- a/store/secondary.go +++ b/store/secondary.go @@ -33,7 +33,7 @@ type ISecondary interface { WriteSubscriptionLoop(ctx context.Context) } -// PutNotify ... notification received by primary router to perform insertion across +// PutNotify ... notification received by primary manager to perform insertion across // secondary storage backends type PutNotify struct { Commitment []byte @@ -53,7 +53,7 @@ type SecondaryManager struct { concurrentWrites bool } -// NewSecondaryManager ... creates a new secondary storage router +// NewSecondaryManager ... creates a new secondary storage manager func NewSecondaryManager(log log.Logger, m metrics.Metricer, caches []common.PrecomputedKeyStore, fallbacks []common.PrecomputedKeyStore) ISecondary { return &SecondaryManager{ topic: make(chan PutNotify), // channel is un-buffered which dispersing consumption across routines helps alleviate @@ -92,6 +92,7 @@ func (sm *SecondaryManager) HandleRedundantWrites(ctx context.Context, commitmen successes := 0 for _, src := range sources { + sm.log.Debug("Attempting to write to secondary storage", "backend", src.BackendType()) cb := sm.m.RecordSecondaryRequest(src.BackendType().String(), http.MethodPut) // for added safety - we retry the insertion 5x using a default exponential backoff @@ -115,12 +116,12 @@ func (sm *SecondaryManager) HandleRedundantWrites(ctx context.Context, commitmen return nil } -// AsyncWriteEntry ... subscribes to put notifications posted to shared topic with primary router +// AsyncWriteEntry ... subscribes to put notifications posted to shared topic with primary manager func (sm *SecondaryManager) AsyncWriteEntry() bool { return sm.concurrentWrites } -// WriteSubscriptionLoop ... subscribes to put notifications posted to shared topic with primary router +// WriteSubscriptionLoop ... subscribes to put notifications posted to shared topic with primary manager func (sm *SecondaryManager) WriteSubscriptionLoop(ctx context.Context) { sm.concurrentWrites = true From 147783535bedc117097ddc1c8c1eb7688de29eb6 Mon Sep 17 00:00:00 2001 From: ethenotethan Date: Mon, 3 Feb 2025 05:01:58 +0700 Subject: [PATCH 2/2] chore: Update logging to use `layr-labs/eigensdk-go` (#264) * chore: Update logging to use eigengo-sdk * chore: Update logging to use eigengo-sdk - fmt * chore: Update logging to use eigengo-sdk - incorporate latest eigenda changes, deprecate flags, and update docs / code comments * chore: Update logging to use eigengo-sdk - fix test * chore: Update logging to use eigengo-sdk - svc_binding -> edsm_binding * chore: Update logging to use eigengo-sdk - move logging to own packag e and copy entire dependency package vs hyrbid * chore: Update logging to use eigengo-sdk - rm todo in metrics && fix lint errs * chore: Update logging to use eigengo-sdk - refactor flag construction patterns across subpackages to adhere to uniform abstraction * chore: Update logging to use eigengo-sdk - refactor flag construction patterns across subpackages to adhere to uniform abstraction * chore: Update logging to use eigengo-sdk - update metric * chore: Update logging to use eigengo-sdk - go gfmt * chore: Update logging to use eigengo-sdk - apppease white space linting * chore: Update logging to use eigengo-sdk - white space lint * chore: Update logging to use eigengo-sdk - white space lint --- README.md | 7 +- cmd/server/entrypoint.go | 21 +- common/common.go | 6 + e2e/setup.go | 14 +- flags/flags.go | 41 ++-- go.mod | 20 +- go.sum | 68 +++---- logging/logging.go | 185 ++++++++++++++++++ metrics/cli.go | 83 ++++++++ server/config.go | 10 +- server/handlers_test.go | 18 +- server/load_store.go | 4 +- server/middleware.go | 4 +- server/routing_test.go | 3 +- server/server.go | 6 +- store/generated_key/eigenda/eigenda.go | 6 +- store/generated_key/memstore/memstore.go | 12 +- store/generated_key/memstore/memstore_test.go | 13 +- store/manager.go | 6 +- store/secondary.go | 5 +- verify/cert.go | 19 +- verify/hasher.go | 4 +- verify/hasher_test.go | 4 +- verify/verifier.go | 6 +- 24 files changed, 411 insertions(+), 154 deletions(-) create mode 100644 logging/logging.go create mode 100644 metrics/cli.go diff --git a/README.md b/README.md index 232a44a8..17aaa187 100644 --- a/README.md +++ b/README.md @@ -269,10 +269,9 @@ To quickly set up monitoring dashboard, add eigenda-proxy metrics endpoint to a | `--eigenda.signer-private-key-hex` | | `$EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX` | Hex-encoded signer private key. This key should not be associated with an Ethereum address holding any funds. | | `--eigenda.status-query-retry-interval` | `5s` | `$EIGENDA_PROXY_EIGENDA_STATUS_QUERY_INTERVAL` | Interval between retries when awaiting network blob finalization. Default is 5 seconds. | | `--eigenda.status-query-timeout` | `30m0s` | `$EIGENDA_PROXY_EIGENDA_STATUS_QUERY_TIMEOUT` | Duration to wait for a blob to finalize after being sent for dispersal. Default is 30 minutes. | -| `--log.color` | `false` | `$EIGENDA_PROXY_LOG_COLOR` | Color the log output if in terminal mode. | -| `--log.format` | `text` | `$EIGENDA_PROXY_LOG_FORMAT` | Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty'. | -| `--log.level` | `INFO` | `$EIGENDA_PROXY_LOG_LEVEL` | The lowest log level that will be output. | -| `--log.pid` | `false` | `$EIGENDA_PROXY_LOG_PID` | Show pid in the log. | +| `--log.format` | `text` | `$EIGENDA_PROXY_LOG_FORMAT` | The format of the log file. Accepted options are 'json' and 'text' (default: "json") | +| `--log.level` | `INFO` | `$EIGENDA_PROXY_LOG_LEVEL` | The lowest log level that will be output. The lowest log level that will be output. Accepted options are "debug", "info", "warn" "error" | +| `log.path` | `""` | `$EIGENDA_PROXY_LOG_PATH` | Path to file where logs will be written | | `--memstore.enabled` | `false` | `$EIGENDA_PROXY_MEMSTORE_ENABLED` | Whether to use mem-store for DA logic. | | `--memstore.expiration` | `25m0s` | `$EIGENDA_PROXY_MEMSTORE_EXPIRATION` | Duration that a mem-store blob/commitment pair are allowed to live. | | `--memstore.put-latency` | `0` | `$EIGENDA_PROXY_MEMSTORE_PUT_LATENCY` | Artificial latency added for memstore backend to mimic EigenDA's dispersal latency. | diff --git a/cmd/server/entrypoint.go b/cmd/server/entrypoint.go index 09bfdf6f..123a34cd 100644 --- a/cmd/server/entrypoint.go +++ b/cmd/server/entrypoint.go @@ -5,26 +5,35 @@ import ( "encoding/json" "fmt" + proxy_logging "github.com/Layr-Labs/eigenda-proxy/logging" + "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigenda-proxy/flags" "github.com/Layr-Labs/eigenda-proxy/metrics" "github.com/Layr-Labs/eigenda-proxy/server" - "github.com/ethereum/go-ethereum/log" "github.com/urfave/cli/v2" "github.com/ethereum-optimism/optimism/op-service/ctxinterrupt" - oplog "github.com/ethereum-optimism/optimism/op-service/log" ) func StartProxySvr(cliCtx *cli.Context) error { - log := oplog.NewLogger(oplog.AppOut(cliCtx), oplog.ReadCLIConfig(cliCtx)).New("role", "eigenda_proxy") - oplog.SetGlobalLogHandler(log.Handler()) + logCfg, err := proxy_logging.ReadLoggerCLIConfig(cliCtx) + if err != nil { + return err + } + + log, err := proxy_logging.NewLogger(*logCfg) + if err != nil { + return err + } + log.Info("Starting EigenDA Proxy Server", "version", Version, "date", Date, "commit", Commit) cfg := server.ReadCLIConfig(cliCtx) if err := cfg.Check(); err != nil { return err } - err := prettyPrintConfig(cliCtx, log) + err = prettyPrintConfig(cliCtx, log) if err != nil { return fmt.Errorf("failed to pretty print config: %w", err) } @@ -73,7 +82,7 @@ func StartProxySvr(cliCtx *cli.Context) error { } // TODO: we should probably just change EdaClientConfig struct definition in eigenda-client -func prettyPrintConfig(cliCtx *cli.Context, log log.Logger) error { +func prettyPrintConfig(cliCtx *cli.Context, log logging.Logger) error { // we read a new config which we modify to hide private info in order to log the rest cfg := server.ReadCLIConfig(cliCtx) if cfg.EigenDAConfig.EdaClientConfig.SignerPrivateKeyHex != "" { diff --git a/common/common.go b/common/common.go index 9cafb362..eb650f5b 100644 --- a/common/common.go +++ b/common/common.go @@ -6,6 +6,12 @@ import ( "strings" ) +const GlobalPrefix = "EIGENDA_PROXY" + +func PrefixEnvVar(prefix, suffix string) []string { + return []string{prefix + "_" + suffix} +} + // Helper utility functions // func ContainsDuplicates[P comparable](s []P) bool { diff --git a/e2e/setup.go b/e2e/setup.go index 7ddd5041..5364046d 100644 --- a/e2e/setup.go +++ b/e2e/setup.go @@ -18,14 +18,12 @@ import ( "github.com/Layr-Labs/eigenda-proxy/verify" "github.com/Layr-Labs/eigenda/api/clients" "github.com/Layr-Labs/eigenda/encoding/kzg" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/ethereum/go-ethereum/log" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "golang.org/x/exp/rand" - oplog "github.com/ethereum-optimism/optimism/op-service/log" - opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" - miniotc "github.com/testcontainers/testcontainers-go/modules/minio" redistc "github.com/testcontainers/testcontainers-go/modules/redis" ) @@ -243,7 +241,7 @@ func TestSuiteConfig(testCfg *Cfg) server.CLIConfig { default: cfg = server.CLIConfig{ EigenDAConfig: eigendaCfg, - MetricsCfg: opmetrics.CLIConfig{}, + MetricsCfg: metrics.CLIConfig{}, } } @@ -252,17 +250,13 @@ func TestSuiteConfig(testCfg *Cfg) server.CLIConfig { type TestSuite struct { Ctx context.Context - Log log.Logger + Log logging.Logger Server *server.Server Metrics *metrics.EmulatedMetricer } func CreateTestSuite(testSuiteCfg server.CLIConfig) (TestSuite, func()) { - log := oplog.NewLogger(os.Stdout, oplog.CLIConfig{ - Level: log.LevelDebug, - Format: oplog.FormatLogFmt, - Color: true, - }).New("role", svcName) + log := logging.NewTextSLogger(os.Stdout, &logging.SLoggerOptions{}) m := metrics.NewEmulatedMetricer() ctx := context.Background() diff --git a/flags/flags.go b/flags/flags.go index 103afeab..882366b5 100644 --- a/flags/flags.go +++ b/flags/flags.go @@ -2,20 +2,23 @@ package flags import ( "github.com/Layr-Labs/eigenda-proxy/flags/eigendaflags" + "github.com/Layr-Labs/eigenda-proxy/logging" + "github.com/Layr-Labs/eigenda-proxy/metrics" "github.com/Layr-Labs/eigenda-proxy/store" "github.com/Layr-Labs/eigenda-proxy/store/generated_key/memstore" "github.com/Layr-Labs/eigenda-proxy/store/precomputed_key/redis" "github.com/Layr-Labs/eigenda-proxy/store/precomputed_key/s3" "github.com/Layr-Labs/eigenda-proxy/verify" + "github.com/urfave/cli/v2" - opservice "github.com/ethereum-optimism/optimism/op-service" - oplog "github.com/ethereum-optimism/optimism/op-service/log" - opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" + "github.com/Layr-Labs/eigenda-proxy/common" ) const ( EigenDAClientCategory = "EigenDA Client" + LoggingFlagsCategory = "Logging" + MetricsFlagCategory = "Metrics" EigenDADeprecatedCategory = "DEPRECATED EIGENDA CLIENT FLAGS -- THESE WILL BE REMOVED IN V2.0.0" MemstoreFlagsCategory = "Memstore (for testing purposes - replaces EigenDA backend)" StorageFlagsCategory = "Storage" @@ -31,12 +34,6 @@ const ( PortFlagName = "port" ) -const EnvVarPrefix = "EIGENDA_PROXY" - -func prefixEnvVars(name string) []string { - return opservice.PrefixEnvVar(EnvVarPrefix, name) -} - func CLIFlags() []cli.Flag { // TODO: Decompose all flags into constituent parts based on their respective category / usage flags := []cli.Flag{ @@ -44,13 +41,13 @@ func CLIFlags() []cli.Flag { Name: ListenAddrFlagName, Usage: "Server listening address", Value: "0.0.0.0", - EnvVars: prefixEnvVars("ADDR"), + EnvVars: common.PrefixEnvVar(common.GlobalPrefix, "ADDR"), }, &cli.IntFlag{ Name: PortFlagName, Usage: "Server listening port", Value: 3100, - EnvVars: prefixEnvVars("PORT"), + EnvVars: common.PrefixEnvVar(common.GlobalPrefix, "PORT"), }, } @@ -62,15 +59,15 @@ var Flags = []cli.Flag{} func init() { Flags = CLIFlags() - Flags = append(Flags, oplog.CLIFlags(EnvVarPrefix)...) - Flags = append(Flags, opmetrics.CLIFlags(EnvVarPrefix)...) - Flags = append(Flags, eigendaflags.CLIFlags(EnvVarPrefix, EigenDAClientCategory)...) - Flags = append(Flags, eigendaflags.DeprecatedCLIFlags(EnvVarPrefix, EigenDADeprecatedCategory)...) - Flags = append(Flags, store.CLIFlags(EnvVarPrefix, StorageFlagsCategory)...) - Flags = append(Flags, store.DeprecatedCLIFlags(EnvVarPrefix, StorageDeprecatedCategory)...) - Flags = append(Flags, redis.CLIFlags(EnvVarPrefix, RedisCategory)...) - Flags = append(Flags, s3.CLIFlags(EnvVarPrefix, S3Category)...) - Flags = append(Flags, memstore.CLIFlags(EnvVarPrefix, MemstoreFlagsCategory)...) - Flags = append(Flags, verify.CLIFlags(EnvVarPrefix, VerifierCategory)...) - Flags = append(Flags, verify.DeprecatedCLIFlags(EnvVarPrefix, VerifierDeprecatedCategory)...) + Flags = append(Flags, logging.CLIFlags(common.GlobalPrefix, LoggingFlagsCategory)...) + Flags = append(Flags, metrics.CLIFlags(common.GlobalPrefix, MetricsFlagCategory)...) + Flags = append(Flags, eigendaflags.CLIFlags(common.GlobalPrefix, EigenDAClientCategory)...) + Flags = append(Flags, eigendaflags.DeprecatedCLIFlags(common.GlobalPrefix, EigenDADeprecatedCategory)...) + Flags = append(Flags, store.CLIFlags(common.GlobalPrefix, StorageFlagsCategory)...) + Flags = append(Flags, store.DeprecatedCLIFlags(common.GlobalPrefix, StorageDeprecatedCategory)...) + Flags = append(Flags, redis.CLIFlags(common.GlobalPrefix, RedisCategory)...) + Flags = append(Flags, s3.CLIFlags(common.GlobalPrefix, S3Category)...) + Flags = append(Flags, memstore.CLIFlags(common.GlobalPrefix, MemstoreFlagsCategory)...) + Flags = append(Flags, verify.CLIFlags(common.GlobalPrefix, VerifierCategory)...) + Flags = append(Flags, verify.DeprecatedCLIFlags(common.GlobalPrefix, VerifierDeprecatedCategory)...) } diff --git a/go.mod b/go.mod index c77ad910..92860019 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,9 @@ go 1.22.0 toolchain go1.22.7 require ( - github.com/Layr-Labs/eigenda v0.8.5-rc.0.0.20241101212705-fa8776ae648c + github.com/Layr-Labs/eigenda v0.8.6-rc.0.0.20250130173836-0d293cc03198 github.com/Layr-Labs/eigenda-proxy/client v0.0.0-00010101000000-000000000000 + github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250118004418-2a25f31b3b28 github.com/avast/retry-go/v4 v4.6.0 github.com/consensys/gnark-crypto v0.12.1 github.com/ethereum-optimism/optimism v1.9.5 @@ -21,6 +22,7 @@ require ( github.com/testcontainers/testcontainers-go/modules/minio v0.33.0 github.com/testcontainers/testcontainers-go/modules/redis v0.33.0 github.com/urfave/cli/v2 v2.27.5 + github.com/wealdtech/go-merkletree/v2 v2.6.0 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c google.golang.org/grpc v1.64.1 ) @@ -33,7 +35,8 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e // indirect - github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240507215523-7e4891d5099a // indirect + github.com/Layr-Labs/cerberus-api v0.0.2-0.20250117193600-e69c5e8b08fd // indirect + github.com/Layr-Labs/eigensdk-go/signer v0.0.0-20250118004418-2a25f31b3b28 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/VictoriaMetrics/fastcache v1.12.2 // indirect github.com/andybalholm/brotli v1.1.0 // indirect @@ -63,7 +66,7 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect @@ -129,6 +132,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/graph-gophers/graphql-go v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-bexpr v0.1.11 // indirect github.com/hashicorp/go-hclog v1.6.2 // indirect @@ -148,6 +152,7 @@ require ( github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect + github.com/ingonyama-zk/icicle/v3 v3.4.0 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect github.com/ipfs/go-log/v2 v2.5.1 // indirect @@ -213,7 +218,6 @@ require ( github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect - github.com/pingcap/errors v0.11.4 // indirect github.com/pion/datachannel v1.5.8 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect github.com/pion/ice/v2 v2.3.34 // indirect @@ -242,14 +246,13 @@ require ( github.com/quic-go/webtransport-go v0.8.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.11.0 // indirect github.com/rs/xid v1.6.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect @@ -261,7 +264,6 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/urfave/cli v1.22.14 // indirect - github.com/wealdtech/go-merkletree/v2 v2.6.0 // indirect github.com/wlynxg/anet v0.0.4 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect @@ -271,6 +273,7 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/automaxprocs v1.5.2 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.22.2 // indirect go.uber.org/mock v0.4.0 // indirect @@ -285,7 +288,8 @@ require ( golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.26.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index c6077c9c..f31f1573 100644 --- a/go.sum +++ b/go.sum @@ -22,14 +22,16 @@ 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-rc.0.0.20241101212705-fa8776ae648c h1:TuvZlhWSrwpG6EPl+xjOo5UCp2QcVGl+EOY+BalqOXg= -github.com/Layr-Labs/eigenda v0.8.5-rc.0.0.20241101212705-fa8776ae648c/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/Layr-Labs/cerberus-api v0.0.2-0.20250117193600-e69c5e8b08fd h1:prMzW4BY6KZtWEanf5EIsyHzIZKCNV2mVIXrE6glRRM= +github.com/Layr-Labs/cerberus-api v0.0.2-0.20250117193600-e69c5e8b08fd/go.mod h1:Lm4fhzy0S3P7GjerzuseGaBFVczsIKmEhIjcT52Hluo= +github.com/Layr-Labs/eigenda v0.8.6-rc.0.0.20250130173836-0d293cc03198 h1:mZ6bEyJmE21cBUR6EA+PD3X8kx4ZMIrRauTN9OzVnho= +github.com/Layr-Labs/eigenda v0.8.6-rc.0.0.20250130173836-0d293cc03198/go.mod h1:hdvXBB3dggZnM0xDOnfh9FIUXlmHekPu1Kf7IwdtuUU= +github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250118004418-2a25f31b3b28 h1:Wig5FBBizIB5Z/ZcXJlm7KdOLnrXc6E3DjO63uWRzQM= +github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250118004418-2a25f31b3b28/go.mod h1:YNzORpoebdDNv0sJLm/H9LTx72M85zA54eBSXI5DULw= +github.com/Layr-Labs/eigensdk-go/signer v0.0.0-20250118004418-2a25f31b3b28 h1:rhIC2XpFpCcRkv4QYczIUe/fXvE4T+0B1mF9f6NJCuo= +github.com/Layr-Labs/eigensdk-go/signer v0.0.0-20250118004418-2a25f31b3b28/go.mod h1:auVQv3GD/25A2C/DD0/URyQaUwniQlS2ebEVBsvlDIM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -49,8 +51,6 @@ github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinR github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA= github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE= github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs= @@ -61,34 +61,24 @@ github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.7.12 h1:FMernpdSB00U github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.7.12/go.mod h1:OdtX98GDpp5F3nlogW/WGBTzcgFDTUV22hrLigFQICE= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.13 h1:F+PUZee9mlfpEJVZdgyewRumKekS9O3fftj8fEMt0rQ= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.13/go.mod h1:Rl7i2dEWGHGsBIJCpUxlRt7VwK/HyXxICxdvIRssQHE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.4 h1:SIkD6T4zGQ+1YIit22wi37CGNkrE7mXV1vNA5VpI3TI= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.4/go.mod h1:XfeqbsG0HNedNs0GT+ju4Bs+pFAwsrlzcRdMvdNVf5s= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.0 h1:LtsNRZ6+ZYIbJcPiLHcefXeWkw2DZT9iJyXJJQvhvXw= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.0/go.mod h1:ua1eYOCxAAT0PUY3LAi9bUFuKJHC/iAksBLqR1Et7aU= github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.20.3 h1:KOjg2W7v3tAU8ASDWw26os1OywstODoZdIh9b/Wwlm4= github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.20.3/go.mod h1:fw1lVv+e9z9UIaVsVjBXoC8QxZ+ibOtRtzfELRJZWs8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.6 h1:NkHCgg0Ck86c5PTOzBZ0JRccI51suJDg5lgFtxBu1ek= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.6/go.mod h1:mjTpxjC8v4SeINTngrnKFgm2QUi+Jm+etTbCxh8W4uU= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.5 h1:4vkDuYdXXD2xLgWmNalqH3q4u/d1XnaBMBXdVdZXVp0= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.5/go.mod h1:Ko/RW/qUJyM1rdTzZa74uhE2I0t0VXH0ob/MLcc+q+w= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.4 h1:uDj2K47EM1reAYU9jVlQ1M5YENI1u6a/TxJpf6AeOLA= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.4/go.mod h1:XKCODf4RKHppc96c2EZBGV/oCUC7OClxAo2MEyg4pIk= github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 h1:yl7wcqbisxPzknJVfWTLnK83McUvXba+pz2+tPbIUmQ= github.com/aws/aws-sdk-go-v2/service/kms v1.31.0/go.mod h1:2snWQJQUKsbN66vAawJuOGX7dr37pfOq9hb0tZDGIqQ= -github.com/aws/aws-sdk-go-v2/service/s3 v1.53.0 h1:r3o2YsgW9zRcIP3Q0WCmttFVhTuugeKIvT5z9xDspc0= -github.com/aws/aws-sdk-go-v2/service/s3 v1.53.0/go.mod h1:w2E4f8PUfNtyjfL6Iu+mWI96FGttE03z3UdNcUEC4tA= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.6 h1:TIOEjw0i2yyhmhRry3Oeu9YtiiHWISZ6j/irS1W3gX4= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.6/go.mod h1:3Ba++UwWd154xtP4FRX5pUK3Gt4up5sDHCve6kVfE+g= github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w= @@ -140,8 +130,8 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -183,8 +173,6 @@ github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaD github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= -github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= -github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= @@ -239,8 +227,6 @@ github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5 github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v25.0.3+incompatible h1:KLeNs7zws74oFuVhgZQ5ONGZiXUUdgsdy6/EsX/6284= -github.com/docker/cli v25.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY= github.com/docker/docker v27.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -392,8 +378,6 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20241009165004-a3522334989c h1:NDovD0SMpBYXlE1zJmS1q55vWB/fUQBcPAqAboZSccA= github.com/google/pprof v0.0.0-20241009165004-a3522334989c/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -409,10 +393,9 @@ github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway v1.5.0 h1:WcmKMm43DR7RdtlkEXQJyo5ws8iTp98CyhCCbOHMvNI= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -464,6 +447,8 @@ github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM= github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/ingonyama-zk/icicle/v3 v3.4.0 h1:EV9aa4nsTTVdB/F4xXCMzv1rSp+5rbj6ICI1EFOgK3Q= +github.com/ingonyama-zk/icicle/v3 v3.4.0/go.mod h1:e0JHb27/P6WorCJS3YolbY5XffS4PGBuoW38OthLkDs= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= @@ -681,8 +666,6 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= -github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= -github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -690,8 +673,6 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= -github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= @@ -752,6 +733,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -791,8 +774,8 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= @@ -900,12 +883,6 @@ github.com/wlynxg/anet v0.0.4 h1:0de1OFQxnNqAu+x2FAKKCVIrnfGKQbs7FQz++tB0+Uw= github.com/wlynxg/anet v0.0.4/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1161,11 +1138,10 @@ google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0= -google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= -google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= diff --git a/logging/logging.go b/logging/logging.go new file mode 100644 index 00000000..b75d4cca --- /dev/null +++ b/logging/logging.go @@ -0,0 +1,185 @@ +package logging + +import ( + "fmt" + "io" + "log/slog" + "os" + + "github.com/Layr-Labs/eigenda/common" + "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/urfave/cli/v2" +) + +/* + TODO: https://github.com/Layr-Labs/eigenda-proxy/issues/268 + + This CLI logic is already defined in the eigenda monorepo: + https://github.com/Layr-Labs/eigenda/blob/0d293cc031987c43f653535732c6e1f1fa65a0b2/common/logger_config.go + This regression is due to the fact the proxy leverage urfave/cli/v2 whereas + core eigenda predominantly uses urfave/cli (i.e, v1). + +*/ + +const ( + PathFlagName = "path" + LevelFlagName = "level" + FormatFlagName = "format" + // deprecated + PidFlagName = "pid" + ColorFlagName = "color" + + // Flag + FlagPrefix = "log" +) + +type LogFormat string + +const ( + JSONLogFormat LogFormat = "json" + TextLogFormat LogFormat = "text" +) + +type LoggerConfig struct { + Format LogFormat + OutputWriter io.Writer + HandlerOpts logging.SLoggerOptions +} + +func withEnvPrefix(envPrefix, s string) []string { + return []string{envPrefix + "_LOG_" + s} +} + +func CLIFlags(envPrefix string, category string) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: common.PrefixFlag(FlagPrefix, LevelFlagName), + Category: category, + Usage: `The lowest log level that will be output. Accepted options are "debug", "info", "warn", "error"`, + Value: "info", + EnvVars: withEnvPrefix(envPrefix, "LEVEL"), + }, + &cli.StringFlag{ + Name: common.PrefixFlag(FlagPrefix, PathFlagName), + Category: category, + Usage: "Path to file where logs will be written", + Value: "", + EnvVars: withEnvPrefix(envPrefix, "PATH"), + }, + &cli.StringFlag{ + Name: common.PrefixFlag(FlagPrefix, FormatFlagName), + Category: category, + Usage: "The format of the log file. Accepted options are 'json' and 'text'", + Value: "text", + EnvVars: withEnvPrefix(envPrefix, "FORMAT"), + }, + // Deprecated since used by op-service logging which has been replaced + // by eigengo-sdk logger + &cli.BoolFlag{ + Name: common.PrefixFlag(FlagPrefix, PidFlagName), + Category: category, + Usage: "Show pid in the log", + EnvVars: withEnvPrefix(envPrefix, "PID"), + Hidden: true, + Action: func(_ *cli.Context, _ bool) error { + return fmt.Errorf("flag --%s is deprecated", PidFlagName) + }, + }, + &cli.BoolFlag{ + Name: common.PrefixFlag(FlagPrefix, ColorFlagName), + Category: category, + Usage: "Color the log output if in terminal mode", + EnvVars: []string{common.PrefixEnvVar(envPrefix, "LOG_COLOR")}, + Hidden: true, + Action: func(_ *cli.Context, _ bool) error { + return fmt.Errorf("flag --%s is deprecated", ColorFlagName) + }, + }, + } +} + +// DefaultLoggerConfig returns a LoggerConfig with the default settings for a JSON logger. +// In general, this should be the baseline config for most services running in production. +func DefaultLoggerConfig() LoggerConfig { + return LoggerConfig{ + Format: JSONLogFormat, + OutputWriter: os.Stdout, + HandlerOpts: logging.SLoggerOptions{ + AddSource: true, + Level: slog.LevelDebug, + NoColor: true, + }, + } +} + +// DefaultTextLoggerConfig returns a LoggerConfig with the default settings for a text logger. +// For use in tests or other scenarios where the logs are consumed by humans. +func DefaultTextLoggerConfig() LoggerConfig { + return LoggerConfig{ + Format: TextLogFormat, + OutputWriter: os.Stdout, + HandlerOpts: logging.SLoggerOptions{ + AddSource: true, + Level: slog.LevelDebug, + NoColor: true, // color is nice in the console, but not nice when written to a file + }, + } +} + +// DefaultConsoleLoggerConfig returns a LoggerConfig with the default settings +// for logging to a console (i.e. with human eyeballs). Adds color, and so should +// not be used when logs are captured in a file. +func DefaultConsoleLoggerConfig() LoggerConfig { + return LoggerConfig{ + Format: TextLogFormat, + OutputWriter: os.Stdout, + HandlerOpts: logging.SLoggerOptions{ + AddSource: true, + Level: slog.LevelDebug, + NoColor: false, + }, + } +} + +func ReadLoggerCLIConfig(ctx *cli.Context) (*LoggerConfig, error) { + cfg := DefaultLoggerConfig() + format := ctx.String(common.PrefixFlag(FlagPrefix, FormatFlagName)) + switch format { + case "json": + cfg.Format = JSONLogFormat + + case "text": + cfg.Format = TextLogFormat + + default: + return nil, fmt.Errorf("invalid log file format %s", format) + } + + path := ctx.String(common.PrefixFlag(FlagPrefix, PathFlagName)) + if path != "" { + f, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644) + if err != nil { + return nil, err + } + cfg.OutputWriter = io.MultiWriter(os.Stdout, f) + } + logLevel := ctx.String(common.PrefixFlag(FlagPrefix, LevelFlagName)) + var level slog.Level + err := level.UnmarshalText([]byte(logLevel)) + if err != nil { + panic("failed to parse log level " + logLevel) + } + cfg.HandlerOpts.Level = level + + return &cfg, nil +} + +func NewLogger(cfg LoggerConfig) (logging.Logger, error) { + if cfg.Format == JSONLogFormat { + return logging.NewJsonSLogger(cfg.OutputWriter, &cfg.HandlerOpts), nil + } + if cfg.Format == TextLogFormat { + return logging.NewTextSLogger(cfg.OutputWriter, &cfg.HandlerOpts), nil + } + return nil, fmt.Errorf("unknown log format: %s", cfg.Format) +} diff --git a/metrics/cli.go b/metrics/cli.go new file mode 100644 index 00000000..58b7e939 --- /dev/null +++ b/metrics/cli.go @@ -0,0 +1,83 @@ +package metrics + +import ( + "errors" + "math" + + "github.com/urfave/cli/v2" +) + +const ( + EnabledFlagName = "metrics.enabled" + ListenAddrFlagName = "metrics.addr" + PortFlagName = "metrics.port" + defaultListenAddr = "0.0.0.0" + defaultListenPort = 7300 + + EnvPrefix = "metrics" +) + +var ErrInvalidPort = errors.New("invalid metrics port") + +func withEnvPrefix(envPrefix, s string) []string { + return []string{envPrefix + "_METRICS_" + s} +} + +func DefaultCLIConfig() CLIConfig { + return CLIConfig{ + Enabled: false, + ListenAddr: defaultListenAddr, + ListenPort: defaultListenPort, + } +} + +func CLIFlags(envPrefix string, category string) []cli.Flag { + return []cli.Flag{ + &cli.BoolFlag{ + Name: EnabledFlagName, + Usage: "Enable the metrics server", + Category: category, + EnvVars: withEnvPrefix(envPrefix, "ENABLED"), + }, + &cli.StringFlag{ + Name: ListenAddrFlagName, + Usage: "Metrics listening address", + Category: category, + Value: defaultListenAddr, + EnvVars: withEnvPrefix(envPrefix, "ADDR"), + }, + &cli.IntFlag{ + Name: PortFlagName, + Usage: "Metrics listening port", + Category: category, + Value: defaultListenPort, + EnvVars: withEnvPrefix(envPrefix, "PORT"), + }, + } +} + +type CLIConfig struct { + Enabled bool + ListenAddr string + ListenPort int +} + +func (m CLIConfig) Check() error { + if !m.Enabled { + return nil + } + + if m.ListenPort < 0 || m.ListenPort > math.MaxUint16 { + return ErrInvalidPort + } + + return nil +} + +func ReadCLIConfig(ctx *cli.Context) CLIConfig { + return CLIConfig{ + Enabled: ctx.Bool(EnabledFlagName), + ListenAddr: ctx.String(ListenAddrFlagName), + ListenPort: ctx.Int(PortFlagName), + } +} diff --git a/server/config.go b/server/config.go index 7ed2e93b..161d5521 100644 --- a/server/config.go +++ b/server/config.go @@ -6,12 +6,11 @@ import ( "github.com/urfave/cli/v2" "github.com/Layr-Labs/eigenda-proxy/flags/eigendaflags" + "github.com/Layr-Labs/eigenda-proxy/metrics" "github.com/Layr-Labs/eigenda-proxy/store" "github.com/Layr-Labs/eigenda-proxy/store/generated_key/memstore" "github.com/Layr-Labs/eigenda-proxy/verify" "github.com/Layr-Labs/eigenda/api/clients" - - opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" ) type Config struct { @@ -80,14 +79,13 @@ func (cfg *Config) Check() error { type CLIConfig struct { EigenDAConfig Config - MetricsCfg opmetrics.CLIConfig + MetricsCfg metrics.CLIConfig } func ReadCLIConfig(ctx *cli.Context) CLIConfig { - config := ReadConfig(ctx) return CLIConfig{ - EigenDAConfig: config, - MetricsCfg: opmetrics.ReadCLIConfig(ctx), + EigenDAConfig: ReadConfig(ctx), + MetricsCfg: metrics.ReadCLIConfig(ctx), } } diff --git a/server/handlers_test.go b/server/handlers_test.go index 4385da28..3ebc8f4a 100644 --- a/server/handlers_test.go +++ b/server/handlers_test.go @@ -16,7 +16,7 @@ import ( "github.com/Layr-Labs/eigenda-proxy/metrics" "github.com/Layr-Labs/eigenda-proxy/mocks" "github.com/Layr-Labs/eigenda/api" - "github.com/ethereum/go-ethereum/log" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/golang/mock/gomock" "github.com/gorilla/mux" "github.com/stretchr/testify/require" @@ -24,6 +24,10 @@ import ( "google.golang.org/grpc/status" ) +var ( + testLogger = logging.NewTextSLogger(os.Stdout, &logging.SLoggerOptions{}) +) + const ( stdCommitmentPrefix = "\x00" @@ -94,9 +98,7 @@ func TestHandlerGet(t *testing.T) { // we need to create a router through which we can pass the request. r := mux.NewRouter() // enable this logger to help debug tests - // logger := log.NewLogger(log.NewTerminalHandler(os.Stderr, true)).With("test_name", t.Name()) - noopLogger := log.NewLogger(log.DiscardHandler()) - server := NewServer("localhost", 0, mockStorageMgr, noopLogger, metrics.NoopMetrics) + server := NewServer("localhost", 0, mockStorageMgr, testLogger, metrics.NoopMetrics) server.registerRoutes(r) r.ServeHTTP(rec, req) @@ -167,9 +169,7 @@ func TestHandlerPutSuccess(t *testing.T) { // we need to create a router through which we can pass the request. r := mux.NewRouter() // enable this logger to help debug tests - // logger := log.NewLogger(log.NewTerminalHandler(os.Stderr, true)).With("test_name", t.Name()) - noopLogger := log.NewLogger(log.DiscardHandler()) - server := NewServer("localhost", 0, mockStorageMgr, noopLogger, metrics.NoopMetrics) + server := NewServer("localhost", 0, mockStorageMgr, testLogger, metrics.NoopMetrics) server.registerRoutes(r) r.ServeHTTP(rec, req) @@ -254,9 +254,7 @@ func TestHandlerPutErrors(t *testing.T) { // we need to create a router through which we can pass the request. r := mux.NewRouter() // enable this logger to help debug tests - logger := log.NewLogger(log.NewTerminalHandler(os.Stdout, true)).With("test_name", t.Name()) - // noopLogger := log.NewLogger(log.DiscardHandler()) - server := NewServer("localhost", 0, mockStorageMgr, logger, metrics.NoopMetrics) + server := NewServer("localhost", 0, mockStorageMgr, testLogger, metrics.NoopMetrics) server.registerRoutes(r) r.ServeHTTP(rec, req) diff --git a/server/load_store.go b/server/load_store.go index befe5e0a..5f67e0b0 100644 --- a/server/load_store.go +++ b/server/load_store.go @@ -13,7 +13,7 @@ import ( "github.com/Layr-Labs/eigenda-proxy/store/precomputed_key/s3" "github.com/Layr-Labs/eigenda-proxy/verify" "github.com/Layr-Labs/eigenda/api/clients" - "github.com/ethereum/go-ethereum/log" + "github.com/Layr-Labs/eigensdk-go/logging" ) // TODO - create structured abstraction for dependency injection vs. overloading stateless functions @@ -53,7 +53,7 @@ func populateTargets(targets []string, s3 common.PrecomputedKeyStore, redis *red } // LoadStoreManager ... creates storage backend clients and instruments them into a storage routing abstraction -func LoadStoreManager(ctx context.Context, cfg CLIConfig, log log.Logger, m metrics.Metricer) (store.IManager, error) { +func LoadStoreManager(ctx context.Context, cfg CLIConfig, log logging.Logger, m metrics.Metricer) (store.IManager, error) { // create S3 backend store (if enabled) var err error var s3Store *s3.Store diff --git a/server/middleware.go b/server/middleware.go index 68ffdc84..b36336b8 100644 --- a/server/middleware.go +++ b/server/middleware.go @@ -9,7 +9,7 @@ import ( "github.com/Layr-Labs/eigenda-proxy/commitments" "github.com/Layr-Labs/eigenda-proxy/metrics" - "github.com/ethereum/go-ethereum/log" + "github.com/Layr-Labs/eigensdk-go/logging" ) // Used to capture the status code of the response, so that we can use it in middlewares. @@ -75,7 +75,7 @@ func withMetrics( // TODO: implement a ResponseWriter wrapper that saves the status code: see https://github.com/golang/go/issues/18997 func withLogging( handleFn func(http.ResponseWriter, *http.Request) error, - log log.Logger, + log logging.Logger, ) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { start := time.Now() diff --git a/server/routing_test.go b/server/routing_test.go index 2d4c6a3d..2e6cde88 100644 --- a/server/routing_test.go +++ b/server/routing_test.go @@ -8,7 +8,6 @@ import ( "github.com/Layr-Labs/eigenda-proxy/metrics" "github.com/Layr-Labs/eigenda-proxy/mocks" - "github.com/ethereum/go-ethereum/log" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) @@ -21,7 +20,7 @@ func TestRouting(t *testing.T) { mockRouter := mocks.NewMockIManager(ctrl) m := metrics.NewMetrics("default") - server := NewServer("localhost", 8080, mockRouter, log.New(), m) + server := NewServer("localhost", 8080, mockRouter, testLogger, m) err := server.Start() require.NoError(t, err) diff --git a/server/server.go b/server/server.go index 10b7e073..cea12ba5 100644 --- a/server/server.go +++ b/server/server.go @@ -13,7 +13,7 @@ import ( "github.com/Layr-Labs/eigenda-proxy/commitments" "github.com/Layr-Labs/eigenda-proxy/metrics" "github.com/Layr-Labs/eigenda-proxy/store" - "github.com/ethereum/go-ethereum/log" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/gorilla/mux" ) @@ -28,7 +28,7 @@ const ( ) type Server struct { - log log.Logger + log logging.Logger endpoint string sm store.IManager m metrics.Metricer @@ -36,7 +36,7 @@ type Server struct { listener net.Listener } -func NewServer(host string, port int, sm store.IManager, log log.Logger, +func NewServer(host string, port int, sm store.IManager, log logging.Logger, m metrics.Metricer) *Server { endpoint := net.JoinHostPort(host, strconv.Itoa(port)) return &Server{ diff --git a/store/generated_key/eigenda/eigenda.go b/store/generated_key/eigenda/eigenda.go index 9ff5c9bb..bb535e92 100644 --- a/store/generated_key/eigenda/eigenda.go +++ b/store/generated_key/eigenda/eigenda.go @@ -9,9 +9,9 @@ import ( "github.com/Layr-Labs/eigenda-proxy/verify" "github.com/Layr-Labs/eigenda/api/clients" "github.com/Layr-Labs/eigenda/api/grpc/disperser" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/avast/retry-go/v4" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -35,13 +35,13 @@ type Store struct { client *clients.EigenDAClient verifier *verify.Verifier cfg *StoreConfig - log log.Logger + log logging.Logger } var _ common.GeneratedKeyStore = (*Store)(nil) func NewStore(client *clients.EigenDAClient, - v *verify.Verifier, log log.Logger, cfg *StoreConfig) (*Store, error) { + v *verify.Verifier, log logging.Logger, cfg *StoreConfig) (*Store, error) { return &Store{ client: client, verifier: v, diff --git a/store/generated_key/memstore/memstore.go b/store/generated_key/memstore/memstore.go index 59cf18cb..9b1c7f6b 100644 --- a/store/generated_key/memstore/memstore.go +++ b/store/generated_key/memstore/memstore.go @@ -8,7 +8,6 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/Layr-Labs/eigenda-proxy/common" @@ -16,6 +15,7 @@ import ( "github.com/Layr-Labs/eigenda/api/clients/codecs" eigenda_common "github.com/Layr-Labs/eigenda/api/grpc/common" "github.com/Layr-Labs/eigenda/api/grpc/disperser" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/ethereum/go-ethereum/crypto" ) @@ -41,7 +41,7 @@ type MemStore struct { sync.RWMutex config Config - l log.Logger + log logging.Logger keyStarts map[string]time.Time store map[string][]byte verifier *verify.Verifier @@ -54,10 +54,10 @@ var _ common.GeneratedKeyStore = (*MemStore)(nil) // New ... constructor func New( - ctx context.Context, verifier *verify.Verifier, l log.Logger, config Config, + ctx context.Context, verifier *verify.Verifier, log logging.Logger, config Config, ) (*MemStore, error) { store := &MemStore{ - l: l, + log: log, config: config, keyStarts: make(map[string]time.Time), store: make(map[string][]byte), @@ -66,7 +66,7 @@ func New( } if store.config.BlobExpiration != 0 { - l.Info("memstore expiration enabled", "time", store.config.BlobExpiration) + log.Info("memstore expiration enabled", "time", store.config.BlobExpiration) go store.pruningLoop(ctx) } @@ -98,7 +98,7 @@ func (e *MemStore) pruneExpired() { delete(e.keyStarts, commit) delete(e.store, commit) - e.l.Debug("blob pruned", "commit", commit) + e.log.Debug("blob pruned", "commit", commit) } } } diff --git a/store/generated_key/memstore/memstore_test.go b/store/generated_key/memstore/memstore_test.go index a8030515..b344d9a4 100644 --- a/store/generated_key/memstore/memstore_test.go +++ b/store/generated_key/memstore/memstore_test.go @@ -2,16 +2,21 @@ package memstore import ( "context" + "os" "runtime" "testing" "time" "github.com/Layr-Labs/eigenda-proxy/verify" "github.com/Layr-Labs/eigenda/encoding/kzg" - "github.com/ethereum/go-ethereum/log" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/stretchr/testify/require" ) +var ( + testLogger = logging.NewTextSLogger(os.Stdout, &logging.SLoggerOptions{}) +) + const ( testPreimage = "Four score and seven years ago" ) @@ -49,7 +54,7 @@ func TestGetSet(t *testing.T) { ms, err := New( ctx, verifier, - log.New(), + testLogger, getDefaultMemStoreTestConfig(), ) @@ -78,7 +83,7 @@ func TestExpiration(t *testing.T) { ms, err := New( ctx, verifier, - log.New(), + testLogger, memstoreConfig, ) @@ -111,7 +116,7 @@ func TestLatency(t *testing.T) { config := getDefaultMemStoreTestConfig() config.PutLatency = putLatency config.GetLatency = getLatency - ms, err := New(ctx, verifier, log.New(), config) + ms, err := New(ctx, verifier, testLogger, config) require.NoError(t, err) diff --git a/store/manager.go b/store/manager.go index fe831f72..612bb769 100644 --- a/store/manager.go +++ b/store/manager.go @@ -9,7 +9,7 @@ import ( "github.com/Layr-Labs/eigenda-proxy/commitments" "github.com/Layr-Labs/eigenda-proxy/common" - "github.com/ethereum/go-ethereum/log" + "github.com/Layr-Labs/eigensdk-go/logging" ) // IManager ... read/write interface @@ -20,7 +20,7 @@ type IManager interface { // Manager ... storage backend routing layer type Manager struct { - log log.Logger + log logging.Logger // primary storage backends eigenda common.GeneratedKeyStore // ALT DA commitment type for OP mode && std commitment mode for standard /client s3 common.PrecomputedKeyStore // OP commitment mode && keccak256 commitment type @@ -30,7 +30,7 @@ type Manager struct { } // NewManager ... Init -func NewManager(eigenda common.GeneratedKeyStore, s3 common.PrecomputedKeyStore, l log.Logger, +func NewManager(eigenda common.GeneratedKeyStore, s3 common.PrecomputedKeyStore, l logging.Logger, secondary ISecondary) (IManager, error) { return &Manager{ log: l, diff --git a/store/secondary.go b/store/secondary.go index 82251648..23a086df 100644 --- a/store/secondary.go +++ b/store/secondary.go @@ -8,6 +8,7 @@ import ( "github.com/Layr-Labs/eigenda-proxy/common" "github.com/Layr-Labs/eigenda-proxy/metrics" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/ethereum-optimism/optimism/op-service/retry" "github.com/ethereum/go-ethereum/crypto" @@ -42,7 +43,7 @@ type PutNotify struct { // SecondaryManager ... routing abstraction for secondary storage backends type SecondaryManager struct { - log log.Logger + log logging.Logger m metrics.Metricer caches []common.PrecomputedKeyStore @@ -54,7 +55,7 @@ type SecondaryManager struct { } // NewSecondaryManager ... creates a new secondary storage manager -func NewSecondaryManager(log log.Logger, m metrics.Metricer, caches []common.PrecomputedKeyStore, fallbacks []common.PrecomputedKeyStore) ISecondary { +func NewSecondaryManager(log logging.Logger, m metrics.Metricer, caches []common.PrecomputedKeyStore, fallbacks []common.PrecomputedKeyStore) ISecondary { return &SecondaryManager{ topic: make(chan PutNotify), // channel is un-buffered which dispersing consumption across routines helps alleviate log: log, diff --git a/verify/cert.go b/verify/cert.go index fca193e3..ce812518 100644 --- a/verify/cert.go +++ b/verify/cert.go @@ -10,28 +10,29 @@ import ( "github.com/Layr-Labs/eigenda-proxy/common/consts" "github.com/Layr-Labs/eigenda/api/grpc/disperser" - binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDAServiceManager" + binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDACertVerifier" + edsm_binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDAServiceManager" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/ethereum-optimism/optimism/op-service/retry" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" "golang.org/x/exp/slices" ) // CertVerifier verifies the DA certificate against on-chain EigenDA contracts // to ensure disperser returned fields haven't been tampered with type CertVerifier struct { - l log.Logger + log logging.Logger // ethConfirmationDepth is used to verify that a blob's batch commitment has been bridged to the EigenDAServiceManager contract at least // this many blocks in the past. To do so we make an eth_call to the contract at the current block_number - ethConfirmationDepth. // Hence in order to not require an archive node, this value should be kept low. We force it to be < 64 (consts.EthHappyPathFinalizationDepthBlocks). // waitForFinalization should be used instead of ethConfirmationDepth if the user wants to wait for finality (typically 64 blocks in happy case). ethConfirmationDepth uint64 waitForFinalization bool - manager *binding.ContractEigenDAServiceManagerCaller + manager *edsm_binding.ContractEigenDAServiceManagerCaller ethClient *ethclient.Client // The two fields below are fetched from the EigenDAServiceManager contract in the constructor. // They are used to verify the quorums in the received certificates. @@ -40,7 +41,7 @@ type CertVerifier struct { quorumAdversaryThresholds map[uint8]uint8 } -func NewCertVerifier(cfg *Config, l log.Logger) (*CertVerifier, error) { +func NewCertVerifier(cfg *Config, log logging.Logger) (*CertVerifier, error) { if cfg.EthConfirmationDepth >= uint64(consts.EthHappyPathFinalizationDepthBlocks) { // We keep this low (<128) to avoid requiring an archive node. return nil, fmt.Errorf("confirmation depth must be less than 64; consider using cfg.WaitForFinalization=true instead") @@ -53,7 +54,7 @@ func NewCertVerifier(cfg *Config, l log.Logger) (*CertVerifier, error) { } // construct caller binding - m, err := binding.NewContractEigenDAServiceManagerCaller(common.HexToAddress(cfg.SvcManagerAddr), client) + m, err := edsm_binding.NewContractEigenDAServiceManagerCaller(common.HexToAddress(cfg.SvcManagerAddr), client) if err != nil { return nil, err } @@ -64,7 +65,7 @@ func NewCertVerifier(cfg *Config, l log.Logger) (*CertVerifier, error) { } return &CertVerifier{ - l: l, + log: log, manager: m, ethConfirmationDepth: cfg.EthConfirmationDepth, ethClient: client, @@ -106,7 +107,7 @@ func (cv *CertVerifier) verifyBatchConfirmedOnChain( } // 2. Compute the hash of the batch metadata received as argument. - header := &binding.IEigenDAServiceManagerBatchHeader{ + header := &binding.BatchHeader{ BlobHeadersRoot: [32]byte(batchMetadata.GetBatchHeader().GetBatchRoot()), QuorumNumbers: batchMetadata.GetBatchHeader().GetQuorumNumbers(), ReferenceBlockNumber: batchMetadata.GetBatchHeader().GetReferenceBlockNumber(), @@ -198,7 +199,7 @@ func (cv *CertVerifier) retrieveBatchMetadataHash(ctx context.Context, batchID u // This in turn required rollup validators running this proxy to have an archive node, in case the RBN was >128 blocks in the past, // which was not ideal. So we decided to make these parameters immutable, and cache them here. func getQuorumParametersAtLatestBlock( - manager *binding.ContractEigenDAServiceManagerCaller, + manager *edsm_binding.ContractEigenDAServiceManagerCaller, ) ([]uint8, map[uint8]uint8, error) { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() diff --git a/verify/hasher.go b/verify/hasher.go index 63bd9ed6..a4c00c80 100644 --- a/verify/hasher.go +++ b/verify/hasher.go @@ -3,7 +3,7 @@ package verify import ( "encoding/binary" - binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDAServiceManager" + binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDACertVerifier" "github.com/ethereum/go-ethereum/accounts/abi" geth_common "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -11,7 +11,7 @@ import ( // HashBatchMetadata regenerates a batch data hash // replicates: https://github.com/Layr-Labs/eigenda-utils/blob/c4cbc9ec078aeca3e4a04bd278e2fb136bf3e6de/src/libraries/EigenDAHasher.sol#L46-L54 -func HashBatchMetadata(bh *binding.IEigenDAServiceManagerBatchHeader, sigHash [32]byte, blockNum uint32) (geth_common.Hash, error) { +func HashBatchMetadata(bh *binding.BatchHeader, sigHash [32]byte, blockNum uint32) (geth_common.Hash, error) { batchHeaderType, err := abi.NewType("tuple", "", []abi.ArgumentMarshaling{ { Name: "blobHeadersRoot", diff --git a/verify/hasher_test.go b/verify/hasher_test.go index 3c1c1b5b..ff820ef5 100644 --- a/verify/hasher_test.go +++ b/verify/hasher_test.go @@ -6,7 +6,7 @@ import ( eigenda_common "github.com/Layr-Labs/eigenda/api/grpc/common" "github.com/Layr-Labs/eigenda/api/grpc/disperser" - binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDAServiceManager" + binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDACertVerifier" "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" ) @@ -46,7 +46,7 @@ func TestHashBatchHashedMetadata(t *testing.T) { func TestHashBatchMetadata(t *testing.T) { testHash := crypto.Keccak256Hash([]byte("batchHeader")) - header := &binding.IEigenDAServiceManagerBatchHeader{ + header := &binding.BatchHeader{ BlobHeadersRoot: testHash, QuorumNumbers: testHash.Bytes(), SignedStakeForQuorums: testHash.Bytes(), diff --git a/verify/verifier.go b/verify/verifier.go index e784731b..d6810ffd 100644 --- a/verify/verifier.go +++ b/verify/verifier.go @@ -6,6 +6,7 @@ import ( "fmt" "strings" + "github.com/Layr-Labs/eigensdk-go/logging" "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" @@ -13,6 +14,7 @@ import ( "github.com/Layr-Labs/eigenda/api/grpc/common" "github.com/Layr-Labs/eigenda/api/grpc/disperser" + "github.com/Layr-Labs/eigenda/encoding" "github.com/Layr-Labs/eigenda/encoding/kzg" kzgverifier "github.com/Layr-Labs/eigenda/encoding/kzg/verifier" "github.com/Layr-Labs/eigenda/encoding/rs" @@ -54,7 +56,7 @@ type Verifier struct { holesky bool } -func NewVerifier(cfg *Config, l log.Logger) (*Verifier, error) { +func NewVerifier(cfg *Config, l logging.Logger) (*Verifier, error) { var cv *CertVerifier var err error @@ -65,7 +67,7 @@ func NewVerifier(cfg *Config, l log.Logger) (*Verifier, error) { } } - kzgVerifier, err := kzgverifier.NewVerifier(cfg.KzgConfig, false) + kzgVerifier, err := kzgverifier.NewVerifier(cfg.KzgConfig, encoding.DefaultConfig()) if err != nil { return nil, fmt.Errorf("failed to create kzg verifier: %w", err) }