Skip to content

refactor!: name the operator stream signature for what it is - #2939

Merged
thiras merged 13 commits into
mainfrom
refactor/2917-operator-sig
Nov 22, 2026
Merged

thiras merged 13 commits into
mainfrom
refactor/2917-operator-sig

Conversation

@thiras

@thiras thiras commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

This is a follow-up to #2938, which is merged. With slashing retired, the StreamResponse signature is the operator's signature over its answer, not slash evidence. This PR renames it everywhere. Behaviour does not change.

Before After
slash_sig (wire field, receipt JSON key, helpers) operator_sig
SLASH_SIG_LEN OPERATOR_SIG_LEN
InvalidSlashSigLen InvalidOperatorSigLen
StreamSlashData / StreamSlashError StreamSigData / StreamSigError
slash_domain / slash_dom / HandlerDomains.slash stream_domain / stream_dom

The ADR prose follows, and so does the ADR 017 P-23 heading with its one inbound anchor.

Refs #2917

Breaking

  • Public API: decdn-protocol and decdn-client; both snapshots are regenerated.
  • Receipt JSON: the slash_sig key is now operator_sig.
  • decdn probe: the --json key slash_sig is now operator_sig, and so is the text label. A script that reads .slash_sig gets nothing.
  • decdn-incentive public API: StreamSlashData / StreamSlashError are now StreamSigData / StreamSigError. This crate has no public-API snapshot, so no gate flags the change.
  • Wire bytes: unchanged. Postcard encodes fields by position, not by name. Neither SDK names the field.

Reviewer notes

Verification

  • cargo clippy --workspace --all-targets --all-features -- -D warnings: exit 0
  • CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items: exit 0
  • cargo nextest run --workspace: 6092 passed
  • Public-API snapshots (decdn-protocol, decdn-client) regenerated
  • anvil e2e: decdn-e2e 141 passed; decdn-node anvil 5 passed
  • make -C adr check-refs check-book-list: exit 0
  • pre-commit hooks pass on commit
  • The pr-review-toolkit pass (code and comments) is addressed in fix: address the #2939 review. A probe test now pins every output value at column 17; a mutation check confirms it catches the misalignment.

🤖 Generated with Claude Code

thiras and others added 3 commits November 22, 2026 19:25
No slashable offense remains, so the slashing machinery and everything
that exists only to support it goes.

Contracts: delete SlashJudge, SlashAppeal, SlashEscrowLib and their
interfaces. CapacityBond drops slash, the tier ladder, offense counts,
escrow and appeal settlement, SLASH_ROLE / SLASH_APPEAL_ROLE and the
evidence-age cross-check. The unbonding window is gone: unbond(amount)
returns TOKEN in the same transaction, bounded by the bond curve.
DecdnGovernor no longer zeroes vote weight on a slash.

Signatures: StreamResponse and OriginAttestation sign under the
CapacityBond EIP-712 domain, the one bindingSignature already uses.
slash_judge_address / slash_appeal_address leave the config, flags,
manifest, gateway, onramp installers and SDK examples.

Rust: delete the node slash watcher, its metrics and admin_v1_slashes,
the incentive SlashJudge/SlashAppeal bindings, `decdn appeal slash` and
`decdn node slashes`. `decdn node unbond` and `rotate-key --key eth`
exit in one step. TERMS.md drops the slashing wording (new terms hash).

Docs: retire ADR 014 and ADR 028 to adr/_history; the StreamResponse
signature scheme moves to ADR 005 § Signer binding. ADR 003, 005, 009,
011, 016, 019, 026, 030, 036 and the appendices drop slashing and the
unbonding window.

Closes #2917

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With slashing retired, the StreamResponse signature is the operator's
signature over the answer, not slash evidence. Rename it everywhere:

