Skip to content

Commit 3588581

Browse files
authored
fix: import and expose the verifier flags (#161)
* fix: import and expose the verifier flags * fix: maxBlobLength flag action was not being run * style: print config on startup
1 parent db9d13b commit 3588581

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

cmd/server/entrypoint.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"encoding/json"
56
"fmt"
67

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

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

3035
daRouter, err := server.LoadStoreRouter(ctx, cfg, log)
3136
if err != nil {

flags/flags.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/Layr-Labs/eigenda-proxy/store/generated_key/memstore"
66
"github.com/Layr-Labs/eigenda-proxy/store/precomputed_key/redis"
77
"github.com/Layr-Labs/eigenda-proxy/store/precomputed_key/s3"
8+
"github.com/Layr-Labs/eigenda-proxy/verify"
89
"github.com/urfave/cli/v2"
910

1011
opservice "github.com/ethereum-optimism/optimism/op-service"
@@ -17,6 +18,7 @@ const (
1718
MemstoreFlagsCategory = "Memstore (replaces EigenDA when enabled)"
1819
RedisCategory = "Redis Cache/Fallback"
1920
S3Category = "S3 Cache/Fallback"
21+
VerifierCategory = "KZG and Cert Verifier"
2022
)
2123

2224
const (
@@ -77,4 +79,5 @@ func init() {
7779
Flags = append(Flags, redis.CLIFlags(EnvVarPrefix, RedisCategory)...)
7880
Flags = append(Flags, s3.CLIFlags(EnvVarPrefix, S3Category)...)
7981
Flags = append(Flags, memstore.CLIFlags(EnvVarPrefix, MemstoreFlagsCategory)...)
82+
Flags = append(Flags, verify.CLIFlags(EnvVarPrefix, VerifierCategory)...)
8083
}

verify/cli.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
109109
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.",
110110
EnvVars: withEnvPrefix(envPrefix, "MAX_BLOB_LENGTH"),
111111
Value: "16MiB",
112+
// set to true to force action to run on the default Value
113+
// see https://github.com/urfave/cli/issues/1973
114+
HasBeenSet: true,
112115
Action: func(_ *cli.Context, maxBlobLengthStr string) error {
113116
// parse the string to a uint64 and set the maxBlobLengthBytes var to be used by ReadConfig()
114117
numBytes, err := utils.ParseBytesAmount(maxBlobLengthStr)

0 commit comments

Comments
 (0)