Skip to content

Commit

Permalink
flag(eigenda): rename RetriesBeforeFailover -> PutRetries
Browse files Browse the repository at this point in the history
reviewer correctly pointed out that retrying was more general than only for failovers
  • Loading branch information
samlaf committed Oct 29, 2024
1 parent 8dbc072 commit 956372a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
8 changes: 4 additions & 4 deletions flags/eigendaflags/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
EthRPCURLFlagName = withFlagPrefix("eth-rpc")
SvcManagerAddrFlagName = withFlagPrefix("svc-manager-addr")
// Flags that are proxy specific, and not used by the eigenda-client
RetriesBeforeFailoverFlagName = withFlagPrefix("retries-before-failover")
PutRetriesFlagName = withFlagPrefix("put-retries")
)

func withFlagPrefix(s string) string {
Expand Down Expand Up @@ -142,10 +142,10 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
// Flags that are proxy specific, and not used by the eigenda-client
// TODO: should we move this to a more specific category, like EIGENDA_STORE?
&cli.UintFlag{
Name: RetriesBeforeFailoverFlagName,
Usage: "Number of times to retry blob dispersal before returning a 503 to the client, signifying that the client should failover to ethda.",
Name: PutRetriesFlagName,
Usage: "Number of times to retry blob dispersals.",
Value: 3,
EnvVars: []string{withEnvPrefix(envPrefix, "RETRIES_BEFORE_FAILOVER")},
EnvVars: []string{withEnvPrefix(envPrefix, "PUT_RETRIES")},
Category: category,
},
}
Expand Down
24 changes: 12 additions & 12 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
)

type Config struct {
EdaClientConfig clients.EigenDAClientConfig
VerifierConfig verify.Config
RetriesBeforeFailover uint
EdaClientConfig clients.EigenDAClientConfig
VerifierConfig verify.Config
PutRetries uint

MemstoreEnabled bool
MemstoreConfig memstore.Config
Expand All @@ -40,15 +40,15 @@ type Config struct {
func ReadConfig(ctx *cli.Context) Config {
edaClientConfig := eigendaflags.ReadConfig(ctx)
return Config{
RedisConfig: redis.ReadConfig(ctx),
S3Config: s3.ReadConfig(ctx),
EdaClientConfig: edaClientConfig,
VerifierConfig: verify.ReadConfig(ctx, edaClientConfig),
RetriesBeforeFailover: ctx.Uint(eigendaflags.RetriesBeforeFailoverFlagName),
MemstoreEnabled: ctx.Bool(memstore.EnabledFlagName),
MemstoreConfig: memstore.ReadConfig(ctx),
FallbackTargets: ctx.StringSlice(flags.FallbackTargetsFlagName),
CacheTargets: ctx.StringSlice(flags.CacheTargetsFlagName),
RedisConfig: redis.ReadConfig(ctx),
S3Config: s3.ReadConfig(ctx),
EdaClientConfig: edaClientConfig,
VerifierConfig: verify.ReadConfig(ctx, edaClientConfig),
PutRetries: ctx.Uint(eigendaflags.PutRetriesFlagName),
MemstoreEnabled: ctx.Bool(memstore.EnabledFlagName),
MemstoreConfig: memstore.ReadConfig(ctx),
FallbackTargets: ctx.StringSlice(flags.FallbackTargetsFlagName),
CacheTargets: ctx.StringSlice(flags.CacheTargetsFlagName),
}
}

Expand Down
8 changes: 4 additions & 4 deletions server/load_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ func LoadStoreManager(ctx context.Context, cfg CLIConfig, log log.Logger, m metr
verifier,
log,
&eigenda.StoreConfig{
MaxBlobSizeBytes: cfg.EigenDAConfig.MemstoreConfig.MaxBlobSizeBytes,
EthConfirmationDepth: cfg.EigenDAConfig.VerifierConfig.EthConfirmationDepth,
StatusQueryTimeout: cfg.EigenDAConfig.EdaClientConfig.StatusQueryTimeout,
RetriesBeforeFailover: cfg.EigenDAConfig.RetriesBeforeFailover,
MaxBlobSizeBytes: cfg.EigenDAConfig.MemstoreConfig.MaxBlobSizeBytes,
EthConfirmationDepth: cfg.EigenDAConfig.VerifierConfig.EthConfirmationDepth,
StatusQueryTimeout: cfg.EigenDAConfig.EdaClientConfig.StatusQueryTimeout,
PutRetries: cfg.EigenDAConfig.PutRetries,
},
)
}
Expand Down
7 changes: 3 additions & 4 deletions store/generated_key/eigenda/eigenda.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ type StoreConfig struct {
// total duration time that client waits for blob to confirm
StatusQueryTimeout time.Duration

// number of times to retry blob dispersal before returning a 503 to the client
// signifying that the client should failover to ethda
RetriesBeforeFailover uint
// number of times to retry eigenda blob dispersals
PutRetries uint
}

// Store does storage interactions and verifications for blobs with DA.
Expand Down Expand Up @@ -110,7 +109,7 @@ func (e Store) Put(ctx context.Context, value []byte) ([]byte, error) {
// it to an http 503 to signify to the client (batcher) to failover to ethda
// b/c eigenda is temporarily down.
retry.LastErrorOnly(true),
retry.Attempts(e.cfg.RetriesBeforeFailover),
retry.Attempts(e.cfg.PutRetries),
)
if err != nil {
// TODO: we will want to filter for errors here and return a 503 when needed
Expand Down

0 comments on commit 956372a

Please sign in to comment.