pub struct RpcInboundEvent {
pub channel_hash: ChannelHash,
pub origin_hash: u32,
pub from_node: NodeId,
pub payload: Bytes,
}Expand description
One inbound event delivered to a registered RPC dispatcher.
Fields§
§channel_hash: ChannelHashCanonical ChannelHash
(u32) of the channel this event arrived on — widened from the
per-packet wire u16 NetHeader::channel_hash via the
registered-dispatcher table at receive time.
Collision-resistant at realistic scale; the wire u16 may
bucket-collide but the canonical hash uniquely identifies the
registered dispatcher target.
origin_hash: u32Caller’s origin_hash from the packet header (32-bit
routing projection of the AEAD-verified peer’s full
EntityKeypair::origin_hash() — see OriginStamp doc).
The dispatcher should treat this as routing metadata, not
identity authentication.
from_node: NodeIdWire-session peer’s NodeId resolved at packet receive
time from the AEAD-verified session_id. Distinct from
origin_hash: this is the full 64-bit network identity
of the peer that delivered the packet, not a 32-bit
routing projection. Used by RpcClientPending::deliver
to reject spoofed RESPONSE frames whose call_id happens
to match an in-flight request but whose session peer
isn’t the recorded target.
Set to 0 on test / loopback paths that don’t have a
session to resolve against; callers that register
pending entries with target_node = 0 opt out of the
binding gate (and trust the call_id randomness alone).
Production wire-path invariant: real over-the-wire
inbound delivery MUST NOT produce from_node = 0. The
dispatcher in mesh.rs (handle_inbound_user_payload)
drops the event when the wire session has no resolvable
NodeId, rather than forwarding under the sentinel — see
the explicit drop + warn at the
dropping cortex-RPC event: wire session has no resolvable NodeId
log site. The v0.4 capability-auth callee-side gate in
MeshNode::serve_rpc’s bridge relies on this: it skips
permissively when from_node == 0 (loopback compat), so
a wire-path leak of the sentinel would silently re-open
the gate. If you change the dispatcher to fall back to 0
instead of dropping, you ALSO have to teach the bridge
to deny on the sentinel.
payload: BytesEvent payload bytes — the same bytes that would have been
pushed onto the shard inbound queue. For RPC events these
start with a 24-byte EventMeta followed by the
RpcRequestPayload / RpcResponsePayload encoding.
Trait Implementations§
Source§impl Clone for RpcInboundEvent
impl Clone for RpcInboundEvent
Source§fn clone(&self) -> RpcInboundEvent
fn clone(&self) -> RpcInboundEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more