Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate Uri's feedback #6

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Incorporate Uri's feedback #6

merged 4 commits into from
Feb 16, 2024

Conversation

samlaf
Copy link
Contributor

@samlaf samlaf commented Feb 8, 2024

Uri messaged me with this msg:

I read the code of the AVSSync and have minor comments from running the service pov:

  • This line may be incorrect if there are errors in tryNTimesUpdateStakesOfEntireOperatorSetForQuorum.
  • if I run the code in LogLevel info then I may not know which quorum had errors in fetching operator addresses .
  • The code in tryNTimesUpdateStakesOfEntireOperatorSetForQuorum can be optimized, not to get the GetOperatorAddrsInQuorumsAtCurrentBlock if the update fails
    • this was not actually a bug, because the operator set might change between reading and writing, so we need to fetch the new set in case a race condition happened. added a comment to specify this.
  • If I want to run the sync at midnight UTC, then every time I start the AVSSync I need to calculate the sleepBeforeFirstSyncDuration. You can help me by doing that calculation yourself.
    Instead of specifying the sleepBeforeFirstSyncDuration , I can specify the time (HH:MI:SS) which I want to run the sync. You can calculate the sleepBeforeFirstSyncDuration usign the interval and the time in day

Also simplified the run.sh script to use the env vars instead of passing flags explicitly.

@samlaf samlaf requested a review from ian-shim February 8, 2024 21:43
avssync.go Outdated Show resolved Hide resolved
avssync.go Outdated
@@ -20,7 +20,7 @@ type AvsSync struct {
syncInterval time.Duration
operators []common.Address // empty means we update all operators
quorums []byte
fetchQuorumsDynamically bool
noFetchQuorumsDynamically bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why negate this one?
For binaries that are already running with this flag set to some value, it will have the opposite effect even if the configs are kept the same

Copy link
Contributor Author

@samlaf samlaf Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ehh good catch! I meant to also update the flag and env name of course!
I realized that binary flags' default is false and can't be set to true (other than dynamically in code, which I find ugly and bug prone), so I opted to do it this way because my assumption is that most everyone would want to update all of their quorums automatically without needing to restart avs-sync after adding a new quorum. So 2 questions for you:

  • is that a valid assumption?
  • if so, are you fine with this change? or do you have another suggestion for how to do this?

If you're fine with this, I will go ahead and fix the typo by making the flag --no-fetch-quorums-dynamically, as well as the env var name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my assumption is that most everyone would want to update all of their quorums automatically

I think this assumption is fair. Would it be easier to keep the name the same but change the default to true by making it a cli.BoolTFlag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

complete brains, I didn't even know BoolTFlag was an option! Reverted to this, thanks :) b5f5b41

@samlaf samlaf force-pushed the incorporate-feedback-from-uri branch from 0ce1431 to 51a066d Compare February 15, 2024 03:30
@samlaf samlaf requested a review from ian-shim February 15, 2024 04:19
main.go Outdated Show resolved Hide resolved
run.sh Outdated Show resolved Hide resolved
@samlaf samlaf merged commit 43beab3 into master Feb 16, 2024
1 check passed
@samlaf samlaf deleted the incorporate-feedback-from-uri branch February 16, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants