pub struct ResolvedCache {Show 33 fields
pub cache_dir: PathBuf,
pub cache_size_mb: u64,
pub disk_headroom_mb: u64,
pub max_blob_size_mb: u64,
pub max_rate_per_mb: u64,
pub origins: Vec<ResolvedOrigin>,
pub pinned_hashes: PinnedHashes,
pub origin_retry: RetryPolicy,
pub circuit_breaker: CircuitBreakerPolicy,
pub user_agent: String,
pub gc_interval_sec: u64,
pub fs_rescan_interval_sec: u64,
pub origin_probe_ttl_sec: u64,
pub origin_probe_negative_ttl_sec: u64,
pub origin_probe_fault_ttl_sec: u64,
pub origin_probe_timeout_ms: u64,
pub origin_probe_memo_capacity: u64,
pub eviction_high_water_pct: u64,
pub eviction_target_pct: u64,
pub eviction_per_sweep_budget: u64,
pub eviction_tick_secs: u64,
pub max_probe_holds: usize,
pub stake_lane_reserved_holds: usize,
pub node_to_node_pull_through_enabled: bool,
pub relay_foreign_namespaces: bool,
pub node_pull_probe_fanout: usize,
pub node_pull_timeout_sec: u64,
pub node_pull_stall_window_sec: u64,
pub node_pull_min_throughput_bps: u64,
pub eviction_policy: String,
pub admission_policy: String,
pub tinylfu: ResolvedTinyLfu,
pub serve_economics: ResolvedServeEconomics,
}Expand description
Resolved cache fields.
Fields§
§cache_dir: PathBufBlob cache directory.
cache_size_mb: u64Upper bound on the cache ceiling in megabytes. The eviction driver clamps
it down each tick so the cache never grows into the last
Self::disk_headroom_mb of free space on the cache_dir volume
(#1930).
disk_headroom_mb: u64Free disk in megabytes the eviction driver keeps unused on the
cache_dir volume, defended against any process (#1930). Default
crate::config::DEFAULT_DISK_HEADROOM_MB; 0 opts out of the disk
clamp so only Self::cache_size_mb binds.
max_blob_size_mb: u64Maximum single blob size in megabytes.
max_rate_per_mb: u64Buyer-side ABSOLUTE per-MB rate ceiling for paid pulls (#1375), in the same
per-MB units as the wire StreamResponse.rate_per_mb; 0 = unlimited
(the default). A buyer-side ceiling: it bounds what this node, acting as a
BUYER on a cache-miss pull, will accept a provider to quote. The node also
always applies a probe-relative bound (a quote may not exceed the rate the
chosen candidate advertised at probe), so this is the additional absolute
backstop. The node never bounds its own sell rate.
origins: Vec<ResolvedOrigin>Resolved ordered list of origin backends (#437, #284). Empty
vec => no pull-through; cache misses return NoOrigin. A
single-element vec is the single-origin case and is also the
form produced from a [cache.origin] (singular) TOML table —
both wire forms (singular and plural [[cache.origins]])
collapse here so downstream wiring sees
one canonical representation. Per-variant validation (URL
parse, S3 bucket/region/prefix shape) has already run at
resolution time — the wiring layer can construct the concrete
Origin impl without re-validating. Order is significant: the
engine tries entries in this order on a cache miss and falls
back to the next on NotFound, permanent error, or transient
retry exhaustion.
pinned_hashes: PinnedHashesOperator-pinned blob hashes (#276). Hashes here are excluded from LRU eviction candidates by the cache engine. Resolved from the hex-encoded TOML form at load time, so any wrong-length or non-hex entry fails config loading rather than turning into a silent “this hash will be ignored” surprise.
Held as decdn_config_types::PinnedHashes (a typed wrapper around
Arc<HashSet<Hash>>) so the engine, runtime, and resolver
share one nominal type — a future “blocklist” or similar
HashSet<Hash>-shaped feature can’t be silently swapped into
the pinning slot.
origin_retry: RetryPolicyOrigin pull-through retry policy (#285). Set once at startup; changes require a process restart.
circuit_breaker: CircuitBreakerPolicyPer-origin circuit-breaker policy (#963). Fronts each origin’s pull-through retry loop so a sustained outage fast-fails the origin’s misses (no retry/backoff incurred) and the cache sheds load, then probes for recovery. Set once at startup; changes require a process restart.
user_agent: StringUser-Agent header sent on every HTTP origin pull-through (#435).
Defaults to decdn_config_types::DEFAULT_USER_AGENT (which embeds
the decdn-config-types crate’s CARGO_PKG_VERSION; the
decdn-node/ prefix — not the version — is the stable contract,
#578); operators can override
via cache.user_agent to attribute CDN traffic in origin access
logs or to drive origin-side rate limits and routing policy.
gc_interval_sec: u64Interval between iroh-blobs GC sweeps in seconds (#518). 0
disables the periodic sweep; any positive value is forwarded to
iroh-blobs’ built-in GC loop. Default
crate::config::DEFAULT_GC_INTERVAL_SEC when the TOML section
omits the field.
fs_rescan_interval_sec: u64Interval between origin-held-index rescans in seconds (#1130). 0
disables the periodic rescan (startup + decdn node reload still run
one). Default crate::config::DEFAULT_FS_RESCAN_INTERVAL_SEC when the
TOML section omits the field.
origin_probe_ttl_sec: u64TTL in seconds for a memoised positive live-origin probe answer (#1130
pt3). Default crate::config::DEFAULT_ORIGIN_PROBE_TTL_SEC. Backs the
per-probe HEAD/HeadObject fallback that discovers non-pinned http/s3
objects the enumeration index cannot see.
origin_probe_negative_ttl_sec: u64Default crate::config::DEFAULT_ORIGIN_PROBE_NEGATIVE_TTL_SEC. The
negative-answer TTL for the origin-probe memo — the bound on how long a
stale Absent can hide newly-available own content.
origin_probe_fault_ttl_sec: u64Memo TTL in seconds for a Fault answer (#1130 pt3). Default
crate::config::DEFAULT_ORIGIN_PROBE_FAULT_TTL_SEC. Bounds how long a
hash that faulted is not re-probed, and is capped by
origin_probe_ttl_sec so a recovered origin is noticed soon.
origin_probe_timeout_ms: u64Per-probe live-HEAD ceiling in milliseconds (#1130 pt3). Default
crate::config::DEFAULT_ORIGIN_PROBE_TIMEOUT_MS. Keeps a slow origin
off the probe hot path.
origin_probe_memo_capacity: u64Maximum distinct hashes in the live-origin probe memo (#1130 pt3).
Default crate::config::DEFAULT_ORIGIN_PROBE_MEMO_CAPACITY. Bounds
memo memory under a random-hash probe flood.
eviction_high_water_pct: u64LRU eviction driver high-water percent of Self::cache_size_mb
(#1173). Above this fraction the driver actively evicts. Validated to
[60, 95]. Default crate::config::DEFAULT_EVICTION_HIGH_WATER_PCT.
eviction_target_pct: u64LRU eviction driver target percent of Self::cache_size_mb (#1173).
The driver evicts down to this fraction before idling. Validated to
[40, 90] and <= eviction_high_water_pct - 5 (structural hysteresis
gap). Default crate::config::DEFAULT_EVICTION_TARGET_PCT.
eviction_per_sweep_budget: u64LRU eviction driver max candidates removed per tick (#1173). Validated
to [1, 256]. Default
crate::config::DEFAULT_EVICTION_PER_SWEEP_BUDGET.
eviction_tick_secs: u64LRU eviction driver wakeup cadence in seconds (#1173). Validated to
[1, 60]. Default crate::config::DEFAULT_EVICTION_TICK_SECS.
max_probe_holds: usizeMaximum number of concurrently held (eviction-exempt) blobs for the
probe-triggered hold (ADR 005 §Hold budget, #318). Default
crate::config::DEFAULT_MAX_PROBE_HOLDS; 0 disables
has_blob: true.
stake_lane_reserved_holds: usizeProbe-hold slots reserved for the stake lane (registered node-to-node
requesters) under hold-budget pressure (#757, ADR 003 §Admission and
Priority). Default 0 disables the reservation (single-lane node).
The runtime only builds a StakeLanePolicy when this is > 0, so the
probe handler’s hot path is unchanged for the default.
node_to_node_pull_through_enabled: boolEnable node-to-node paid cache-miss pull-through (#831). Default
false. When true and the buyer pool service bootstrapped, the
runtime provisions the NodeOrigin and the client handler triggers a
pull on a miss (behind a pull-authorized client lane). cache.* is
restart-required, so this is read once at bring-up.
relay_foreign_namespaces: boolWhen false, the node serves and seeds only content its own backend
holds; a foreign hash is declined like a miss. The default is
role-derived: false (origin-only) when an origin backend is
configured — an origin is not a general proxy — and true (relay)
when no origin is configured, since a pure edge node’s only function
is relaying. Explicit config overrides either default. Node-local;
cache.* is restart-required.
node_pull_probe_fanout: usizeProviders probed before ranking on a node-to-node pull (#831). Default
crate::config::DEFAULT_NODE_PULL_PROBE_FANOUT.
node_pull_timeout_sec: u64Per-pull wall-clock timeout in seconds for a node-to-node miss fill
(#831). Default crate::config::DEFAULT_NODE_PULL_TIMEOUT_SEC.
Bounds the OPEN stage only; the streaming stage is bounded by
Self::node_pull_stall_window_sec and Self::node_pull_min_throughput_bps
(#1797).
node_pull_stall_window_sec: u64Throughput-floor window (seconds) on the streaming stage of an upstream pull; bytes
are counted off the QUIC stream sub-frame, so it trips only when throughput falls
below the floor, never on a large blob (#1797). Default
crate::config::DEFAULT_NODE_PULL_STALL_WINDOW_SEC. Also the head start of each
own-origin range-pull read’s time budget (ADR 037).
node_pull_min_throughput_bps: u64Minimum sustained upstream throughput (bytes/sec) over node_pull_stall_window_sec;
0 = idle detection only (#1797). Default
crate::config::DEFAULT_NODE_PULL_MIN_THROUGHPUT_BPS. Also the average throughput
each own-origin range-pull read must sustain after the head start; 0 leaves those
reads unbounded (ADR 037).
eviction_policy: StringCache eviction policy selector (ADR 040). "lru" or "tinylfu".
Default crate::config::DEFAULT_EVICTION_POLICY.
admission_policy: StringCache admission policy selector (ADR 040). "always" or "tinylfu".
Default crate::config::DEFAULT_ADMISSION_POLICY.
tinylfu: ResolvedTinyLfuW-TinyLFU tuning knobs (ADR 040), resolved regardless of whether either
policy selector above is "tinylfu" — cheap to resolve and keeps this
struct free of Option.
serve_economics: ResolvedServeEconomicsRefuse-to-serve economics tuning (ADR 041): the margin policy, its discount, and per-source speculative-warming allowance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResolvedCache
impl RefUnwindSafe for ResolvedCache
impl Send for ResolvedCache
impl Sync for ResolvedCache
impl Unpin for ResolvedCache
impl UnsafeUnpin for ResolvedCache
impl UnwindSafe for ResolvedCache
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> 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 more