pub struct ProbeResponse {
pub body: ProbeResponseBody,
pub slash_sig: Vec<u8>,
}Expand description
Node → client response on cdn/probe/v1 (ADR 005 §cdn/probe/v1).
This struct holds only the frozen base (ADR 013 §Tier 1): the signed
ProbeResponseBody and the slash_sig covering it. Unsigned fields live
in ProbeResponseExt, which travels as separate trailing bytes — see
encode_probe_response / parse_probe_response_ext.
The split is what keeps a future unsigned field out of Tier 3. Postcard is
positional and fills no defaults for absent trailing fields, so an
Option<T> appended to this struct would fail to decode against an older
sender that never wrote it; appended to the separately-decoded extension it
costs no coordination at all.
slash_sig is mandatory and non-empty on the wire; requesters MUST reject
missing/zero-length signatures (enforced via ProbeResponse::validate and
the requester’s SLASH_SIG_LEN check).
Fields§
§body: ProbeResponseBodySigned body. Its wire layout is frozen per ADR 013.
slash_sig: Vec<u8>EIP-712 secp256k1 signature over the typed-data hash of body’s
fields {hash, has_blob, rate_per_mb, timestamp_us} (ADR 014 §1; see
decdn_incentive::ProbeSlashData). Always exactly SLASH_SIG_LEN
bytes — not a signature over postcard bytes. The verify path
rejects any other length.
Implementations§
Source§impl ProbeResponse
impl ProbeResponse
Sourcepub const fn validate(&self) -> Result<(), MessageValidationError>
pub const fn validate(&self) -> Result<(), MessageValidationError>
Validate field invariants. The wire-decode path enforces the
rate_per_mb bound automatically via deserialize_rate_per_mb; this
method additionally enforces the requester-side mandatory-slash_sig
rule (ADR 014 §1) and is exposed so construction sites can re-check
before sending and tests can assert validity without a full
encode/decode roundtrip.