Skip to content

fix(network): clamp max_inflight_block_bytes up to the checkpoint floor#297

Merged
p0mvn merged 1 commit into
codex/block-sync-checkpoint-byte-floor-prfrom
codex/block-sync-checkpoint-byte-clamp
Jun 28, 2026
Merged

fix(network): clamp max_inflight_block_bytes up to the checkpoint floor#297
p0mvn merged 1 commit into
codex/block-sync-checkpoint-byte-floor-prfrom
codex/block-sync-checkpoint-byte-clamp

Conversation

@evan-forbes

Copy link
Copy Markdown

Motivation

#292 enforces a checkpoint-safe block apply and byte budget floor. Older Zakura configs can still contain a positive zakura.block_sync.max_inflight_block_bytes below that checkpoint-range floor, which would make zebrad reject the config at startup.

Solution

Clamp positive below-floor max_inflight_block_bytes values up to BS_CHECKPOINT_RANGE_BYTE_FLOOR during config deserialization, with a warning. Zero remains invalid and is still rejected by validation.

This PR is intentionally stacked on #292 and contains only the config compatibility clamp.

Tests

Passed locally on codex/block-sync-checkpoint-byte-clamp:

  • cargo fmt --all -- --check
  • cargo test -p zebra-network block_sync_config_defaults_and_round_trips --lib
  • cargo test -p zebra-network config_ --lib (12 passed, including config_clamps_below_floor_inflight_block_bytes, config_deserialize_clamps_below_floor_inflight_block_bytes, and zero-invalid validation coverage)

AI Disclosure

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • The solution is tested as described above.

@evan-forbes evan-forbes changed the base branch from codex/block-sync-checkpoint-byte-floor-pr to feat/block-sync-checkpoint-byte-floor-pr June 28, 2026 02:49
@evan-forbes evan-forbes changed the base branch from feat/block-sync-checkpoint-byte-floor-pr to codex/block-sync-checkpoint-byte-floor-pr June 28, 2026 02:50
@p0mvn p0mvn marked this pull request as ready for review June 28, 2026 03:07
@p0mvn p0mvn merged commit 072d12e into codex/block-sync-checkpoint-byte-floor-pr Jun 28, 2026
6 checks passed
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