Skip to content

Commit

Permalink
fix: import and expose the verifier flags (#161)
Browse files Browse the repository at this point in the history
* fix: import and expose the verifier flags

* fix: maxBlobLength flag action was not being run

* style: print config on startup
  • Loading branch information
samlaf authored Sep 29, 2024
1 parent db9d13b commit 3588581
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/server/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"encoding/json"
"fmt"

"github.com/Layr-Labs/eigenda-proxy/flags"
Expand All @@ -25,7 +26,11 @@ func StartProxySvr(cliCtx *cli.Context) error {
ctx, ctxCancel := context.WithCancel(cliCtx.Context)
defer ctxCancel()

log.Info("Initializing EigenDA proxy server...")
configJSON, err := json.MarshalIndent(cfg, "", " ")
if err != nil {
return fmt.Errorf("failed to marshal config: %w", err)
}
log.Info(fmt.Sprintf("Initializing EigenDA proxy server with config: %v", string(configJSON)))

daRouter, err := server.LoadStoreRouter(ctx, cfg, log)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"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"
Expand All @@ -17,6 +18,7 @@ const (
MemstoreFlagsCategory = "Memstore (replaces EigenDA when enabled)"
RedisCategory = "Redis Cache/Fallback"
S3Category = "S3 Cache/Fallback"
VerifierCategory = "KZG and Cert Verifier"
)

const (
Expand Down Expand Up @@ -77,4 +79,5 @@ func init() {
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)...)
}
3 changes: 3 additions & 0 deletions verify/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
Usage: "Maximum blob length to be written or read from EigenDA. Determines the number of SRS points loaded into memory for KZG commitments. Example units: '30MiB', '4Kb', '30MB'. Maximum size slightly exceeds 1GB.",
EnvVars: withEnvPrefix(envPrefix, "MAX_BLOB_LENGTH"),
Value: "16MiB",
// set to true to force action to run on the default Value
// see https://github.com/urfave/cli/issues/1973
HasBeenSet: true,
Action: func(_ *cli.Context, maxBlobLengthStr string) error {
// parse the string to a uint64 and set the maxBlobLengthBytes var to be used by ReadConfig()
numBytes, err := utils.ParseBytesAmount(maxBlobLengthStr)
Expand Down

0 comments on commit 3588581

Please sign in to comment.