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

feat: clean orphaned witnesses below the last final height #10658

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

jancionear
Copy link
Contributor

Orphaned witnesses which are below the final height of the chain will never be processed, so let's remove them from the orphan pool to free up memory.

Fixes: #10649

Orphaned witnesses which are below the final height of the
chain will never be processed, so let's remove them from
the orphan pool to save memory.

Fixes: near#10649
@jancionear jancionear added the A-stateless-validation Area: stateless validation label Feb 26, 2024
@jancionear jancionear requested a review from a team as a code owner February 26, 2024 20:55
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 85.93750% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 72.28%. Comparing base (8383deb) to head (5fd35e1).
Report is 4 commits behind head on master.

Files Patch % Lines
..._validation/chunk_validator/orphan_witness_pool.rs 81.25% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10658      +/-   ##
==========================================
- Coverage   72.42%   72.28%   -0.15%     
==========================================
  Files         732      732              
  Lines      149935   150403     +468     
  Branches   149935   150403     +468     
==========================================
+ Hits       108594   108712     +118     
- Misses      36421    36751     +330     
- Partials     4920     4940      +20     
Flag Coverage Δ
backward-compatibility 0.24% <0.00%> (-0.01%) ⬇️
db-migration 0.24% <0.00%> (-0.01%) ⬇️
genesis-check 1.42% <0.00%> (-0.01%) ⬇️
integration-tests 36.98% <29.68%> (+<0.01%) ⬆️
linux 71.08% <85.93%> (-0.13%) ⬇️
linux-nightly 71.72% <85.93%> (-0.12%) ⬇️
macos 55.34% <85.93%> (-0.11%) ⬇️
pytests 1.64% <0.00%> (-0.01%) ⬇️
sanity-checks 1.42% <0.00%> (-0.01%) ⬇️
unittests 68.12% <85.93%> (-0.14%) ⬇️
upgradability 0.28% <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.

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

mini nit: Maybe rename process_ready_orphan_chunk_state_witnesses or mention in a comment that it also handles cleanup. optional

@jancionear
Copy link
Contributor Author

mini nit: Maybe rename process_ready_orphan_chunk_state_witnesses or mention in a comment that it also handles cleanup. optional

Yeah, the old name doesn't reflect the new functionality, renamed to process_ready_orphan_witnesses_and_clean_old

@jancionear jancionear added this pull request to the merge queue Feb 27, 2024
Merged via the queue into near:master with commit 92040b3 Feb 27, 2024
25 of 28 checks passed
@jancionear jancionear deleted the pool-cleaning branch February 27, 2024 11:20
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.

Remove witnesses which are no longer needed from OrphanStateWitnessPool
2 participants