Repository navigation
Description
Summary
StreamResponseBody.redirect: Option<NodeId> is a dead wire field: no node ever populates it, no client ever follows it, yet it is carried on the wire and folded into the EIP-712 signed set (so it is signed as bytes32(0) on every single StreamResponse, and mirrored in the on-chain SlashJudge type-hash). It should be removed now, while we are pre-launch and wire-breaking changes are free. Carrying it to production locks in the cost of ever removing it, because post-launch it becomes a frozen signed field (a Tier-3 ALPN / on-chain-type break).
Per CLAUDE.md: "Pre-launch: wire-breaking changes are fine. … Change the format, update every side in the same PR, and delete the old shape." This is exactly that.
Why it is dead
- Designed by ADR 005 as a redirect-follow flow (response names an alternate
NodeId; client hops to it, max 3 hops, cycle detection). - Forbidden by ADR 041 (
adr/041-refuse-to-serve.md:152-156,:296), the later governing decision: a node emits no redirect or route hint, because it is a client-steering attack surface (a node could point at a colluding, expensive peer). A refused client re-routes through its own discovery (ADR 039) instead. - Never implemented on the client side (Implement cdn/client/v1 paid delivery protocol (StreamRequest, StreamResponse, ChunkData, vouchers) #317): the requester detects a non-
Noneredirect and hard-bail!s rather than following it.
So the field exists only as a reserved-but-inert shape, and the ADR that made it inert is Accepted. There is no in-between populated case — every non-economic decline goes through NotFound/HashBlacklisted/etc. wire errors, never a redirect.
Evidence (current tree)
Producers — all hardcode None:
crates/node/src/handlers/client/dispatch.rs:1074(success / cache-hit path)crates/node/src/handlers/client/window.rs:258(attach/own/mixed fill success)crates/node/src/handlers/client/window.rs:528(origin pull-through success)crates/node/src/handlers/client/wire.rs:164(respond_error— the sole refuse/error builder)
No Some(...) for redirect exists anywhere in non-test node code.
Consumers — parsed then rejected, never acted on:
crates/client-pull/src/lib.rs:1949and:2473—if resp.body.redirect.is_some() { bail!("server returned a redirect; following redirects is out of scope (#317)") }- Out-of-scope note at
crates/client-pull/src/lib.rs:18-21
Signed set (the reason it can't be dropped post-launch):
crates/incentive/src/stream_sig.rs:63(bytes32 redirect;),:92(pub redirect: B256),:108-113(from_response_bodymapsNone → B256::ZERO)- On-chain mirror:
contracts/src/SlashJudge.sol(type-hash string + struct; ~:60,:159,:430) - Frozen-field listings:
crates/protocol/tests/snapshots/public_api__public_api.snapandadr/013-schema-evolution.md:270
Scope / checklist
Single PR, all sides together (wire + signing + on-chain type must change atomically so the off-chain digest keeps matching what SlashJudge recovers):
- Remove
redirectfromStreamResponseBody(crates/protocol/src/client.rs) and its doc comment. - Drop the
Noneliteral at the four producer sites listed above. - Remove the two
redirect.is_some()bail!guards incrates/client-pull/src/lib.rsand the out-of-scope note; drop redirect from any test fixtures. - Remove
redirectfrom the EIP-712 typed data incrates/incentive/src/stream_sig.rs(struct field,B256field,from_response_bodymapping, related unit tests). - Remove
redirectfrom theStreamResponsestruct and type-hash string incontracts/src/SlashJudge.sol; re-runforge fmt/forge testand update any gas snapshots. - Regenerate the public-API snapshot (
crates/protocol/tests/snapshots/...). - Update the ADRs to present-tense canon with the field gone: strike the redirect flow and its mention in the signed set from ADR 005 (
:110,:120-121,:147,:160-168,:437) and ADR 014 (:33,:37,:39,:49), and removeredirectfrom the frozen-field list in ADR 013 (:270). ADR 041 already matches the target state — leave it, but it can cite that the redirect field no longer exists rather than "is never emitted." - Confirm the EIP-712 digest change is consistent across Rust and Solidity (a signing round-trip test that byte-matches
SlashJudge's recovered hash).
Acceptance criteria
redirectappears nowhere incrates/orcontracts/except (optionally) git history.cargo build && cargo clippy && cargo nextest rungreen;forge fmt --check && FOUNDRY_PROFILE=ci forge build && forge testgreen.- The
StreamResponseEIP-712 type is identical betweenstream_sig.rsandSlashJudge.sol, verified by a cross-checked signing test. - ADRs 005/013/014 no longer describe a
redirectwire or signed field; present-tense canon holds (no "used to", no changelog voice).
Out of scope
- The refuse-to-serve / pool-reputation and prepay design work (tracked separately). This issue is purely the dead-field removal.
- Any replacement redirect/route-hint mechanism — ADR 041 deliberately has none.
Notes
- Wire-breaking is acceptable pre-launch; do not add a compat shim or dual-format reader (
CLAUDE.md). - This is a coordinated Rust↔Solidity signed-type change; the
e2efixtures (crates/e2e,anvil-e2e) exercise the real signed path and should be run to confirm the digest change lands cleanly on both sides.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
fix(contracts): regenerate gas snapshot after StreamResponse redirect…
feat(protocol,incentive,contracts)!: remove the dead StreamResponse r…