- slash_sig -> operator_sig (wire field, receipt JSON key, helpers)
- SLASH_SIG_LEN -> OPERATOR_SIG_LEN
- InvalidSlashSigLen -> InvalidOperatorSigLen
- StreamSlashData / StreamSlashError -> StreamSigData / StreamSigError
- slash_domain / slash_dom / HandlerDomains.slash -> stream_domain /
  stream_dom

No behavior change. The postcard encoding is positional, so the wire
bytes are identical; the receipt JSON key and the public API of
decdn-protocol and decdn-client change.

Refs #2917

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras thiras self-assigned this Nov 22, 2026
thiras and others added 9 commits November 22, 2026 19:47
- CapacityBond: a full exit (unbond below the activation floor) clears
  firstBondedAt and the floor, so bonding minBond and withdrawing it in
  one transaction cannot pre-age an address. bond and registerNode share
  one entry transition that records the live minBond and starts tenure
  when none runs; isActive requires a recorded floor.
- decdn node unbond: a broadcast unbond whose receipt was not read no
  longer reports "no transaction landed"; the resume hint and the
  write-error ordering follow `decdn node bond`.
- rotate-key --key eth: an inactive operator that still holds a tier
  clears it with declareMbps(0) before the unbond.
- sponsord-onramp: MIN_DECDN_RELEASE is v0.4.0, the first decdn get that
  verifies under the CapacityBond domain.
- Tests for the tenure reset, the unbond resume hints, the eth-rotation
  tier clear and annotate_cache_miss's deposit branch; dead e2e helpers
  removed.
- Docs: tenure rule (ADR 003, 019, 026, 036), ADR 016 deploy-order
  diagram, RegisterNode binding and ejection (ADR 003, 011), boot reads
  (ADR 019, observability), and stale slash-era comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- CapacityBond: a tenured operator's bond() records no entry, so a
  top-up keeps its grandfathered floor through a raised minBond; only a
  bond while no tenure runs, or registerNode, records the live minBond.
  Tests pin the unbond floor comparison against a raised and a lowered
  minBond, the tenured top-up, eject -> tenure end -> re-entry, and a
  Governor vote after a tenure reset.
- rotate-key --key eth: the unbond phase asks first and discloses the
  tenure end and the tier it clears; the tier also reaches stderr when
  the receipt write fails. A calldata test pins declareMbps(0) before
  unbond.
- decdn node unbond / bond: the no-recorded-tx hint covers a send whose
  broadcast is unknown. unbond reports a registered operator with no
  tenure as already inactive.
- sponsord-onramp: the tag-shape and digest guards are tested above the
  v0.4.0 minimum; the rejection names both reasons for it.
- annotate_cache_miss: the NotFound filter is tested; the redundant
  rate-0 guard is gone.
- Docs: one tenure rule (ADR 036), linked from ADR 003, 009, 019, 026
  and README; "ends the tenure" vs "full exit"; ADR 036 snapshot
  invariant; NodeInfo matches the contract; ADR 016 diagram; stale
  firstBondedAt / isActive / phase-4 comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/cli/src/commands/fetch/tests.rs
- decdn probe: the operator_sig row lines up with the other rows again;
  a test pins every value at column 17.
- Two comments still framed the signature as slash evidence.
- "a `operator_sig`" -> "an `operator_sig`" in ADR 012, 017, 022, 024
  and a node test; a test local holding signed data is `sig_data`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Base automatically changed from feat/2917-retire-slashing to main November 22, 2026 19:29
@thiras
thiras marked this pull request as ready for review November 22, 2026 19:30
Copilot AI balanced review requested due to automatic review settings November 22, 2026 19:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the operator-attribution signature rename.

No open issues 🎉

What changed in this PR

Follows #2938’s removal of slashing by naming the stream-response signature for its remaining purpose: operator attribution. The rename spans deCDN’s protocol, signing helpers, client, node, and CLI without changing wire bytes or signature verification.

Changes:

  • Renames signature fields, constants, errors, helpers, and domain variables to operator/stream terminology.
  • Updates breaking public APIs and receipt/probe JSON keys, regenerates API snapshots, and adds probe-output alignment assertions.
  • Aligns ADR terminology and the privacy-section anchor with the new names.
