pub struct NodeOriginDeps {Show 19 fields
pub endpoint: Endpoint,
pub dial_runtime: Handle,
pub routing_table: Arc<Mutex<RoutingTable>>,
pub staker_set: Arc<dyn StakerSet>,
pub origin_directory: Arc<dyn OriginDirectory>,
pub addr_resolver: Arc<dyn NodeAddressResolver>,
pub buyer: Arc<dyn PoolOpener>,
pub self_id: NodeId,
pub slash_domain: Eip712Domain,
pub bind_domain: Eip712Domain,
pub local_rep: Arc<LocalReputation>,
pub negative_cache: NegativeProbeCache,
pub probe_cache: PositiveProbeCache,
pub metrics: Arc<Metrics>,
pub registry_regions: Arc<RwLock<HashMap<NodeId, String>>>,
pub config: NodeOriginConfig,
pub ledgers: Arc<BuyerLedgers>,
pub wedged_providers: Arc<Mutex<HashMap<NodeId, u64>>>,
pub engine: CacheEngine,
}Expand description
Dependencies the orchestration needs, injected once after runtime bring-up
completes (see the module docs). Built and handed to NodeOrigin::provision
by the runtime.
Fields§
§endpoint: EndpointThe node’s shared iroh endpoint (dials probes + pulls).
dial_runtime: HandleThe runtime every upstream dial of a pull leg runs on: the node’s main
runtime, which outlives endpoint’s close.
A pull leg runs on its own current-thread runtime, which drops when the leg
returns. A connection dialled there would lose its QUIC driver with that
runtime, never reach QUIC’s draining state, and hang Endpoint::close at
shutdown. Every upstream dial this node makes, on a pull thread or not, goes
through
PeerSource::with_dial_runtime
with this handle, so every driver lives here.
routing_table: Arc<Mutex<RoutingTable>>DHT routing table handle for find_providers.
staker_set: Arc<dyn StakerSet>Active-staker set (lookup integrity filter).
origin_directory: Arc<dyn OriginDirectory>On-chain origin directory: the fallback when the DHT returns no providers, and the supplement when a ranged pull’s probed holders do not span the blob.
addr_resolver: Arc<dyn NodeAddressResolver>Resolves a provider NodeId to its bonded operator Ethereum address.
buyer: Arc<dyn PoolOpener>Buyer-side payment-channel service (opens/reuses the upstream channel).
self_id: NodeIdThis node’s DHT id, the lookup requester.
slash_domain: Eip712DomainEIP-712 domain verifying the delivery slash_sig (ADR 014 §1).
bind_domain: Eip712DomainCapacityBond EIP-712 bind domain (ADR 005). Used to sign the client
identity binding this node attaches — over its OWN iroh NodeId with
the buyer key — to every node→node pull, so an upstream node can prove
this node owns the named channel and, on its own cache miss, chain a
further reactive origin pull (pull_authorized, #1117). Built from
chain_id + the CapacityBond address, identical to the domain the
serving side verifies against.
local_rep: Arc<LocalReputation>Local per-peer reputation score store (folded on each pull outcome).
negative_cache: NegativeProbeCacheRequester-side negative-probe cache (drops known-absent providers).
probe_cache: PositiveProbeCacheRequester-side positive probe cache (ADR 001 §Probe cache): lets a repeat
miss for a hash inside the TTL skip the DHT lookup and probe fanout
(#1165). Beside the negative cache, and by value for the same reason:
NodeOrigin holds its deps behind Arc<OnceLock<NodeOriginDeps>>, so
every concurrent pull already shares one instance through that Arc, and
the cache’s own Mutex gives it interior mutability behind &self. A
second Arc here would buy nothing but a pointer chase.
metrics: Arc<Metrics>Node metrics for the paid-pull observability counters (#831).
registry_regions: Arc<RwLock<HashMap<NodeId, String>>>The CapacityBond registry’s NodeId → regionHint projection (ADR 030),
read on the selection/pull path to apply the region-latency penalty to a
same-region peer that answers slower than the ceiling.
config: NodeOriginConfigResolved pull tuning.
ledgers: Arc<BuyerLedgers>The live voucher ledger of each provider’s current channel, shared by every
concurrent pull on it (#1145 review). Not a cache — see BuyerLedgers for
why a per-pull ledger collides on the same cumulative amount and what that
costs.
wedged_providers: Arc<Mutex<HashMap<NodeId, u64>>>Providers suppressed from ranking because one rejected our voucher on a reason this
lane cannot recover from — mapped to the first Unix second at which the provider is
rankable again (#1145 review). The horizon is a fixed
WEDGED_PROVIDER_SUPPRESSION_SECS window, not a channel deadline: the buyer pool is
shared across every provider, so it carries no per-provider expiry to key one on.
Keyed by the peer’s DhtNodeId, so probe_and_rank can skip a wedged provider for
ALL hashes, not just the one that wedged it. In-memory: on restart the first miss
re-wedges and re-suppresses within one pull.
engine: CacheEngineThe cache engine this origin admits into. Set at provision, after the
engine exists. The node-to-node pull streams straight into it via
admit_bao_stream, so a whole blob never lands in RAM (#1682).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NodeOriginDeps
impl !RefUnwindSafe for NodeOriginDeps
impl !UnwindSafe for NodeOriginDeps
impl Send for NodeOriginDeps
impl Sync for NodeOriginDeps
impl Unpin for NodeOriginDeps
impl UnsafeUnpin for NodeOriginDeps
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> 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