-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: fullnode sync restart #525
Conversation
- l2 block finalization is done only if the l2 block actually exists. - check point finalization is triggered in cases when we get l1 dablobs or l1 blocks is received
4075c83
to
39588fe
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #525 +/- ##
==========================================
- Coverage 58.55% 56.12% -2.44%
==========================================
Files 277 298 +21
Lines 29341 30517 +1176
==========================================
- Hits 17182 17127 -55
- Misses 12159 13390 +1231
|
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.
Some nits on docstrings.
The logic looks fine, but I am not a codeowner in this part of the codebase.
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.
We'll be coming back around to working on some of this later.
…dle_mature_l1_height
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.
Amazing docstrings.
Just some suggestions.
I still think "slice" is less intuitive than "array". But feel free to disagree and go with "slice".
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.
ACK c58fac0
* fix: fullnode sync restart - l2 block finalization is done only if the l2 block actually exists. - check point finalization is triggered in cases when we get l1 dablobs or l1 blocks is received * docstring: added docstring for handle_checkpoint_finalization and handle_mature_l1_height
* fix: fullnode sync restart - l2 block finalization is done only if the l2 block actually exists. - check point finalization is triggered in cases when we get l1 dablobs or l1 blocks is received * docstring: added docstring for handle_checkpoint_finalization and handle_mature_l1_height
Description
Reason of failing to restart
When fullnode is in initial syncing state, l1 reader/processor reads/processes blocks way faster than l2 block reader/processor. As a result l2blocks that did not exist in l2 db were marked as finalized.
After restart, fullnode tries to perform state transitions from the point where l2 block was last finalized. If l2 block does not exist it crashes.
Solution
In this pr I have changed the behavior of how we actually mark the finalize block. Previously, we were updating finalized block based on checkpoints processed by reading l1 blocks only.
After this pr, we do as previously only if the l2 block actually exist in the l2 db. And for each new l2 block tip we look for any corresponding checkpoint and finalize it if the l2blockid in checkpoint matches.
No effect on Sequencer
Sequencer does not get in this situation so it's work should not be affected.
No effect on fully synced nodes
If fullnode is in sync with realtime chain state then no way it receives any l1 block which will have future l2 checkpoint.
Type of Change
Notes to Reviewers
I want to add it's test case in a separate pr as creating this rare condition is quite tricky in test cases. Any suggestions on test cases for this condition will be highly appreciated.
I have tested these changes against our devnet releases/0.1.0 and the fix must be applied asap to releases.
Checklist
Related Issues
STR-647