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
[Merged by Bors] - use tortoise data for ballot eligibility validation #4935
Conversation
474e263
to
70bece1
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4935 +/- ##
=======================================
Coverage 77.1% 77.1%
=======================================
Files 263 263
Lines 30560 30570 +10
=======================================
+ Hits 23573 23587 +14
+ Misses 5496 5495 -1
+ Partials 1491 1488 -3
|
return nil, fmt.Errorf("%w: ref ballot %v", errMissingEpochData, refballot.ID()) | ||
refdata := v.tortoise.GetBallot(ballot.RefBallot) | ||
if refdata == nil { | ||
return nil, fmt.Errorf("ref ballot is missing %v", ballot.RefBallot) |
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.
in general my concern is when data is outside tortoise's window. why not query this from db in case of failure?
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.
if data is outside window, we can't decode ballot votes anymore. there have to be some heuristic to reload the window at that time, like a lot of atx weight wasn't counted
this should be a prerequisite for healing for longer than window length
bors merge |
related: #4927 this change eliminates database lookups on ballot validation path, with an exception of when lru cache is not sufficient to hold vrf nonces and activations. in that case we will have to load them from db, that can be optimized later by fitting more in lru cache #4935 or reusing tortoise dataset as well - fetcher will be asked for ballots only if we don't have them in memory - reference ballots for eligibility validation will be fetched from tortoise
Pull request successfully merged into develop. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
related: #4927
this change eliminates database lookups on ballot validation path, with an exception of when lru cache is not sufficient to hold
vrf nonces and activations. in that case we will have to load them from db, that can be optimized later by fitting more in lru cache #4935 or reusing tortoise dataset as well