File Description
crates/​protocol/​tests/​snapshots/​public_api__public_api.snap Records renamed protocol exports.
crates/​protocol/​src/​message.rs Renames signature length constant and validation error.
crates/​protocol/​src/​lib.rs Updates protocol re-exports and documentation.
crates/​protocol/​src/​dht/​tests.rs Updates attestation signature-length tests.
crates/​protocol/​src/​dht.rs Renames the attestation signature deserializer.
crates/​protocol/​src/​client/​tests.rs Updates response validation and wire-format tests.
crates/​protocol/​src/​client.rs Renames the response signature field and validation references.
crates/​node/​tests/​support/​mod.rs Renames the shared handler domain field.
crates/​node/​tests/​partial_serve.rs Updates partial-serving domain fixtures.
crates/​node/​tests/​origin_range_pull.rs Updates origin-range domain fixtures.
crates/​node/​tests/​node_to_node_pull_through.rs Updates upstream signing helpers and domain references.
crates/​node/​tests/​client_loopback.rs Updates loopback signing and verification references.
crates/​node/​tests/​anvil_settlement_e2e.rs Updates settlement test domain references.
crates/​node/​src/​runtime/​mod.rs Renames stream-domain wiring throughout node startup.
crates/​node/​src/​node_origin/​pull_leg.rs Updates upstream pull domain references.
crates/​node/​src/​node_origin/​mod.rs Renames upstream domain fields and attribution terminology.
crates/​node/​src/​handlers/​timestamp_skew.rs Updates signature terminology in comments only.
crates/​node/​src/​handlers/​client/​wire.rs Updates response signing to renamed helpers and fields.
crates/​node/​src/​handlers/​client/​tests.rs Updates response-signature verification assertions.
crates/​node/​src/​handlers/​client/​mod.rs Renames handler signing dependencies and domain fields.
crates/​node/​src/​dht/​records/​tests.rs Updates attestation fixture signature lengths.
crates/​node/​src/​dht/​node_address.rs Updates operator-attribution documentation only.
crates/​node/​src/​dht/​candidate_cache.rs Updates signature-retention documentation only.
crates/​node/​src/​dht/​attestation/​test_support.rs Updates the attestation fixture constant.
crates/​incentive/​src/​stream_sig/​tests.rs Updates signing-data and verification-error names.
crates/​incentive/​src/​stream_sig.rs Renames signing data, errors, and diagnostic wording.
crates/​incentive/​src/​origin_attestation/​tests.rs Updates the cross-signature rejection test helper.
crates/​incentive/​src/​origin_attestation.rs Uses the renamed signature error type.
crates/​incentive/​src/​lib.rs Re-exports renamed signing helpers.
crates/​e2e/​tests/​cli_receipt.rs Updates receipt-signature tampering tests.
crates/​e2e/​src/​client.rs Renames fixture stream-domain fields and usages.
crates/​common/​src/​config/​types.rs Updates configuration field documentation only.
crates/​common/​src/​config/​mod.rs Updates validation comments only.
crates/​common/​src/​cli/​run.rs Updates CapacityBond CLI help terminology.
crates/​common/​src/​cli/​probe.rs Updates expected-signer CLI help terminology.
crates/​common/​src/​cli/​node.rs Updates key-rotation documentation only.
crates/​common/​src/​cli/​fetch.rs Updates fetch CLI help terminology.
crates/​client/​tests/​snapshots/​public_api__public_api.snap Records the renamed receipt signature field.
crates/​client/​src/​tests.rs Updates signed-response validation and retention tests.
crates/​client/​src/​targets/​tests.rs Updates the verification-error test message.
crates/​client/​src/​targets.rs Renames discovery domain parameters and references.
crates/​client/​src/​source.rs Renames the peer source’s borrowed stream domain.
crates/​client/​src/​source_set/​tests.rs Updates the refusal-response fixture.
crates/​client/​src/​receipt/​tests.rs Updates signature tests and pinned receipt JSON.
crates/​client/​src/​receipt.rs Renames the receipt field, JSON key, and verification references.
crates/​client/​src/​quote.rs Renames census stream-domain variables.
crates/​client/​src/​opened/​tests.rs Updates the stream-domain test variable.
crates/​client/​src/​opened/​fake_node.rs Updates fake-node response signing.
crates/​client/​src/​opened.rs Renames open-stage domain parameters.
crates/​client/​src/​lib.rs Updates pull APIs, verification references, and diagnostics.
crates/​client/​src/​lanes/​tests.rs Updates lane dependency fixtures.
crates/​client/​src/​lanes.rs Renames the lane dependency’s stream-domain field.
crates/​client/​src/​lane_sources/​tests.rs Updates lane-source domain fixtures and usages.
crates/​client/​src/​driver/​tests.rs Updates refusal fixtures and signature-test comments.
crates/​client/​src/​discovery.rs Updates discovery attribution documentation only.
crates/​client/​src/​connection/​tests.rs Renames connection-test domain variables.
crates/​client/​src/​bundle/​engine.rs Renames bundle pull context domain references.
crates/​client/​src/​bundle.rs Updates bundle stream-domain initialization.
crates/​client/​examples/​common/​mod.rs Updates example buyer domain fields and usages.
crates/​cli/​tests/​admin_rpc.rs Updates the DHT attestation fixture constant.
crates/​cli/​src/​commands/​probe/​tests.rs Pins the renamed JSON key and aligned text output.
crates/​cli/​src/​commands/​probe.rs Renames probe signature data, JSON key, and text label.
crates/​cli/​src/​commands/​node/​tests.rs Updates fake-node signing helpers.
crates/​cli/​src/​commands/​node.rs Renames the node-ranking stream-domain variable.
crates/​cli/​src/​commands/​fetch/​tests.rs Updates signed-refusal test helpers.
crates/​cli/​src/​commands/​fetch.rs Updates fetch domain wiring and terminology.
adr/​glossary.md Renames the signature in its glossary definition.
adr/​appendix-pull-receipts.md Updates receipt terminology and the privacy anchor link.
adr/​appendix-operator-key-rotation.md Updates operator-signature terminology throughout the runbook.
adr/​024-account-abstraction.md Updates signature terminology in wallet constraints.
adr/​022-content-discovery.md Updates coverage-consistency signature terminology.
adr/​019-node-onboarding.md Updates signature terminology in wallet guidance.
adr/​017-privacy.md Renames P-23 terminology and its heading anchor.
adr/​013-schema-evolution.md Updates the example response field name.
adr/​012-client.md Updates rate-commitment signature terminology.
adr/​005-protocol.md Updates protocol diagrams and signature terminology.
adr/​003-payments.md Updates signature terminology in domain documentation.

Review effort: Balanced

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main bb063fb refactor/2917-operat... e6da55a +/-
77% 77% 0%
View coverage of the 10 most impacted files.
File main bb063fb refactor/2917-operat... e6da55a +/-
crates/node/src/dht/publish.rs 79% 77% -2%
crates/cli/src/...ds/chain_ctx.rs 72% 70% -2%
crates/node/src/runtime/mod.rs 27% 27% 0%
crates/client/src/targets.rs 80% 81% +1%
crates/e2e/src/chain.rs 9% 11% +2%
crates/cli/src/...ommands/node.rs 67% 69% +2%
crates/cli/src/...mmands/fetch.rs 42% 45% +3%
crates/cli/src/...mands/unbond.rs 45% 56% +11%
crates/incentive/src/tx.rs 78% 91% +13%
crates/cli/src/...tate_key/eth.rs 25% 42% +17%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@thiras
thiras merged commit cec7f1c into main Nov 22, 2026
38 checks passed
@thiras
thiras deleted the refactor/2917-operator-sig branch November 22, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants