fix(zakura): keep serving during legacy fallback#488
Conversation
Keep Zakura reactors alive when the dual-stack watchdog falls back to legacy ChainSync, while draining the Zakura block-apply pipeline so only one body committer drives state.
And one more auto-invalidated finding. Analyzed four files, diff |
|
@cursor review |
Register the apply-gate drain waiter before checking in-flight applies so the final release cannot be missed and delay legacy fallback by the timeout.
Drain queued Zakura block applies once the legacy fallback gate is yielded so the bridge does not retain block bodies or token accounting for work it will no longer commit.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1c11595. Configure here.
There was a problem hiding this comment.
nice, very sensible
certainly not going to block on tech debt or readability as the repo is fubar, just to note that imo we could get an easier to read implementation here.
instead of the other methods and "apply gate", something resembling
impl BlockSyncHandoff {
async fn yield_to_legacy(&self) {
self.stop_new_applies();
self.wait_for_applies().await;
}
}
this way we're being explicit with what our goals are with yielding and apply gating, which consolidating things
our ai naming is very very extremely bad in zakura, and to a large extent I gave up fixing each time... but fwiw these names are confusing.
- release_yielded_pending_applies
- yielded_pending_apply_finished_events
- yielded_block_apply_finished_event
- abandon_yielded_block_apply
even just shortening them slightly to
- release_pending_applies
- yielded_pending_apply_finished_events
- yielded_block_apply_finished_event
- abandon_block_apply
helps my brain
if we choose to fix in the future I'd opt to the refactor mentioned earlier
as for testing
we don't currently have a fallback integration/e2e test, which given the issues we've had with it could prove useful. although it doesn't seem like we're triggering the zakura e2e when we're modifying things here 🤔
|
@evan-forbes feedback has been integrated: abstraction and tests |
Motivation
Dual-stack Zakura fallback should not turn a fallback node into a dead Zakura peer. When the stall watchdog resumes legacy
ChainSync, the node can still serve headers/bodies and advertise local state to Zakura-only peers.Solution
ZakuraApplyGateso fallback stops new Zakura body applies and drains in-flight applies before legacyChainSyncdrives commits.Tests
cargo fmt --allcargo test -p zebrad --lib components::synccargo test -p zebrad --lib block_sync_driverSpecifications & References
Follow-up Work
AI Disclosure
PR Checklist
type(scope): description