pub enum SensingInterestFrame {
CapabilityRegistration {
capability_id: CapabilityId,
constraints: Vec<u8>,
constraints_digest: Digest256,
work_latency: WorkLatencyEnvelope,
providers: ProviderSelector,
result_mode: ResultMode,
interest_digest: Digest256,
requested_sample_interval: Duration,
soft_state_ttl: Duration,
audience_scope: AudienceScopeCommitment,
consumer: u64,
},
ProviderRegistration {
target: u64,
capability_id: CapabilityId,
constraints: Vec<u8>,
constraints_digest: Digest256,
work_latency: WorkLatencyEnvelope,
providers: ProviderSelector,
result_mode: ResultMode,
disclosure_class: DisclosureClass,
audience_scope: AudienceScopeCommitment,
interest_digest: Digest256,
requested_sample_interval: Duration,
soft_state_ttl: Duration,
},
Deregister {
interest_digest: Digest256,
target: Option<u64>,
},
}Expand description
One frame of the sensing-interest subprotocol family (plan §4.2). See the module docs for the two-leg shape and the SI-0/SI-1 boundary.
Variants§
CapabilityRegistration
Consumer → leader: the provider-free capability interest, carrying the full canonical predicate + selector + mode so the leader can re-derive the digest, coalesce BEFORE provider selection, and resolve bounded candidates.
Fields
capability_id: CapabilityIdCapability the predicate targets.
constraints: Vec<u8>Inline canonical constraint bytes C
(super::identity::CanonicalConstraints::canonical_bytes,
≤ max_constraint_bytes).
constraints_digest: Digest256Digest the inline bytes must hash to (truncation/tampering detection, plan §4.2).
work_latency: WorkLatencyEnvelopeProvider-evaluated latency envelope L.
providers: ProviderSelectorThe provider population — the leader needs it to resolve.
result_mode: ResultModeThe result cardinality — the leader needs it to bound exploration.
interest_digest: Digest256The sender’s claimed interest identity. Cross-checked by re-derivation at the leader; never the coalescing identity by itself.
requested_sample_interval: DurationD — the delivery-continuity interval (min-dominance upstream; not identity).
audience_scope: AudienceScopeCommitmentWire scope claim (v1: the owner-root commitment). Cross-checked against the session-proven root, never load-bearing (plan §4.10).
ProviderRegistration
Leader → provider: the provider-targeted readiness interest. The provider evaluates the predicate, not the population — but selector, result mode, and disclosure class ride along for COMPLETE digest verification (review 7 sign-off, plan §4.2): the provider re-derives the full interest identity and signs only the VALIDATED digest, never an opaque claim.
Fields
capability_id: CapabilityIdCapability the predicate targets.
work_latency: WorkLatencyEnvelopeProvider-evaluated latency envelope L.
providers: ProviderSelectorThe provider population. Carried for digest verification only — it never affects provider-side predicate evaluation (plan §4.2, review 7).
result_mode: ResultModeThe result cardinality. Carried for digest verification only.
disclosure_class: DisclosureClassThe disclosure class. Carried for digest verification only.
audience_scope: AudienceScopeCommitmentWire scope claim (cross-checked, never load-bearing); also digest-bound as the interest audience.
interest_digest: Digest256The capability-interest identity this branch serves —
re-derived from the COMPLETE carried fields and validated
at the provider before anything is evaluated or signed
(Self::validate_provider_registration).
Deregister
Withdraw an interest: leader-addressed when target is
None, provider-addressed (one branch) when Some.
Implementations§
Source§impl SensingInterestFrame
impl SensingInterestFrame
Sourcepub fn capability_registration(
spec: &InterestSpec,
requested_sample_interval: Duration,
soft_state_ttl: Duration,
consumer: u64,
) -> Self
pub fn capability_registration( spec: &InterestSpec, requested_sample_interval: Duration, soft_state_ttl: Duration, consumer: u64, ) -> Self
Build the leader-addressed registration for a spec: inline constraint bytes, both digests, and the consumer binding all derived from the same source, so an honest sender cannot produce an internally inconsistent frame.
Sourcepub fn provider_registration(
spec: &InterestSpec,
target: u64,
requested_sample_interval: Duration,
soft_state_ttl: Duration,
) -> Self
pub fn provider_registration( spec: &InterestSpec, target: u64, requested_sample_interval: Duration, soft_state_ttl: Duration, ) -> Self
Build the provider-addressed registration for a resolved branch of a spec. Selector, mode, and disclosure class are carried so the provider can verify the COMPLETE digest it will sign (review 7 sign-off, plan §4.2).
Sourcepub fn reconstruct_spec(
&self,
constraints: CanonicalConstraints,
) -> Option<InterestSpec>
pub fn reconstruct_spec( &self, constraints: CanonicalConstraints, ) -> Option<InterestSpec>
Rebuild the COMPLETE InterestSpec a registration frame
carries, given the already-validated parse of its inline
constraint bytes. None for Self::Deregister (it carries
no spec).
The leader-addressed leg does not carry a disclosure class on
the wire; v1 is owner-root-only (plan §4.10), so it
reconstructs as DisclosureClass::Owner — exactly what
every v1 sender digested.
This is the single reconstruction BOTH legs share; callers
almost always want Self::validated_spec, which also
validates the constraints and cross-checks the re-derived
digest against the frame’s claim.
Sourcepub fn validated_spec(
&self,
counters: &SensingCounters,
) -> Result<InterestSpec, FrameSpecError>
pub fn validated_spec( &self, counters: &SensingCounters, ) -> Result<InterestSpec, FrameSpecError>
The shared registration-intake pipeline (plan §4.2, review 7 — used by BOTH legs: the leader’s gate (r) intake and the provider’s transcript invariant):
- canonicalize + digest-validate the inline constraint bytes
(
validate_interest_constraints, which owns the invalid-constraints/security counting); - reconstruct the COMPLETE
InterestSpecfrom the carried fields (Self::reconstruct_spec); - re-derive
interest_digestand cross-check the frame’s claim — a mismatch is protocol-invalid input (SensingCounters::protocol_invalid); - only then hand back the validated spec. The RE-DERIVED identity — never the claim — is what coalesces at the leader and what the provider signs.
Sourcepub fn validate_provider_registration(
&self,
counters: &SensingCounters,
) -> Result<ValidatedProviderRegistration, FrameSpecError>
pub fn validate_provider_registration( &self, counters: &SensingCounters, ) -> Result<ValidatedProviderRegistration, FrameSpecError>
Provider-side intake for the provider-addressed leg (the SI-1
transcript invariant, review 7 sign-off): the provider must
never evaluate — let alone sign — against an opaque,
unvalidated interest-digest claim. Runs
Self::validated_spec and hands back the validated spec
together with the branch parameters the provider needs.
Checking that target names this node, and that the frame
arrived from an authenticated upstream, is the dispatch
layer’s job (SI-2) — exactly as the leader’s consumer/origin
cross-check lives at ITS intake.
Trait Implementations§
Source§impl Clone for SensingInterestFrame
impl Clone for SensingInterestFrame
Source§fn clone(&self) -> SensingInterestFrame
fn clone(&self) -> SensingInterestFrame
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 SensingInterestFrame
impl Debug for SensingInterestFrame
Source§impl<'de> Deserialize<'de> for SensingInterestFrame
impl<'de> Deserialize<'de> for SensingInterestFrame
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SensingInterestFrame
Source§impl PartialEq for SensingInterestFrame
impl PartialEq for SensingInterestFrame
Source§impl Serialize for SensingInterestFrame
impl Serialize for SensingInterestFrame
impl StructuralPartialEq for SensingInterestFrame
Auto Trait Implementations§
impl Freeze for SensingInterestFrame
impl RefUnwindSafe for SensingInterestFrame
impl Send for SensingInterestFrame
impl Sync for SensingInterestFrame
impl Unpin for SensingInterestFrame
impl UnsafeUnpin for SensingInterestFrame
impl UnwindSafe for SensingInterestFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.