pub struct StreamResponse {
pub body: StreamResponseBody,
pub slash_sig: Vec<u8>,
}Expand description
Node → payer response to a StreamRequest (ADR 005 §cdn/client/v1).
This struct holds only the frozen base (ADR 013 §Tier 1): the signed
StreamResponseBody and the slash_sig covering it. Unsigned fields live
in StreamResponseExt, which travels as separate trailing bytes — see
encode_stream_response / parse_stream_response_ext.
slash_sig is mandatory and non-empty (exactly SLASH_SIG_LEN bytes);
requesters MUST reject missing/zero-length or zero-rate_per_mb responses
(enforced via StreamResponse::validate).
Fields§
§body: StreamResponseBodySigned body. Its wire layout is frozen per ADR 013.
slash_sig: Vec<u8>EIP-712 secp256k1 signature over body’s signed fields (ADR 014 §1;
produced by the decdn_incentive stream slash signer, analogous to its
ProbeSlashData). Always exactly SLASH_SIG_LEN bytes — not a
signature over postcard bytes.
Implementations§
Source§impl StreamResponse
impl StreamResponse
Sourcepub const fn validate(&self) -> Result<(), MessageValidationError>
pub const fn validate(&self) -> Result<(), MessageValidationError>
Validate requester-side invariants (ADR 005, ADR 014 §1, #252):
rate_per_mbwithin(0, MAX_RATE_PER_MB](the decode path already enforces the upper bound viadeserialize_rate_per_mb; this adds the zero-rate rule),slash_sigexactlySLASH_SIG_LENbytes.
The ok/error consistency rule is NOT here: error lives in
StreamResponseExt, which this method cannot see. A receiver must also
call StreamResponseExt::validate with body.ok.
Exposed so requesters re-check on receive and construction sites assert validity before signing.