pub struct NodeOriginConfig {Show 14 fields
pub probe_fanout: usize,
pub pull_timeout: Duration,
pub stall_window: Duration,
pub min_throughput_bps: u64,
pub max_blob_size_bytes: u64,
pub max_rate_per_mb: u64,
pub event_poll_interval: Duration,
pub lookup: LookupConfig,
pub own_region: Option<String>,
pub serve_economics: Arc<dyn ServeEconomicsPolicy>,
pub operator_shares: OperatorShares,
pub frequency_estimator: Option<Arc<dyn FrequencyEstimator>>,
pub sell_rate_base: u64,
pub warming: Arc<WarmingAllowance>,
}Expand description
Tuning knobs for the node-to-node pull, resolved from [cache] config.
Fields§
§probe_fanout: usizeHow many discovered providers to probe before ranking.
pull_timeout: DurationWall-clock bound on the STREAM-OPEN stage of a single upstream pull: connect,
handshake, and the signed StreamResponse. Bounded work, so a slow one is a stall.
It does NOT bound the buyer-channel open, which is a separate, earlier stage on its
own budget (selection::CHANNEL_OPEN_CALLER_BUDGET, 5 s) — raising this to give a
slow L2 more room does nothing. That the two are sequential stages is exactly why
outer_pull_deadline budgets both, plus the stall window, for every candidate.
stall_window: DurationTHROUGHPUT-FLOOR window on the STREAMING stage (#1797). Bytes are counted off the
QUIC stream sub-frame, so a pull aborts only when throughput over this window falls
below Self::min_throughput_bps — never on a large blob or a big frame.
Deliberately not a wall clock: bounding the bytes by wall clock caps the blob size
this node can pull through at pull_timeout × link speed, which is the bug this
avoids.
min_throughput_bps: u64Minimum sustained upstream throughput (bytes/sec) over Self::stall_window; 0
disables the throughput test and leaves idle detection (#1797).
max_blob_size_bytes: u64Buyer-side blob-size ceiling (cache.max_blob_size_mb × MB), 0 = unlimited.
Enforced on the bytes that ACTUALLY arrive on the miss-pull leg, never on the
peer’s unverified total_bytes claim: the pull aborts with BlobTooLarge
once cumulative received bytes cross it (#1895).
max_rate_per_mb: u64Buyer-side ABSOLUTE per-MB rate ceiling (cache.max_rate_per_mb), 0 =
unlimited (#1375). Combined via effective_rate_ceiling with the
probe-relative bound (the rate the chosen candidate advertised) so the node
refuses a stream quote that exceeds the lower of the two before paying — and
retains the signed over-quote as rate-manipulation evidence.
event_poll_interval: DurationHow often this node’s chain watcher polls for events
(blockchain.event_poll_interval_ms), used to size the settle window
after a funding recovery step’s top-up (#1530).
The wait is for the UPSTREAM’s watcher, not ours, but every node in the
network runs the same default cadence and this is the only local reading of
it we have. See funder::settle_wait_budget.
lookup: LookupConfigDHT lookup tuning.
own_region: Option<String>This node’s self-attested region (identity.region), or None when
unset. Used to apply the ADR 030 latency-vs-claim penalty: a probed peer
that claims this region yet answers slower than the latency ceiling
(REGION_LATENCY_MAX_MS) is a region-spoofing signal. None disables the
penalty (nothing to compare against).
serve_economics: Arc<dyn ServeEconomicsPolicy>ADR 041 buy-side profitability gate: the most this node pays upstream,
per MB, on a cache-miss relay leg. select_policy(&cfg.cache.serve_economics)
picks OffPolicy (no ceiling) or MarginPolicy at construction.
Live operator fee-share (basis points) from FeeRouter.getShares()[0],
the (1 - f) numerator the margin serve-economics policy amortizes
over. Seeded from chain at startup and kept current by the fee-shares
watcher (crate::fee_shares_watcher::route).
frequency_estimator: Option<Arc<dyn FrequencyEstimator>>ADR 040 shared frequency estimator, when built (cache.eviction_policy
/ cache.admission_policy == "tinylfu", or cache.serve_economics.policy
== "margin"). Feeds the margin policy’s heat-estimate ceiling input;
None when no consumer needs it.
sell_rate_base: u64This node’s configured served rate per MB (payment.rate_per_mb) — the
sell rate P_sell, the serve-economics policy’s other input. The same
base value the probe handler is constructed with.
warming: Arc<WarmingAllowance>ADR 041 per-source warming allowance: bounds the loss from speculative
above-floor buys per upstream source node. The buy loop reads
available(source) to pick the warm-at-market vs amortized-floor regime,
and debits the full buy cost on a successful speculative pull. The SAME
Arc is shared with the eviction path (which forgets a dropped hash’s
tag) and with the warming-credit aggregator, which applies the realized
margin the serve path enqueues on each re-serve.
Trait Implementations§
Source§impl Clone for NodeOriginConfig
impl Clone for NodeOriginConfig
Auto Trait Implementations§
impl !RefUnwindSafe for NodeOriginConfig
impl !UnwindSafe for NodeOriginConfig
impl Freeze for NodeOriginConfig
impl Send for NodeOriginConfig
impl Sync for NodeOriginConfig
impl Unpin for NodeOriginConfig
impl UnsafeUnpin for NodeOriginConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request