Expand description
Implementations of the v1 API traits and the v2 tonic service traits, both reading the one data source this type wraps.
StructsΒ§
- Node
ApiState Impl - Node API state implementation
ConstantsΒ§
- FETCH_
TIMEOUT π - Timeout for failing requests due to missing data.
- MAX_
NAMESPACES_ πPER_ REQUEST - Bounds the namespace list of a v2 multi-namespace light-client request, as the URL length bounds v1βs, since every namespace costs a lookup in every block of the range.
- NAMESPACE_
PROOF_ πRANGE_ LIMIT
TraitsΒ§
- State
Signature πData Source Erased - Submit
Data πSource Erased - Network-agnostic submit hook used by the axum wrapper. The original
SubmitDataSource<N, P>trait is parameterized by the network type; this erased trait letsNodeApiStateImplavoid carrying those parameters.
FunctionsΒ§
- bad_
request π - block_
id_ πfrom_ query - block_
id_ πto_ hs - block_
ident π - v1 spells the three ways of naming a block as separate routes, so v2βs optional parameters carry the same choice, with neither given meaning the latest block.
- catchup_
at π - The
(height, view)the catchup routes over a merkle tree are asked for. - classify_
query_ πerror - end_
at_ πfirst_ error - A conversion error is sent as an
event: errorframe. Ending the stream there means a subscriber that skips the frame cannot miss a height without noticing. - enforce_
range π - explorer_
error π - Like
lc_error, for explorer data source errors. - fetch_
supply_ πinputs - header_
query π - large_
object_ πrange_ limit - lc_
error π - Convert a query-service error to an
AvailabilityError-carrying anyhow error so the HTTP layer returns the status carried by the error (400/404) instead of 500. - lc_
large_ πobject_ range_ limit - lc_
leaf_ πproof_ chain_ limit - Bounds the leaves in a single leaf proof, and so the memory to build and serialize it.
- leaf_
query π - namespace_
from_ πquery - namespace_
id π - Namespace ids are 32 bits on chain but travel as uint64 so they round-trip with the
responsesβ
namespacefields. Anything wider is a client error, not a truncation. - node_
window_ πlimit - not_
found π - payload_
id_ πto_ hs - range_
exceeded π - range_
from_ πquery - ranges_
from_ πbody - required π
- serialize_
tree π - A tree travels as bincode, the encoding peers already decode from v1 and from the v2 reward tree route.
- small_
object_ πrange_ limit - snapshot_
from_ πquery - state_
cert_ πerror - transaction_
ident π - As
block_ident, except that naming a transaction by position takes bothheightandoffset, so half of that pair is a bad request rather than a fallback to the latest. - validate_
ranges π - Check a ranges request against the same per-request object limit the range endpoints enforce, and convert it for the data source.