-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: main
Are you sure you want to change the base?
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 😄
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