From 3a6f3fbd9f7ce92bbfe3b98871724bc7b3829a94 Mon Sep 17 00:00:00 2001 From: Ethen Pociask Date: Tue, 29 Oct 2024 02:46:08 -0400 Subject: [PATCH] fix(#191): Routing namespace --> Storage - pr feedback --- README.md | 6 +++--- flags/eigendaflags/deprecated.go | 22 +++++++++++----------- store/cli.go | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index af655bee..6a679a93 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,9 @@ In order to disperse to the EigenDA network in production, or at high throughput | `--s3.path` | | `$EIGENDA_PROXY_S3_PATH` | Bucket path for S3 storage. | | `--s3.endpoint` | | `$EIGENDA_PROXY_S3_ENDPOINT` | Endpoint for S3 storage. | | `--s3.enable-tls` | | `$EIGENDA_PROXY_S3_ENABLE_TLS` | Enable TLS connection to S3 endpoint. | -| `--store.fallback-targets` | `[]` | `$EIGENDA_PROXY_FALLBACK_TARGETS` | Fall back backend targets. Supports S3. | Backup storage locations to read from in the event of eigenda retrieval failure. | -| `--store.cache-targets` | `[]` | `$EIGENDA_PROXY_CACHE_TARGETS` | Caching targets. Supports S3. | Caches data to backend targets after dispersing to DA, retrieved from before trying read from EigenDA. | -| `--store.concurrent-write-threads` | `0` | `$EIGENDA_PROXY_CONCURRENT_WRITE_THREADS` | Number of threads spun-up for async secondary storage insertions. (<=0) denotes single threaded insertions where (>0) indicates decoupled writes. | +| `--storage.fallback-targets` | `[]` | `$EIGENDA_PROXY_STORAGE_FALLBACK_TARGETS` | Fall back backend targets. Supports S3. | Backup storage locations to read from in the event of eigenda retrieval failure. | +| `--storage.cache-targets` | `[]` | `$EIGENDA_PROXY_STORAGE_CACHE_TARGETS` | Caching targets. Supports S3. | Caches data to backend targets after dispersing to DA, retrieved from before trying read from EigenDA. | +| `--storage.concurrent-write-threads` | `0` | `$EIGENDA_PROXY_STORAGE_CONCURRENT_WRITE_THREADS` | Number of threads spun-up for async secondary storage insertions. (<=0) denotes single threaded insertions where (>0) indicates decoupled writes. | | `--s3.timeout` | `5s` | `$EIGENDA_PROXY_S3_TIMEOUT` | timeout for S3 storage operations (e.g. get, put) | | `--redis.db` | `0` | `$EIGENDA_PROXY_REDIS_DB` | redis database to use after connecting to server | | `--redis.endpoint` | `""` | `$EIGENDA_PROXY_REDIS_ENDPOINT` | redis endpoint url | diff --git a/flags/eigendaflags/deprecated.go b/flags/eigendaflags/deprecated.go index a09b124b..7c406316 100644 --- a/flags/eigendaflags/deprecated.go +++ b/flags/eigendaflags/deprecated.go @@ -28,8 +28,8 @@ func withDeprecatedFlagPrefix(s string) string { return "eigenda-" + s } -func withDeprecatedEnvPrefix(envPrefix, s string) []string { - return []string{envPrefix + "_" + s} +func withDeprecatedEnvPrefix(envPrefix, s string) string { + return envPrefix + "_" + s } // CLIFlags ... used for EigenDA client configuration @@ -38,7 +38,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { &cli.StringFlag{ Name: DeprecatedDisperserRPCFlagName, Usage: "RPC endpoint of the EigenDA disperser.", - EnvVars: withDeprecatedEnvPrefix(envPrefix, "DISPERSER_RPC"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "DISPERSER_RPC")}, Category: category, Action: func(*cli.Context, string) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -50,7 +50,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { Name: DeprecatedStatusQueryTimeoutFlagName, Usage: "Duration to wait for a blob to finalize after being sent for dispersal. Default is 30 minutes.", Value: 30 * time.Minute, - EnvVars: withDeprecatedEnvPrefix(envPrefix, "STATUS_QUERY_TIMEOUT"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "STATUS_QUERY_TIMEOUT")}, Category: category, Action: func(*cli.Context, time.Duration) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -62,7 +62,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { Name: DeprecatedStatusQueryRetryIntervalFlagName, Usage: "Interval between retries when awaiting network blob finalization. Default is 5 seconds.", Value: 5 * time.Second, - EnvVars: withDeprecatedEnvPrefix(envPrefix, "STATUS_QUERY_INTERVAL"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "STATUS_QUERY_INTERVAL")}, Category: category, Action: func(*cli.Context, time.Duration) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -74,7 +74,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { Name: DeprecatedDisableTLSFlagName, Usage: "Disable TLS for gRPC communication with the EigenDA disperser. Default is false.", Value: false, - EnvVars: withDeprecatedEnvPrefix(envPrefix, "GRPC_DISABLE_TLS"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "GRPC_DISABLE_TLS")}, Category: category, Action: func(*cli.Context, bool) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -86,7 +86,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { Name: DeprecatedResponseTimeoutFlagName, Usage: "Total time to wait for a response from the EigenDA disperser. Default is 60 seconds.", Value: 60 * time.Second, - EnvVars: withDeprecatedEnvPrefix(envPrefix, "RESPONSE_TIMEOUT"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "RESPONSE_TIMEOUT")}, Category: category, Action: func(*cli.Context, time.Duration) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -98,7 +98,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { Name: DeprecatedCustomQuorumIDsFlagName, Usage: "Custom quorum IDs for writing blobs. Should not include default quorums 0 or 1.", Value: cli.NewUintSlice(), - EnvVars: withDeprecatedEnvPrefix(envPrefix, "CUSTOM_QUORUM_IDS"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "CUSTOM_QUORUM_IDS")}, Category: category, Action: func(*cli.Context, []uint) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -109,7 +109,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { &cli.StringFlag{ Name: DeprecatedSignerPrivateKeyHexFlagName, Usage: "Hex-encoded signer private key. This key should not be associated with an Ethereum address holding any funds.", - EnvVars: withDeprecatedEnvPrefix(envPrefix, "SIGNER_PRIVATE_KEY_HEX"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "SIGNER_PRIVATE_KEY_HEX")}, Category: category, Action: func(*cli.Context, string) error { return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead", @@ -120,7 +120,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { &cli.UintFlag{ Name: DeprecatedPutBlobEncodingVersionFlagName, Usage: "Blob encoding version to use when writing blobs from the high-level interface.", - EnvVars: withDeprecatedEnvPrefix(envPrefix, "PUT_BLOB_ENCODING_VERSION"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "PUT_BLOB_ENCODING_VERSION")}, Value: 0, Category: category, Action: func(*cli.Context, uint) error { @@ -132,7 +132,7 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag { &cli.BoolFlag{ Name: DeprecatedDisablePointVerificationModeFlagName, Usage: "Disable point verification mode. This mode performs IFFT on data before writing and FFT on data after reading. Disabling requires supplying the entire blob for verification against the KZG commitment.", - EnvVars: withDeprecatedEnvPrefix(envPrefix, "DISABLE_POINT_VERIFICATION_MODE"), + EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "DISABLE_POINT_VERIFICATION_MODE")}, Value: false, Category: category, Action: func(*cli.Context, bool) error { diff --git a/store/cli.go b/store/cli.go index fb776b06..7801ff12 100644 --- a/store/cli.go +++ b/store/cli.go @@ -13,14 +13,14 @@ var ( ) func withFlagPrefix(s string) string { - return "store." + s + return "storage." + s } func withEnvPrefix(envPrefix, s string) []string { - return []string{envPrefix + "_STORE_" + s} + return []string{envPrefix + "_STORAGE_" + s} } -// CLIFlags ... used for Redis backend configuration +// CLIFlags ... used for storage configuration // category is used to group the flags in the help output (see https://cli.urfave.org/v2/examples/flags/#grouping) func CLIFlags(envPrefix, category string) []cli.Flag { return []cli.Flag{