-
Notifications
You must be signed in to change notification settings - Fork 595
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
feat: skip processing old state witnesses #11081
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11081 +/- ##
==========================================
- Coverage 71.09% 71.06% -0.03%
==========================================
Files 761 764 +3
Lines 153042 153237 +195
Branches 153042 153237 +195
==========================================
+ Hits 108802 108898 +96
- Misses 39800 39906 +106
+ Partials 4440 4433 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 👍
I wonder if it would be possible to unify this logic and the one for orphaned witnesses, but it might not be that simple 🤔
chunk_hash=?witness.chunk_header.chunk_hash(), | ||
witness_height=witness.chunk_header.height_created(), | ||
final_height=final_head.height, | ||
"Skipping old state witness", |
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.
maybe expand this string to say skipping old state witness generated for already final blocks? (as what "old" witness means may not be clear)
Indeed that would be nice. I've looked into that, but there is very little overlap except for the height check, so not much to extract 😞 |
This PR introduces protection against wasting stateless validator resources on processing state witness when chunk endorsement is guaranteed not to have an effect on the chain state. In particular any chunk with
height_created
that doesn't exceed the height of the last final block can be safely skipped.Part of #10565.