Skip to content

fix: prune stale hashes from orphan pool side-indexes on overflow cleanup#15629

Open
Trisfald wants to merge 2 commits intonear:masterfrom
Trisfald:fix-orphan-pool
Open

fix: prune stale hashes from orphan pool side-indexes on overflow cleanup#15629
Trisfald wants to merge 2 commits intonear:masterfrom
Trisfald:fix-orphan-pool

Conversation

@Trisfald
Copy link
Copy Markdown
Contributor

Orphan pool overflow cleanup removed evicted blocks from self.orphans but left their hashes in prev_hash_idx/height_idx vectors whenever the bucket had at least one live sibling.
Later parent recovery walked the stale entries and panicked on unwrap().

@Trisfald Trisfald requested a review from a team as a code owner April 23, 2026 15:58
@Trisfald Trisfald requested a review from stedfn April 23, 2026 15:58
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 96.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.43%. Comparing base (1bfd0a8) to head (4c37437).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
chain/chain/src/orphan.rs 96.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15629      +/-   ##
==========================================
+ Coverage   69.38%   69.43%   +0.04%     
==========================================
  Files         942      938       -4     
  Lines      213590   213480     -110     
  Branches   213590   213480     -110     
==========================================
+ Hits       148203   148223      +20     
+ Misses      59490    59371     -119     
+ Partials     5897     5886      -11     
Flag Coverage Δ
pytests-nightly 1.14% <0.00%> (+<0.01%) ⬆️
unittests 68.84% <96.00%> (+0.05%) ⬆️
unittests-nightly 68.97% <96.00%> (+0.02%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Trisfald Trisfald requested a review from pugachAG April 24, 2026 08:52
Comment thread chain/chain/src/orphan.rs Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

doesn't this have same issue?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if so we can also extract in separate function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread chain/chain/src/orphan.rs
});

self.height_idx.retain(|_, ref mut xs| xs.iter().any(|x| !removed_hashes.contains(x)));
self.prune_side_indexes(&removed_hashes);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

now this prunes orphans_requested_missing_chunks and prev_hash_idx, I do not see issues with that but mentioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants