Skip to content
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] fix: Pending chunk endorsement cache #10568

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

staffik
Copy link
Contributor

@staffik staffik commented Feb 5, 2024

Issue: #10560

https://near.zulipchat.com/#narrow/stream/407237-pagoda.2Fcore.2Fstateless-validation/topic/StatelessNet.20planning/near/419827117

  • add pending_chunk_endorsements cache to ChunkEndorsementTracker
  • if we have an error on get_chunk, add endorsements to pending cache
  • on on_chunk_completed, process all pending endorsements for chunk hash
    We discussed previously that full chunk may not be needed. But this solution aligns well with the existing design

@staffik staffik added the A-stateless-validation Area: stateless validation label Feb 5, 2024
@staffik staffik requested a review from a team as a code owner February 5, 2024 14:34
@staffik staffik requested a review from akhi3030 February 5, 2024 14:34
@staffik staffik marked this pull request as draft February 5, 2024 14:37
@staffik staffik marked this pull request as ready for review February 5, 2024 14:53
Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

@akhi3030 akhi3030 removed their request for review February 5, 2024 15:13
@staffik staffik changed the title fix: Pending chunk endorsement cache [stateless_validation] fix: Pending chunk endorsement cache Feb 5, 2024
Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@staffik staffik force-pushed the pending_chunk_endorsement_cache branch from 2c307cd to 1c53111 Compare February 6, 2024 07:50
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (3f1a431) 71.88% compared to head (9d42db3) 71.90%.
Report is 9 commits behind head on master.

Files Patch % Lines
.../stateless_validation/chunk_endorsement_tracker.rs 87.23% 4 Missing and 2 partials ⚠️
tools/amend-genesis/src/lib.rs 72.72% 1 Missing and 2 partials ⚠️
...src/stateless_validation/state_witness_producer.rs 92.30% 0 Missing and 2 partials ⚠️
core/primitives/src/validator_signer.rs 60.00% 2 Missing ⚠️
chain/chain/src/chain.rs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10568      +/-   ##
==========================================
+ Coverage   71.88%   71.90%   +0.02%     
==========================================
  Files         723      724       +1     
  Lines      147034   147133      +99     
  Branches   147034   147133      +99     
==========================================
+ Hits       105689   105803     +114     
+ Misses      36481    36467      -14     
+ Partials     4864     4863       -1     
Flag Coverage Δ
backward-compatibility 0.08% <0.00%> (-0.01%) ⬇️
db-migration 0.08% <0.00%> (-0.01%) ⬇️
genesis-check 1.25% <0.00%> (-0.01%) ⬇️
integration-tests 36.88% <69.30%> (-0.01%) ⬇️
linux 71.06% <49.76%> (+0.03%) ⬆️
linux-nightly 71.36% <93.48%> (+0.09%) ⬆️
macos 53.23% <43.72%> (-1.80%) ⬇️
pytests 1.46% <0.00%> (-0.01%) ⬇️
sanity-checks 1.26% <0.00%> (-0.01%) ⬇️
unittests 67.87% <62.32%> (-0.01%) ⬇️
upgradability 0.13% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@staffik staffik force-pushed the pending_chunk_endorsement_cache branch from 20b4e9a to 9d42db3 Compare February 6, 2024 10:36
@shreyan-gupta shreyan-gupta added this pull request to the merge queue Feb 6, 2024
Merged via the queue into master with commit c198d8b Feb 6, 2024
26 of 28 checks passed
@shreyan-gupta shreyan-gupta deleted the pending_chunk_endorsement_cache branch February 6, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants