Skip to content

Commit

Permalink
change nofetchquorumdynamically flag back to positive fetchquorumdyna…
Browse files Browse the repository at this point in the history
…mically (using boolTFlag)
  • Loading branch information
samlaf committed Feb 15, 2024
1 parent 51a066d commit b5f5b41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions avssync.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type AvsSync struct {
syncInterval time.Duration
operators []common.Address // empty means we update all operators
quorums []byte
noFetchQuorumsDynamically bool
fetchQuorumsDynamically bool
retrySyncNTimes int

readerTimeoutDuration time.Duration
Expand All @@ -36,7 +36,7 @@ func NewAvsSync(
logger sdklogging.Logger,
avsReader avsregistry.AvsRegistryReader, avsWriter avsregistry.AvsRegistryWriter,
sleepBeforeFirstSyncDuration time.Duration, syncInterval time.Duration, operators []common.Address,
quorums []byte, noFetchQuorumsDynamically bool, retrySyncNTimes int,
quorums []byte, fetchQuorumsDynamically bool, retrySyncNTimes int,
readerTimeoutDuration time.Duration,
writerTimeoutDuration time.Duration,
) *AvsSync {
Expand All @@ -48,7 +48,7 @@ func NewAvsSync(
syncInterval: syncInterval,
operators: operators,
quorums: quorums,
noFetchQuorumsDynamically: noFetchQuorumsDynamically,
fetchQuorumsDynamically: fetchQuorumsDynamically,
retrySyncNTimes: retrySyncNTimes,
readerTimeoutDuration: readerTimeoutDuration,
writerTimeoutDuration: writerTimeoutDuration,
Expand All @@ -63,7 +63,7 @@ func (a *AvsSync) Start() {
"syncInterval", a.syncInterval,
"operators", a.operators,
"quorums", a.quorums,
"noFetchQuorumsDynamically", a.noFetchQuorumsDynamically,
"fetchQuorumsDynamically", a.fetchQuorumsDynamically,
"readerTimeoutDuration", a.readerTimeoutDuration,
"writerTimeoutDuration", a.writerTimeoutDuration,
)
Expand Down Expand Up @@ -123,7 +123,7 @@ func (a *AvsSync) updateStakes() error {
}

func (a *AvsSync) maybeUpdateQuorumSet() {
if a.noFetchQuorumsDynamically {
if !a.fetchQuorumsDynamically {
return
}
a.logger.Info("Fetching quorum set dynamically")
Expand Down
6 changes: 3 additions & 3 deletions flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ var (
Usage: "List of quorums to update stakes for (only needs to be present if operators list not present and fetch-quorums-dynamically is false)",
EnvVar: envVarPrefix + "QUORUMS",
}
NoFetchQuorumDynamicallyFlag = cli.BoolFlag{
FetchQuorumDynamicallyFlag = cli.BoolTFlag{
Name: "fetch-quorums-dynamically",
Usage: "If set to true, will use the quorumList argument instead of fetching the list of quorums registered in the contract dynamically and updating all of them",
Usage: "If set to true (default), will fetch the list of quorums registered in the contract and update all of them",
EnvVar: envVarPrefix + "FETCH_QUORUMS_DYNAMICALLY",
}
ReaderTimeoutDurationFlag = cli.DurationFlag{
Expand Down Expand Up @@ -95,7 +95,7 @@ var OptionalFlags = []cli.Flag{
FirstSyncTimeFlag,
OperatorListFlag,
QuorumListFlag,
NoFetchQuorumDynamicallyFlag,
FetchQuorumDynamicallyFlag,
ReaderTimeoutDurationFlag,
WriterTimeoutDurationFlag,
retrySyncNTimes,
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func avsSyncMain(cliCtx *cli.Context) error {
cliCtx.Duration(SyncIntervalFlag.Name),
operators,
quorums,
cliCtx.Bool(NoFetchQuorumDynamicallyFlag.Name),
cliCtx.Bool(FetchQuorumDynamicallyFlag.Name),
cliCtx.Int(retrySyncNTimes.Name),
cliCtx.Duration(ReaderTimeoutDurationFlag.Name),
cliCtx.Duration(WriterTimeoutDurationFlag.Name),
Expand Down

0 comments on commit b5f5b41

Please sign in to comment.