Skip to content

fix(network): tune block sync throughput defaults#289

Merged
p0mvn merged 7 commits into
feat/pre-release-mainfrom
review/blocksync-throughput-defaults
Jun 27, 2026
Merged

fix(network): tune block sync throughput defaults#289
p0mvn merged 7 commits into
feat/pre-release-mainfrom
review/blocksync-throughput-defaults

Conversation

@evan-forbes

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

Copy link
Copy Markdown

Motivation

This is the sixth block-sync PR in the stack. After the scheduling, backlog, floor-priority, and congestion mechanics are in place, this tunes the defaults and config fixture to the combined block-sync behavior.

Solution

  • Tune final block-sync byte-budget defaults to the intended combined behavior.
  • Tune Zakura connection/handshake/stream and QUIC window defaults.
  • Add/update the v5.0.0-rc.4.toml config fixture with the current serializable Zakura block-sync defaults.

Scope boundary:

  • This PR is intentionally just default/config tuning.
  • All behavior changes it depends on are in the lower stack PRs.
  • No apply/committer ownership refactor is included.

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 block_sync_config_defaults_and_round_trips -- --nocapture

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>.

Note: the final split stack intentionally differs from the backed-up original all-in-one branch by the review fixes made after the split: advertised size hints are read by #284, raw backlog retention avoids re-decoding the immediate contiguous path in #286, #288 validates block-sync config during deserialization, and this PR refreshes the generated config fixture.

Specifications & References

Stack context:

Follow-up Work

The apply/committer ownership refactor and commit-bench/tooling remain separate follow-up PRs.

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-throughput-defaults branch from 9750926 to d417114 Compare June 27, 2026 04:56
@evan-forbes
evan-forbes force-pushed the review/blocksync-congestion-control branch from 4119bd9 to b06c085 Compare June 27, 2026 04:56
@evan-forbes
evan-forbes force-pushed the review/blocksync-throughput-defaults branch from d417114 to 46378b2 Compare June 27, 2026 05:01
@evan-forbes
evan-forbes force-pushed the review/blocksync-congestion-control branch from b06c085 to 18eac76 Compare June 27, 2026 05:01
@evan-forbes
evan-forbes force-pushed the review/blocksync-congestion-control branch from 18eac76 to a7e79f3 Compare June 27, 2026 08:18
@evan-forbes
evan-forbes force-pushed the review/blocksync-throughput-defaults branch from 46378b2 to 8b47dd3 Compare June 27, 2026 08:18
@evan-forbes
evan-forbes marked this pull request as ready for review June 27, 2026 08:27
… config

The throughput-defaults rc.4 golden config dropped the [consensus]
disable_vct_fast_sync field, so the generated default config no longer matched
any stored config and last_config_is_stored (config_tests) failed once the
build break was fixed and the test could run.

[consensus]
checkpoint_sync = true
disable_vct_fast_sync = false

@evan-forbes evan-forbes Jun 27, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine for the test failure, but ofc I have less context here

also in a future pr, we could change this to avoid a double negative I think. we could just have the default be

vct_fast_sync = true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to add this to the flups at the end if reviewers agree

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm

@p0mvn

p0mvn commented Jun 27, 2026

Copy link
Copy Markdown

Merging main branch into this

@p0mvn
p0mvn changed the base branch from review/blocksync-congestion-control to feat/pre-release-main June 27, 2026 20:20

@p0mvn p0mvn left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a utACK. As I've mentioned on Slack, I think I will need to test more on mainnet to grasp the inter-dependencies and impact of the params

@p0mvn
p0mvn merged commit 16705ff into feat/pre-release-main Jun 27, 2026
42 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