-
Notifications
You must be signed in to change notification settings - Fork 24
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
Validators at height #506
Validators at height #506
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor questions mostly to improve my own understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't look over the cache implementation too hard, but looks good. The rest LGTM aside from existing comments
logger logging.Logger | ||
pChainClient *validators.CanonicalValidatorClient | ||
// protected by timeToHeightLock | ||
timeToHeight *linked.Hashmap[time.Time, uint64] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be a hashmap. Should look into a dequeue.
height uint64, | ||
subnetID ids.ID, | ||
) (*ConnectedCanonicalValidators, error) { | ||
var err error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to set a new variable here instead of usual err :=
assignment, will only pass line 231 if err = nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm overriding the passed in height if it's 0 so I do need the err
defined prior to that so that line 232 is pure assignment to already declared vars.
I could declare a new variable to replace height
instead but I think this is cleaner
Also hi 😄
With ACP-151 now being implemented, do we want to close this PR in favor of adding a I think this iteration of the design was super helpful to think through and conceptualize, and that it led us to design that both simpler and more robust. |
Closing in favor of #555 |
Why this should be merged
Closes #501 as well as adds the proposerHeightCache to get a best guess height for which to request validators.
How this works
proposerHeightCache
that updates itself on a set intervalHow this was tested
proposerHeightCache
How is this documented
Comments