feat(network): add Zakura block sync#110
Closed
evan-forbes wants to merge 4 commits into
Closed
Conversation
Add the Zakura block-sync wire and service scaffold, header v2 and body size hints, the download reactor and scheduler, verify/commit/legacy coexistence, chain-tip reset handling and invalid-body scoring, body serving/advertising, native-discovery integration, and the block-sync e2e with legacy gate and header-store bootstrap.
Introduce the supervised-pipe abstraction and resolve the Zakura security-audit findings across transport, handshake, legacy gossip, discovery, header-sync, and block-sync (rate/alloc caps, per-IP caps, dial/task-lifetime supervision, malformed-prelude handling, and more).
Rework the block- and header-sync state management and commit flow (phase-0 state-management refactor and commit-state-flow refactor), along with the sync fixes developed alongside it.
Final block-sync stabilization plus throughput tuning: raise the block-sync request size to 128 blocks and make the byte budget the block-sync congestion window.
Author
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.
Motivation
Final stacked PR 5/5 of the Zakura networking layer. Builds on PR4. Adds Zakura block sync (download/verify/commit of block bodies over Zakura, coexisting with legacy sync), plus the security hardening, state/sync-flow refactor, and stabilization/throughput work that complete the feature.
Solution
Organized into four reviewable commits:
feat(network): add Zakura block sync— block-sync wire + service scaffold, header v2 and body size hints, download reactor + scheduler, verify/commit/legacy coexistence, chain-tip reset handling, body serving/advertising, native-discovery integration, and the block-sync e2e + header-store bootstrap.fix(network): harden Zakura P2P against security audit findings— supervised-pipe abstraction and resolution of audit findings across transport, handshake, legacy gossip, discovery, header-sync, and block-sync (rate/alloc caps, per-IP caps, dial/task-lifetime supervision, malformed-prelude handling).refactor(network): rework Zakura block/header sync state flow— block/header sync state-management and commit-flow rework (adopts upstream'stry_handoff_to_non_finalized_writecheckpoint→non-finalized handoff).fix(network): stabilize Zakura block sync and tune throughput— final stabilization plus raising block-sync request size to 128 blocks and using the byte budget as the congestion window.Tests
zebra-state(185 tests) andzebra-networksuites pass locally.cargo clippy --workspace --all-targetsandcargo fmt --all -- --checkclean locally with the CI feature set.cargo test -p zebrad --test zakura_regtest_e2e -- --ignored) exercises the full sync path.Specifications & References
AI Disclosure
ironwood-main, resolving conflicts (notably thezebra-statehandoff/pruned-storage merge), squashing 68 commits into these four, and this description.PR Checklist