fix(sync): drive block requests from readiness events - #1023
Draft
evan-forbes wants to merge 30 commits into
Draft
evan-forbes wants to merge 30 commits into
evan-forbes wants to merge 30 commits into
Conversation
…ld the byte window at its floor
…/sync-followups-publication
This was referenced Sep 16, 2026
czarcas7ic
force-pushed
the
adam/fix-floor-peer-ranking
branch
from
September 21, 2026 12:38
c262126 to
734f37c
Compare
This branch has not been deployed
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
A requester can have eligible work yet wait for a transport poll, diagnostic heartbeat, or unrelated registry update. Refill requests can also disappear when the routine-to-reactor channel fills. These waits obscure the separate byte-reservation and window limits.
This draft builds on #1006 at
c26212652c7b5a333f8657386e5e6676835d62a7. It targetsadam/fix-floor-peer-rankingso reviewers see only the additional readiness changes.Solution
The requester still obeys the existing congestion, memory, retry, and admission limits. Configuration values and body-size estimation remain unchanged. The base includes #982, which uses advertised and confirmed block sizes; unknown sizes still reserve 2 MB.
Testing
Passed with Rust 1.97.0:
cargo test -p zakura-network --lib block_sync: 364 tests.cargo test -p zakura-network --lib zakura::transport: 54 tests.cargo clippy -p zakura-network --lib --tests -- -D warnings.cargo fmt --all -- --checkandgit diff --check.New regressions exercise the real worker loop with paused time. They cover transport release without a polling tick; preferred-peer removal, range changes, and retry exclusion; diagnostic independence; refill delivery with a full reactor channel; and a fill boundary that coincides with a full transport queue. Model tests cover inclusive expiry boundaries and coalesced equal minima. Cancellation checks verify request ownership and byte reservations return.
Two retention tests now await queue capacity when installing their filler frame. An asynchronous requester reservation can temporarily own the slot after a receive.
Changelog
The PR fragment records prompt requester resumption after eligibility changes.
Specifications & References
crates/zakura-network/src/zakura/block_sync/README.md: readiness contract.Follow-up Work
Keep this PR in draft until node trace validation completes. Revision
81e4f7014is deployed on the existing sync test node withsync-metrics, unchanged parameters, and #982 included. The latest PR commit changes README spacing only. An initial 85-second measurement achieved 91.16 blocks/s, with about 227 active applies and two outstanding requests per peer. All 7,756 measured requests still reserved 2 MB. Every measured committed height has body and commit trace coverage. The run retains traces outside controller rotation. This is an initial observation, not a matched comparison. Compare the base and this branch with identical parameters. Check event-to-request latency, unexplained idle periods, wake frequency, CPU, memory, and committed throughput. The automated checks do not establish a throughput gain or exhaust every multi-peer interleaving.Test body-size estimation and parameter changes in a separate PR after establishing this correctness baseline.