Repository navigation
docs(adr): resolve corruption at the wire — drop ADR 014 §2 + OffenseType.Corruption - #480
Conversation
…e-level resolution Progressive BLAKE3 verification at the client (already mandatory in cdn/client/v1) plus post-verification voucher signing means a client never pays for corrupt bytes — detection drops the connection before any voucher commits to the bad window. The on-chain slash path that ADR 014 §2 specified, and that ADR 030 (PR #477) attempted to upgrade to a Merkle-bisection scheme, is solving a non-problem: corruption is caught at the wire and absorbed by the existing voucher cadence. This commit removes the forward reference from §Corrupted delivery to ADR 014 §2, replacing it with the wire-level explanation and a parallel framing to §Voucher withholding for the bidirectional risk cap. Follow-up: remove ADR 014 §2 itself and drop OffenseType.Corruption from the enum. Refs: PR #477 (closing), issue #387 (closing). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates ADR 003 to replace the on-chain slashing mechanism for content corruption with a wire-level progressive BLAKE3 verification strategy, where vouchers are withheld for corrupt data. A review comment identifies a stale reference to the old slashing mechanism in the 'Negative consequences' section that should be removed to maintain internal consistency.
…nces Per gemini-code-assist review on PR #480: the §Negative bullet referencing "intermediate scheme for slash evidence" via ADR 014 is no longer applicable now that corruption is resolved at the wire. Removing it to keep ADR 003 internally consistent with the new §Corrupted delivery resolution. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Addressed in 29a219e — removed the stale §Negative consequences bullet that referenced ADR 014's intermediate slash scheme. Thanks for catching it. |
…eType.Corruption Cascading follow-up to the wire-level corruption resolution in §Corrupted delivery (this branch's first commit). Since corruption is fully absorbed at the wire by progressive BLAKE3 verification + post-verification voucher signing, there is no on-chain corruption-slash path to specify. Removed: - ADR 014 §2 (BLAKE3 Content Corruption — Optimistic Challenge-Response) - OffenseType.Corruption from the enum - submitCorruptionChallenge / counterChallenge / resolveChallenge from ISlashJudge - DeliveryReceipt typedef - The §3 → §2 / §4 → §3 renumbering of remaining sections - Corruption gas-table row, maxActiveChallenges entry, evidenceHash preimage All four remaining offenses (Phantom, RateManipulation, Blacklist, ReceiptFraud) now resolve synchronously at submit time — no counter-evidence window for any. Cascading updates across ADRs: - ADR 016: drop submitCorruptionChallenge from contract diagram + function table - ADR 024: drop submitCorruptionChallenge AA digest row - ADR 027: detach contentRoot from the (removed) ADR 014 §2 production path, inline the per-stream chunk-tree construction, mark as informational - ADR 028: update offense-type counts and section-§2 cross-refs - ADR 008: drop the now-false slashing-deterrent claim from the 40% correctness-weight footnote; replace with reputation + economic (no-payment-on-failed-delivery) framing - ADR 011: repoint MAX_EVIDENCE_AGE_US references to §Evidence Staleness - appendix-poc-production-seams: drop CorruptionChallenger trait, drop Corruption verification row, renumber affected seam sections - appendix-operator-key-rotation: update §3 reference and drop corruption-challenge counter-evidence mention - architecture.md: drop "optimistic challenge-response for corruption" from the ADR 014 description Refs: PR #477 (closed), issue #387 (resolved-no-action). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request removes content corruption as an on-chain slashable offense, shifting the responsibility for verification to the client via progressive BLAKE3 checks at the wire level. Consequently, the optimistic challenge-response mechanism and the 24-hour counter-evidence window are removed from the SlashJudge contract, and several ADRs are updated to reflect this architectural shift. Feedback indicates that removing 'Corruption' from the OffenseType enum violates the documented append-only rule, which could break ordinal-based indexing in consumer contracts like SafetyReserve. Additionally, the documentation for the new submitReceiptFraudChallenge function is missing a required external call to FeeRouter.epochSummary().
| /// and append-only — new offense types extend the enum at the end so existing | ||
| /// `slashId` allocations remain stable. | ||
| enum OffenseType { Corruption, Phantom, RateManipulation, Blacklist, ReceiptFraud } | ||
| enum OffenseType { Phantom, RateManipulation, Blacklist, ReceiptFraud } |
There was a problem hiding this comment.
Removing Corruption from the beginning of the OffenseType enum will shift the ordinals of all subsequent offense types. While this is a Draft/PoC, the text on line 224 explicitly states that the order is "contract-canonical and append-only" and that "existing entries MUST NOT be reordered" because consumer contracts (like SafetyReserve) index by ordinal. To maintain ordinal stability and adhere to the documented rule, consider keeping Corruption as a deprecated placeholder or explicitly noting that this is a breaking change for the PoC.
References
- Ensure protocol documentation is internally consistent by verifying that function descriptions, field lists, and edge-case logic are aligned across all sections of the document.
- Require slashing contracts to emit unique, monotonic identifiers for all offense types to support precise appeal referencing.
| | `submitPhantomChallenge()` | `IERC20.safeTransferFrom()` (TOKEN bond deposit), `StakingRegistry.slash()`, `IERC20.safeTransfer()` (slash reward + bond return on success) | `nonReentrant`, checks-effects-interactions | | ||
| | `submitRateChallenge()` | `IERC20.safeTransferFrom()` (TOKEN bond deposit), `StakingRegistry.slash()`, `IERC20.safeTransfer()` (slash reward + bond return on success) | `nonReentrant`, checks-effects-interactions | | ||
| | `submitBlacklistChallenge()` | `IERC20.safeTransferFrom()` (TOKEN bond deposit), `ContentBlacklist.getEntry()` (read), `StakingRegistry.slash()`, `IERC20.safeTransfer()` (slash reward + bond return on success) | `nonReentrant`, checks-effects-interactions | | ||
| | `submitReceiptFraudChallenge()` | `IERC20.safeTransferFrom()` (TOKEN bond deposit), `StakingRegistry.slash()`, `IERC20.safeTransfer()` (slash reward + bond return on success) | `nonReentrant`, checks-effects-interactions | |
There was a problem hiding this comment.
The "External Calls" list for submitReceiptFraudChallenge() is missing the required call to FeeRouter.epochSummary(). Adjudicating receipt fraud requires retrieving the operator's committed aggregateRoot from the FeeRouter contract to verify the provided Merkle proofs. This dependency should also be reflected in the cross-contract call graph and diagram (lines 458-498).
| | `submitReceiptFraudChallenge()` | `IERC20.safeTransferFrom()` (TOKEN bond deposit), `StakingRegistry.slash()`, `IERC20.safeTransfer()` (slash reward + bond return on success) | `nonReentrant`, checks-effects-interactions | | |
| | `submitReceiptFraudChallenge()` | `IERC20.safeTransferFrom()` (TOKEN bond deposit), `FeeRouter.epochSummary()` (read), `StakingRegistry.slash()`, `IERC20.safeTransfer()` (slash reward + bond return on success) | `nonReentrant`, checks-effects-interactions | |
References
- Ensure protocol documentation is internally consistent by verifying that function descriptions, field lists, and edge-case logic are aligned across all sections of the document.
- When refactoring or removing protocol features, perform a comprehensive update of all related documentation, including ADR tables and diagrams, to eliminate stale references.
…aud row Two follow-ups from gemini-code-assist review of 3ba8973: 1. ADR 014: drop the historical "earlier drafts" narrative from the Context section and the "append-only / MUST NOT be reordered / SafetyReserve indexes by ordinal" prose around the OffenseType enum. There's no contract deployed and no consumer indexing by ordinal — the apparatus wasn't load-bearing yet. 2. ADR 016: add `FeeRouter.epochSummary()` (read of the operator's `aggregateRoot` for the challenged `(operator, epochId)`) to the `submitReceiptFraudChallenge` external-calls list. This is the on-chain dependency for verifying receipt-fraud Merkle proofs. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Addressed in eb68ead:
|
…esolution removed the threat (#501) Closes #494. The `##### Challenge rate limit` subsection in ADR 014 and its row in ADR 009's governable-parameters table are stale artifacts of the previous async dispute design. After PR #480 dropped `OffenseType.Corruption` and §2's optimistic challenge-response, all remaining offense types (Phantom, RateManipulation, Blacklist) resolve synchronously at submit time — ADR 014 lines 147–150 and §Bond Handling line 199 already concede this. Spurious challenges revert without bond transfer (line 200) so there is nothing for a defender to monitor or dispute off-chain; valid challenges deserve to slash. Operator-side appeals live in ADR 028 against `SafetyReserve` with their own deterrents and don't motivate a `SlashJudge`-side cap. No contract code is affected — `crates/contracts/` is empty. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Replaces ADR 003's
§Corrupted deliveryforward-reference to ADR 014 §2's optimistic challenge-response (and the in-progress ADR 030 Merkle-bisection upgrade in #477) with the actual resolution: progressive BLAKE3 verification at the client + post-verification voucher signing means corruption is fully absorbed at the wire and never results in payment for corrupt bytes.Why drop the on-chain slash path
For corruption slashing to add value over progressive BLAKE3 + voucher cadence, there has to be a scenario where:
Step 2 doesn't hold. iroh-blobs surfaces bao-verified chunks at the leaf level — verification completes within microseconds of each chunk arrival, well before any voucher boundary. Vouchers are signed only after the corresponding chunks have been verified, so a corrupt window yields no voucher. Client monetary loss in the corruption case is zero.
The "node signs wrong
merkle_root(R)" attack only manifests as observable harm if the node also ships matching wrong bytes — at which point it's the same as wire corruption, caught by BLAKE3 streaming. R itself is never observable to anyone in the corruption case.What this PR changes
One paragraph in
adr/003-payments.md§Corrupted delivery:voucher_intervalrisk capFollow-up (separate PRs)
OffenseType.Corruptionfrom the enum (no contract path slashes on it after §2 is gone)Test plan
#voucher-withholdingresolves🤖 Generated with Claude Code