Fix async_tree double unpin#3287
Open
lrubasze wants to merge 3 commits into
Open
Conversation
A relay block whose async op finished but which is pruned before being reported comes back in pruned_blocks with None async data, the condition behind the paraheads double-unpin (Sentry DOTLI-7P).
… blocks try_advance_output dropped the async user data of a pruned block whose operation had finished but which was never reported, returning None. The paraheads sync service treats None as 'outcome not yet applied' and unpins the relay block a second time, causing the Err(()) panic in Subscription::unpin_block (Sentry DOTLI-7P). Return Some whenever the operation finished, regardless of reported state. Convert the reproduction test into a regression test.
…mantics InputIterItem::async_op_user_data is Some only once a block is reported, while OutputUpdate::Finalized::pruned_blocks is Some as soon as the op finishes. Document the distinction and cross-reference both so the look-alike Options aren't confused.
skunert
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3286
Problem
light-basepanics in parachain sync:panicked at runtime_service.rs:493:34: called Result::unwrap() on an Err value: ().sync_service/paraheads.rsunpins a relay block twice — once when its parahead fetch finishes, once when it's pruned.pruned_blocksasync-op datais_none(). ButAsyncTree::try_advance_outputmapped a prunedFinished { reported: false }block toNoneinstead ofSome(user_data)(the old "TAsync thrown away silently / TODO" corner case).Err(())→ panic.Fix
try_advance_outputnow returnsSome(user_data)for anyFinishedpruned block, regardless ofreported.Why it's safe
paraheadsreads this value (the unpin guard);runtime_serviceignores it (|(_, b, _)|) and uses the separateInputIterItem::async_op_user_data, which is unchanged.Finishedviasame_async_op_as_parentwithout going throughasync_op_finished) is structurally impossible inparaheads— all inserts passsame_async_op_as_parent = false.Changes
try_advance_output.async_treecovering the finished-but-unreported pruned block.Options ("finished" inpruned_blocksvs "reported" inInputIterItem).