Skip to main content

Module credential

Module credential 

Source
Expand description

A delegated fetch’s voucher credential, which the application swaps when the capability runs low, and the funding signal that says when. The delegate’s voucher credential and its funding signal (ADR 039 § Client SDK funding signal, ADR 003 § Funding recovery).

A delegated client pays from a pool it does not own, under a capability the pool owner signed for its voucher key. It cannot top the pool up. When the capability runs low, the application gets a new one from the owner and pushes it into the fetch’s CredentialSlot. The fetch then retires every lane on the old key at a voucher boundary and opens new lanes under the new key, from the delivered frontier. Nothing is fetched or paid twice.

The fetch computes the signal itself, with no chain read: the capability’s headroom against every voucher signed under its key (earlier fetches’ recorded spend at any provider, plus this fetch’s lanes), the money the remaining work needs at the highest rate a node quoted, and the time to the capability’s expiry (FundingEvent::RunningLow).

Structs§

Credential
One voucher credential: the key that signs vouchers and the capability the pool owner signed for it.
CredentialMismatch
A voucher key that is not the signer its capability names. Every voucher it signed would be refused, so a slot never holds it.
CredentialSlot
A delegated fetch’s voucher credential, which the application can swap at any time. Clones share one slot.

Enums§

CapabilityCause
Why a delegated fetch needs a new capability.
FundingEvent
A delegated fetch’s funding signal (CredentialSlot::funding_events).
FundingNeeded
The typed end of a delegated fetch that no node serves at its funding. It is fatal to the command ([crate::classify]).

Constants§

CREDENTIAL_SWAP_WAIT
How long a delegated fetch, at the exhausted candidate set, waits for the application to swap in a new credential before it ends with FundingNeeded::NewCapability. One minute is time for an application to ask a sponsor gateway for a fresh capability; a fetch with no one to ask sets a zero wait (CredentialSlot::with_swap_wait).