Skip to content

perf(network): retain raw block bodies in reorder backlog#286

Merged
p0mvn merged 4 commits into
feat/pre-release-mainfrom
review/blocksync-raw-reorder
Jun 27, 2026
Merged

perf(network): retain raw block bodies in reorder backlog#286
p0mvn merged 4 commits into
feat/pre-release-mainfrom
review/blocksync-raw-reorder

Conversation

@evan-forbes

@evan-forbes evan-forbes commented Jun 27, 2026

Copy link
Copy Markdown

Motivation

This is the third block-sync PR in the stack. It keeps raw body bytes available in the reorder backlog while preserving the existing external apply/commit driver shape.

Solution

  • Thread raw body data through the wire/peer routine/sequencer path where the existing external apply flow can still use it.
  • Keep the already-decoded block on the immediate contiguous path.
  • Retain raw frame payload bytes only for non-contiguous reorder backlog so delayed backlog does not hold decoded blocks.
  • Add a direct sequencer test for raw-byte retention across a delayed backlog drain.

Scope boundary:

  • No sequencer-owned apply refactor.
  • No block_sync/apply_item.rs, zebrad committer ownership, or BlockApplyExecutor changes.
  • Congestion and parameter tuning are stacked above this PR.

Tests

Passed locally on the rebuilt split stack:

  • git diff --check origin/review/headersync-roots..review/blocksync-throughput-defaults
  • cargo fmt --all -- --check
  • cargo test -p zebra-network zakura::block_sync --lib (146 passed on the final stack tip)
  • cargo test -p zebra-network sequencer_retains_raw_bytes_for_non_contiguous_backlog --lib

Attempted but blocked by the local toolchain before test execution:

  • cargo test -p zebrad --test acceptance latest_config_is_stored -- --nocapture
  • Blocker: bundled librocksdb-sys C++ compilation fails on RocksDB headers using uint64_t without <cstdint>.

Specifications & References

Stack context:

Follow-up Work

Floor-priority scheduling, congestion control, and throughput-default tuning are separate stacked PRs above this one. Sequencer-owned apply remains out of this stack slice.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: Codex was used to reconstruct the stacked branch, run sequential review agents, fix review findings, draft/update PR text, and run validation commands.

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

@evan-forbes evan-forbes force-pushed the review/blocksync-raw-reorder branch from 8433f39 to ffdbedd Compare June 27, 2026 04:56
@evan-forbes evan-forbes force-pushed the review/blocksync-request-bookkeeping branch from a7ac6a0 to def6072 Compare June 27, 2026 04:56
@evan-forbes evan-forbes force-pushed the review/blocksync-request-bookkeeping branch from def6072 to aa54be2 Compare June 27, 2026 05:01
@evan-forbes evan-forbes force-pushed the review/blocksync-raw-reorder branch from ffdbedd to 0db01f4 Compare June 27, 2026 05:01
@p0mvn p0mvn force-pushed the review/blocksync-request-bookkeeping branch from aa54be2 to 36c2bae Compare June 27, 2026 05:54
@p0mvn p0mvn force-pushed the review/blocksync-raw-reorder branch from 0db01f4 to 0e697ea Compare June 27, 2026 05:57
@p0mvn p0mvn changed the base branch from review/blocksync-request-bookkeeping to feat/pre-release-main June 27, 2026 06:12
@p0mvn p0mvn marked this pull request as ready for review June 27, 2026 06:31
@evan-forbes evan-forbes force-pushed the review/blocksync-raw-reorder branch from ff5965b to cb8b994 Compare June 27, 2026 08:18
@evan-forbes evan-forbes reopened this Jun 27, 2026
Comment thread zebra-network/src/zakura/block_sync/peer_routine.rs Outdated
@p0mvn p0mvn merged commit 180b426 into feat/pre-release-main Jun 27, 2026
12 checks passed
evan-forbes added a commit that referenced this pull request Jun 28, 2026
Follow-ups from review of the merged block-sync throughput stack
(#284, #286, #287, #288, #289):

- sequencer: drop the redundant 500ms timer-driven floor-starvation shed.
  Floor rescue is already demand-driven (inline after each accepted body,
  plus the synchronous FundFloorReservation path), so the periodic backstop
  was a pure fixed-cadence poll.
- reactor: make the floor watchdog event-driven. Arm a sleep to the earliest
  outstanding floor-claim deadline instead of polling on a fixed tick,
  mirroring the per-peer routine's own-timeout arm. Removes the
  floor_watchdog_tick config knob.
- consensus/state: rename consensus.disable_vct_fast_sync ->
  consensus.vct_fast_sync (default true) to remove the double negative.
  Mirror updated in state config, docs, and CHANGELOG.
- work_queue: debug_assert the take_in_range_budgeted precondition (positive
  count, low <= high) instead of silently returning empty.
- block_sync: reword refactor-historical comments ("ported from",
  "verbatim", "matches the previous", "used to") to describe current
  behavior.

AI-assisted: implemented with Claude Code (Opus 4.8).
p0mvn pushed a commit that referenced this pull request Jun 28, 2026
Follow-ups from review of the merged block-sync throughput stack
(#284, #286, #287, #288, #289):

- sequencer: drop the redundant 500ms timer-driven floor-starvation shed.
  Floor rescue is already demand-driven (inline after each accepted body,
  plus the synchronous FundFloorReservation path), so the periodic backstop
  was a pure fixed-cadence poll.
- reactor: make the floor watchdog event-driven. Arm a sleep to the earliest
  outstanding floor-claim deadline instead of polling on a fixed tick,
  mirroring the per-peer routine's own-timeout arm. Removes the
  floor_watchdog_tick config knob.
- consensus/state: rename consensus.disable_vct_fast_sync ->
  consensus.vct_fast_sync (default true) to remove the double negative.
  Mirror updated in state config, docs, and CHANGELOG.
- work_queue: debug_assert the take_in_range_budgeted precondition (positive
  count, low <= high) instead of silently returning empty.
- block_sync: reword refactor-historical comments ("ported from",
  "verbatim", "matches the previous", "used to") to describe current
  behavior.

AI-assisted: implemented with Claude Code (Opus 4.8).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants