You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
platform-wallet: a shielded note scan advances its watermark past a gap between fetched ranges #6109
sync_shielded_notes_stream fetches adjacent note ranges concurrently and emits them in start order. Each range is proved at its own height. So a range answered one block earlier can come back short, while the next range, already in flight, comes back non-empty.
sync_notes_from_stream notices that gap only for covered_height. It still:
appends the later range's commitments, which land at shifted positions because the append gate compares against the tree size from before the scan;
replays that range's nullifiers;
persists the watermark as aligned_start + total_notes_scanned.
The skipped positions are never decrypted, and the local commitment tree no longer matches Platform's. This also undermines the anchor-expiry release of stranded spends.
It needs the tree to grow across a fetch boundary between two responses, so it is rare. It was found by reading the code while reviewing #6090; the same logic is on v5.1-dev.
Proposed fix
Stop consuming at the first gap. Append, publish and advance the watermark only through the contiguous prefix, and let the next pass re-fetch from there.
Test
Drive sync_notes_from_stream with a short range followed by a non-empty one, over two passes. Assert that the watermark stops at the gap and that the second pass recovers the skipped positions.
Activity