Skip to content

Commit

Permalink
flag(eigenda-client): add cli flag for new config ConfirmationTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Oct 31, 2024
1 parent 727a63d commit c479458
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions flags/eigendaflags/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import (

var (
DisperserRPCFlagName = withFlagPrefix("disperser-rpc")
ResponseTimeoutFlagName = withFlagPrefix("response-timeout")
ConfirmationTimeoutFlagName = withFlagPrefix("confirmation-timeout")
StatusQueryRetryIntervalFlagName = withFlagPrefix("status-query-retry-interval")
StatusQueryTimeoutFlagName = withFlagPrefix("status-query-timeout")
DisableTLSFlagName = withFlagPrefix("disable-tls")
ResponseTimeoutFlagName = withFlagPrefix("response-timeout")
CustomQuorumIDsFlagName = withFlagPrefix("custom-quorum-ids")
SignerPrivateKeyHexFlagName = withFlagPrefix("signer-private-key-hex")
PutBlobEncodingVersionFlagName = withFlagPrefix("put-blob-encoding-version")
Expand Down Expand Up @@ -48,6 +49,26 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
EnvVars: []string{withEnvPrefix(envPrefix, "DISPERSER_RPC")},
Category: category,
},
&cli.DurationFlag{
Name: ResponseTimeoutFlagName,
Usage: "Total time to wait for a response from the EigenDA disperser. Default is 60 seconds.",
Value: 60 * time.Second,
EnvVars: []string{withEnvPrefix(envPrefix, "RESPONSE_TIMEOUT")},
Category: category,
},
&cli.DurationFlag{
Name: ConfirmationTimeoutFlagName,
Usage: `The total amount of time that the client will spend waiting for EigenDA
to "confirm" (include onchain) a blob after it has been dispersed. Note that
we stick to "confirm" here but this really means InclusionTimeout,
not confirmation in the sense of confirmation depth.
If ConfirmationTimeout time passes and the blob is not yet confirmed,
the client will return an api.ErrorFailover to let the caller failover to EthDA.`,
Value: 15 * time.Minute,
EnvVars: []string{withEnvPrefix(envPrefix, "CONFIRMATION_TIMEOUT")},
Category: category,
},
&cli.DurationFlag{
Name: StatusQueryTimeoutFlagName,
Usage: "Duration to wait for a blob to finalize after being sent for dispersal. Default is 30 minutes.",
Expand All @@ -69,13 +90,6 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
EnvVars: []string{withEnvPrefix(envPrefix, "GRPC_DISABLE_TLS")},
Category: category,
},
&cli.DurationFlag{
Name: ResponseTimeoutFlagName,
Usage: "Total time to wait for a response from the EigenDA disperser. Default is 60 seconds.",
Value: 60 * time.Second,
EnvVars: []string{withEnvPrefix(envPrefix, "RESPONSE_TIMEOUT")},
Category: category,
},
&cli.UintSliceFlag{
Name: CustomQuorumIDsFlagName,
Usage: "Custom quorum IDs for writing blobs. Should not include default quorums 0 or 1.",
Expand Down Expand Up @@ -155,10 +169,11 @@ func ReadConfig(ctx *cli.Context) clients.EigenDAClientConfig {
waitForFinalization, confirmationDepth := parseConfirmationFlag(ctx.String(ConfirmationDepthFlagName))
return clients.EigenDAClientConfig{
RPC: ctx.String(DisperserRPCFlagName),
ResponseTimeout: ctx.Duration(ResponseTimeoutFlagName),
ConfirmationTimeout: ctx.Duration(ConfirmationTimeoutFlagName),
StatusQueryRetryInterval: ctx.Duration(StatusQueryRetryIntervalFlagName),
StatusQueryTimeout: ctx.Duration(StatusQueryTimeoutFlagName),
DisableTLS: ctx.Bool(DisableTLSFlagName),
ResponseTimeout: ctx.Duration(ResponseTimeoutFlagName),
CustomQuorumIDs: ctx.UintSlice(CustomQuorumIDsFlagName),
SignerPrivateKeyHex: ctx.String(SignerPrivateKeyHexFlagName),
PutBlobEncodingVersion: codecs.BlobEncodingVersion(ctx.Uint(PutBlobEncodingVersionFlagName)),
Expand Down

0 comments on commit c479458

Please sign in to comment.