pub struct ZakuraBlockSyncConfig {Show 29 fields
pub max_blocks_per_response: u32,
pub max_inflight_requests: u32,
pub initial_inflight_requests: u32,
pub max_response_bytes: u32,
pub max_inflight_block_bytes: u64,
pub max_reorder_lookahead_bytes: u64,
pub floor_peer_avoid_cooldown: Duration,
pub max_submitted_block_applies: usize,
pub request_timeout: Duration,
pub floor_rescue_timeout: Duration,
pub no_progress_peer_cooldown: Duration,
pub initial_block_probe_requests: u32,
pub max_requests_without_block_progress: u32,
pub status_refresh_interval: Duration,
pub size_deviation_tolerance: u32,
pub bbr_cwnd_gain_percent: u32,
pub bbr_probe_bw_gain_percent: u32,
pub bbr_probe_rtt_interval: Duration,
pub bbr_probe_rtt_duration: Duration,
pub bbr_rtprop_window: Duration,
pub bbr_delivery_rate_window: Duration,
pub bbr_startup_growth_percent: u32,
pub bbr_min_cwnd: u32,
pub bbr_min_cwnd_bytes: u64,
pub bbr_delay_gradient_percent: u32,
pub bbr_reliability_weight_percent: u32,
pub bbr_cwnd_unit: CwndUnit,
pub floor_bypass_slots: u32,
pub peer_limits: ServicePeerLimits,
/* private fields */
}Expand description
Block-sync configuration nested under the Zakura P2P-v2 config.
Fields§
§max_blocks_per_response: u32Maximum blocks this node advertises per GetBlocks response.
max_inflight_requests: u32Maximum concurrent GetBlocks requests this node advertises per peer.
initial_inflight_requests: u32Initial per-peer BBR cwnd (cold-start point), in blocks; converges to the BDP-derived target once the first delivery is measured.
max_response_bytes: u32Maximum total response bytes this node advertises per GetBlocks response.
max_inflight_block_bytes: u64Maximum estimated bytes reserved for outstanding block-body requests: a
DoS/pacing bound on in-flight wire data, released at receipt. Received
bodies are bounded by max_reorder_lookahead_bytes instead.
max_reorder_lookahead_bytes: u64Maximum estimated resident memory of look-ahead block bodies retained
by the download pipeline. Serialized backlog and reservations are charged
at wire size; decoded input/submission windows add
DESERIALIZED_MEM_FACTOR times their wire size.
floor_peer_avoid_cooldown: DurationHow long to avoid reassigning an expired floor height to the same peer.
max_submitted_block_applies: usizeDepth for block-sync action/body channels, clamped to at least one full checkpoint range.
request_timeout: DurationTimeout for an outstanding block-body range request.
floor_rescue_timeout: DurationShort leash on a floor request before its height is rescued to a faster
carrier. Clamped positive and never above request_timeout.
no_progress_peer_cooldown: DurationHow long to keep a peer disconnected after it makes no accepted block progress.
initial_block_probe_requests: u32GetBlocks requests an unproven peer may receive before its first accepted body,
so a peer that accepts requests but never serves bodies can’t spend a full BBR
cold-start burst.
max_requests_without_block_progress: u32After a peer has proven progress, the cap on requests without an accepted body; past it the peer gets no more work until it makes progress or the liveness deadline disconnects it.
status_refresh_interval: DurationHow often this node sends unsolicited status refreshes after local frontier changes.
size_deviation_tolerance: u32Percentage deviation from advertised body-size hints tolerated before soft scoring.
bbr_cwnd_gain_percent: u32Steady-state cwnd as a percent of the measured bandwidth-delay product.
bbr_probe_bw_gain_percent: u32ProbeBW up-probe pacing gain, percent. Reserved: the ProbeBW gain cycle is not yet wired into the controller, so this knob is currently inert (the BtlBw max-filter already adopts higher delivery rates without an explicit up-probe).
bbr_probe_rtt_interval: DurationHow often to enter ProbeRTT to refresh the min-RTT estimate.
bbr_probe_rtt_duration: DurationHow long to hold the drained cwnd during ProbeRTT.
bbr_rtprop_window: DurationWindowed-min horizon for the RTprop (min-RTT) estimate.
bbr_delivery_rate_window: DurationMax-filter horizon for the delivery-rate (BtlBw) estimate.
bbr_startup_growth_percent: u32Per-RTT Startup cwnd growth, percent. Reserved: there is no separate Startup ramp
phase yet, so this knob is currently inert (cold start uses
initial_inflight_requests and the BDP estimate takes over once samples arrive).
bbr_min_cwnd: u32Minimum cwnd, in blocks (the floor under CwndUnit::Blocks).
bbr_min_cwnd_bytes: u64Minimum cwnd, in bytes (the floor under CwndUnit::Bytes). Doubles as the
cold-start byte window before the first delivery sample, and as the binding
operating window for low-latency peers whose byte-BDP is below it.
bbr_delay_gradient_percent: u32Delay-gradient down-adjust threshold, percent of RTprop.
bbr_reliability_weight_percent: u32Weight (0..=100) with which measured reliability discounts the BDP-derived cwnd:
0 = plain BBR, 100 = full goodput discount, so a request-dropping carrier holds
proportionally less in flight. See [DEFAULT_BS_BBR_RELIABILITY_WEIGHT_PERCENT].
bbr_cwnd_unit: CwndUnitUnit the BBR cwnd budgets in-flight work against (bytes = header-hinted
reserved body bytes, default; blocks = request count, the A/B baseline).
floor_bypass_slots: u32Slots a floor (lowest-missing-height) request may borrow beyond the BBR cwnd, up
to the peer’s advertised hard cap. Lets the floor be fetched even when every
servable peer is saturated at its cwnd; 0 disables the bypass.
peer_limits: ServicePeerLimitsBlock-sync peer caps and queue limits owned by this service.
Implementations§
Source§impl ZakuraBlockSyncConfig
impl ZakuraBlockSyncConfig
Sourcepub fn advertised_max_blocks_per_response(&self) -> u32
pub fn advertised_max_blocks_per_response(&self) -> u32
Return the clamped block-count advertisement for wire status messages.
Sourcepub fn advertised_max_inflight_requests(&self) -> u32
pub fn advertised_max_inflight_requests(&self) -> u32
Return the locally capped in-flight advertisement for status messages.
Sourcepub fn advertised_max_response_bytes(&self) -> u32
pub fn advertised_max_response_bytes(&self) -> u32
Return the non-zero response byte advertisement for status messages.
Sourcepub fn submitted_apply_limit(&self) -> usize
pub fn submitted_apply_limit(&self) -> usize
Return the non-zero block-sync action/body channel depth.
Sourcepub fn effective_max_reorder_lookahead_bytes(&self) -> u64
pub fn effective_max_reorder_lookahead_bytes(&self) -> u64
Return the resident look-ahead byte cap.
Currently the raw configured value; kept as an accessor for the semantic
seam with the clamp interplay. The outstanding-request cap
(max_inflight_block_bytes) no longer implies retention, so it must not
silently shrink this memory budget.
Sourcepub fn effective_floor_peer_avoid_cooldown(&self) -> Duration
pub fn effective_floor_peer_avoid_cooldown(&self) -> Duration
Return the floor avoid cooldown clamped to a positive duration.
Sourcepub fn floor_request_byte_reservation(&self) -> u64
pub fn floor_request_byte_reservation(&self) -> u64
Return the largest byte reservation a single floor request can need.
Sourcepub fn validate(&self) -> Result<(), &'static str>
pub fn validate(&self) -> Result<(), &'static str>
Validate production-safety bounds after deserialization.
Sourcepub fn clamp_reorder_lookahead_to_floor(&mut self)
pub fn clamp_reorder_lookahead_to_floor(&mut self)
Clamp the resident look-ahead budget up to one worst-case checkpoint range of wire bytes.
This is defense-in-depth for the speculative above-window lane: checkpoint sync liveness already comes from the commit-window admission exemption, but a sub-range byte budget would reject nearly all gated look-ahead work. Serialized pools are charged at wire size, so the floor is the range’s wire bytes, not its decoded multiple: the bounded decode window’s cost is carried by the exempt lane, which bypasses this budget entirely.
Sourcepub fn clamp_inflight_block_bytes_to_request_floor(&mut self)
pub fn clamp_inflight_block_bytes_to_request_floor(&mut self)
Clamp a positive but sub-floor-request max_inflight_block_bytes up to
just above one floor request.
validate() requires the outstanding-request budget to cover at least
one floor request (the bounded floor overdraft repays against it).
Rather than refuse to start — which would break older configs written
when the field also bounded retention and small values were clamped —
raise the budget to the smallest valid value and warn.
Sourcepub fn initial_status(&self) -> BlockSyncStatus
pub fn initial_status(&self) -> BlockSyncStatus
Build the inert local status used before the block-sync reactor is wired.
Trait Implementations§
Source§impl Clone for ZakuraBlockSyncConfig
impl Clone for ZakuraBlockSyncConfig
Source§fn clone(&self) -> ZakuraBlockSyncConfig
fn clone(&self) -> ZakuraBlockSyncConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ZakuraBlockSyncConfig
impl Debug for ZakuraBlockSyncConfig
Source§impl Default for ZakuraBlockSyncConfig
impl Default for ZakuraBlockSyncConfig
Source§impl<'de> Deserialize<'de> for ZakuraBlockSyncConfigwhere
ZakuraBlockSyncConfig: Default,
impl<'de> Deserialize<'de> for ZakuraBlockSyncConfigwhere
ZakuraBlockSyncConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ZakuraBlockSyncConfig
Source§impl PartialEq for ZakuraBlockSyncConfig
impl PartialEq for ZakuraBlockSyncConfig
Source§impl Serialize for ZakuraBlockSyncConfig
impl Serialize for ZakuraBlockSyncConfig
impl StructuralPartialEq for ZakuraBlockSyncConfig
Auto Trait Implementations§
impl Freeze for ZakuraBlockSyncConfig
impl RefUnwindSafe for ZakuraBlockSyncConfig
impl Send for ZakuraBlockSyncConfig
impl Sync for ZakuraBlockSyncConfig
impl Unpin for ZakuraBlockSyncConfig
impl UnsafeUnpin for ZakuraBlockSyncConfig
impl UnwindSafe for ZakuraBlockSyncConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.