-
Notifications
You must be signed in to change notification settings - Fork 597
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
[stateless_validation] validate incoming partial witness heights #11398
[stateless_validation] validate incoming partial witness heights #11398
Conversation
This adds logic to `PartialWitnessActor::validate_partial_encoded_state_witness()` that checks that the height is greater than the current final head height (as is done in `Client::process_chunk_state_witness()`), and not more than five ahead of the current head height, similar to what's done in `EncodedChunksCache::height_within_horizon()` For now we read the head and final head heights directlly from the database, but in the future this should be changed so that we make a request to the client for this info Related issue: near#11301
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11398 +/- ##
==========================================
+ Coverage 71.27% 71.35% +0.08%
==========================================
Files 784 784
Lines 157847 158134 +287
Branches 157847 158134 +287
==========================================
+ Hits 112499 112843 +344
+ Misses 40505 40417 -88
- Partials 4843 4874 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Are these checks duplicated (eg., you mentioned the same check happens in |
chain/client/src/stateless_validation/partial_witness/partial_witness_actor.rs
Show resolved
Hide resolved
chain/client/src/stateless_validation/partial_witness/partial_witness_actor.rs
Outdated
Show resolved
Hide resolved
many of the existing checks were deleted in this PR: #11179 |
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, but this makes the check introduced in #11081 redundant, so let's remove it as part of this PR
removed and moved the comment over |
This adds logic to
PartialWitnessActor::validate_partial_encoded_state_witness()
that checks that the height is greater than the current final head height (as is done inClient::process_chunk_state_witness()
), and not more than five ahead of the current head height, similar to what's done inEncodedChunksCache::height_within_horizon()
For now we read the head and final head heights directlly from the database, but in the future this should be changed so that we make a request to the client for this info
Related issue: #11301