fix: correct state transitions in filter sync manager#451
fix: correct state transitions in filter sync manager#451xdustinface wants to merge 1 commit intov0.42-devfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughRefactored state transitions in the filter manager's download and event handling logic. Removes immediate Syncing transition, introduces WaitForEvents state for insufficient headers, defers transitions based on available data, and enhances lookahead batch creation. Tests expanded to validate new state behavior and transitions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 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 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 |
31e835f to
24f52f9
Compare
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
Move `set_state(Syncing)` after the early returns in `start_download()` so the manager stays in the correct state when filter headers haven't reached the needed height. Return to `WaitForEvents` in that case so new `FilterHeadersStored` events re-trigger `start_download` with proper batch processing initialization. Also transition `Synced` back to `Syncing` in `handle_new_filter_headers` when new filter headers arrive, ensuring `is_synced()` returns false until all new filters and matched blocks are fully processed.
e39cb43 to
ab06361
Compare
Move
set_state(Syncing)after the early returns instart_download()so the manager stays in the correct state when filter headers haven't reached the needed height. Return toWaitForEventsin that case so newFilterHeadersStoredevents re-triggerstart_downloadwith proper batch processing initialization.Also transition
Syncedback toSyncinginhandle_new_filter_headerswhen new filter headers arrive, ensuringis_synced()returns false until all new filters and matched blocks are fully processed.Based on:
FiltersManager.start_download#450Summary by CodeRabbit