fix: gate FilterHeadersSyncComplete on block header sync completion#631
Conversation
Without this gate, `FilterHeadersSyncComplete` could fire before `BlockHeaderSyncComplete` when filter headers caught up to incrementally stored block headers. This caused downstream sync phases (filters, blocks) to start before all headers were available, leading to sync stalls. Add `block_headers_synced` flag to `FilterHeadersManager` that is set only when `BlockHeaderSyncComplete` is received. Extract `try_complete_sync` helper to centralize the completion predicate across all four emission points.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdded a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #631 +/- ##
=============================================
+ Coverage 67.57% 67.76% +0.18%
=============================================
Files 318 318
Lines 67830 67896 +66
=============================================
+ Hits 45835 46007 +172
+ Misses 21995 21889 -106
|
wallet-run had been rebased onto newer v0.42-dev than wallet2; this merge brings in the upstream fixes, plus resolves the mirror-commit overlap on key-wallet. No branch-specific logic — every wallet-run key-wallet commit has an identical mirror on wallet2. v0.42-dev upstream bits: - fix: announce tip to new peers when synced (#490) - fix: subscribe to SPV event monitors before startup (#636) - refactor: unify logging on tracing (#635) - chore: cleanup unused dependencies (#633) - fix: process broadcast transactions via dispatch_local (#626) - fix: gate FilterHeadersSyncComplete on block header sync (#631) - refactor: use String for TransactionRecord::label (#624) # Conflicts: # key-wallet/src/managed_account/transaction_record.rs
Without this gate,
FilterHeadersSyncCompletecould fire beforeBlockHeaderSyncCompletewhen filter headers caught up to incrementally stored block headers. This caused downstream sync phases (filters, blocks) to start before all headers were available, leading to sync stalls.Add
block_headers_syncedflag toFilterHeadersManagerthat is set only whenBlockHeaderSyncCompleteis received. Extracttry_complete_synchelper to centralize the completion predicate across all four emission points.Summary by CodeRabbit
Release Notes
Bug Fixes
Tests