-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Fork choice update for 0.9.1 - Spec PR 1465 #573
Conversation
Codecov Report
@@ Coverage Diff @@
## 0.9.x #573 +/- ##
==========================================
- Coverage 65.56% 65.49% -0.08%
==========================================
Files 198 198
Lines 3560 3599 +39
Branches 325 338 +13
==========================================
+ Hits 2334 2357 +23
- Misses 1129 1138 +9
- Partials 97 104 +7 |
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.
LGTM
Great job 🚀
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.
It looks good. The only difference I see with the spec is that they save the best justified root even if shouldUpdateJustifiedCheckpoint
returns false. They then can set the justified root based on this, when a new epoch rolls around (based on clock time).
Imagine a scenario where the fork choice calculates that there is a better justified root, but it's already 3/4 thru the epoch, so it isn't immediately set. Then the next many blocks are left empty by validators that are offline/etc. The spec implementation will set the better justified root when the next epoch comes around, even if no blocks are around to trigger the setting of the justified root.
All in all, we should probably start a setInterval
in the start
method with the interval being triggered at the start of each new epoch, fulfilling the functionality of on_tick
of the spec.
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.
onTick behavior looks good, one minor thing before it looks ready to merge
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.
🎉
Goal