Skip to main content

NodeOriginDeps

Struct NodeOriginDeps 

Source
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: Endpoint

The node’s shared iroh endpoint (dials probes + pulls).

§dial_runtime: Handle

The 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: NodeId

This node’s DHT id, the lookup requester.

§slash_domain: Eip712Domain

EIP-712 domain verifying the delivery slash_sig (ADR 014 §1).

§bind_domain: Eip712Domain

CapacityBond 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: NegativeProbeCache

Requester-side negative-probe cache (drops known-absent providers).

§probe_cache: PositiveProbeCache

Requester-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: NodeOriginConfig

Resolved 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: CacheEngine

The 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§

Source§

impl Debug for NodeOriginDeps

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more