pub struct WireEnvelope {
pub dest_peer_addresses: Vec<Vec<u8>>,
pub fills: Vec<SlotFill>,
pub correlation: Option<WireCorrelation>,
pub remaining_deadline_ns: u64,
pub edge_rtt_reports: Vec<EdgeRttReport>,
pub src_peer_bytes: Vec<u8>,
pub schema_version: u32,
pub src_peer_addresses: Vec<Vec<u8>>,
}Expand description
The unit of wire delivery — one delivery to one peer. Per the
analyzer’s batching (ANALYSIS.md §9 analyze_wire_edges), a Send
op with N typed inputs packs all N as fills so one envelope
completes the data-plane DAG.
Fields§
§dest_peer_addresses: Vec<Vec<u8>>Ordered destination address list. The framework’s wire syscall
populates this from the AddressBook at dispatch time — it’s
the resolved snapshot of AddressBook::lookup(peer) at the
moment the envelope was minted. The host’s transport adapter
picks one of these entries based on its networking
capabilities (IPv4 reachability, QUIC support, relay
preference, etc.). Each entry is Address::to_bytes(). See
docs/ADDRESSING.md for the resolution semantics; lookups that
miss surface EngineStep::PeerResolveFailed instead of
producing an envelope.
fills: Vec<SlotFill>One or more slot fills delivered atomically.
correlation: Option<WireCorrelation>Request/response correlation. Control planes MAY use it (Kademlia pairs FindNode ↔ FindNodeReply).
remaining_deadline_ns: u64PLAN tender-noodling-sky Phase 3e-iv — Dapper-style deadline
propagation. Forward-direction envelopes (requests) carry the
sender’s remaining budget for the whole chain. Each receiver
subtracts its own service time before forwarding downstream. A
value of 0 means “no propagated deadline” (the receiver falls
back to its own static per_hop_budget_ns × chain_depth).
edge_rtt_reports: Vec<EdgeRttReport>PLAN tender-noodling-sky Phase 3e-iv — reverse-path piggyback.
Response envelopes attach EdgeRttReport entries describing the
sender’s observed outgoing-edge RTTs. The caller consumes the
reports into AddressBookEntry.reported_outgoing so multi-hop
chain budgets compose from one entry per direct neighbor.
src_peer_bytes: Vec<u8>Phase 10.4 — Multihash bytes of the originating peer (the
sender’s PeerId.to_bytes()). Lets the receiver attribute the
envelope without consulting a separate adapter-side lookup,
which is required for the typed envelope_src_peer runtime
surface (no PeerId(0) fabrication — see Phase 4.4 / theme T5).
schema_version: u32Phase 10.4 — WireEnvelope schema version. Stamped by the
sender (compiler at install seam supplies a single
SCHEMA_VERSION_V1 = 1). Validated by EnvelopeCodec:: decode_capped on every inbound buffer. Surfaces as
EnvelopeDecodeError::VersionMismatch { got, supported } on
disagreement so the receiver REJECTS unknown future versions
rather than mis-parsing them. Bump when any field’s semantics
(not just shape — proto is structurally forward-compatible)
changes in a way old code cannot soundly handle.
src_peer_addresses: Vec<Vec<u8>>Sender-claimed local-address list — the snapshot of the
sender’s AddressBook entry for its own PeerId at the moment
the envelope was minted. Each entry is Address::to_bytes().
The receiver merges the list into its own AddressBook entry
for src_peer so future replies can dial back on any of the
sender’s reachable interfaces. Empty means the sender chose
not to advertise (e.g. local_addresses() was empty); the
receiver leaves its existing entry untouched. Bounded at decode
time by EnvelopeCaps.max_src_peer_addresses +
max_src_peer_address_bytes to cap adversarial pre-allocation.
Trait Implementations§
Source§impl Clone for WireEnvelope
impl Clone for WireEnvelope
Source§fn clone(&self) -> WireEnvelope
fn clone(&self) -> WireEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WireEnvelope
impl Debug for WireEnvelope
Source§impl Default for WireEnvelope
impl Default for WireEnvelope
Source§fn default() -> WireEnvelope
fn default() -> WireEnvelope
Source§impl Message for WireEnvelope
impl Message for WireEnvelope
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for WireEnvelope
impl PartialEq for WireEnvelope
Source§fn eq(&self, other: &WireEnvelope) -> bool
fn eq(&self, other: &WireEnvelope) -> bool
self and other values to be equal, and is used by ==.