Repository navigation
docs(adr): pin slashId, MMR, gauge-pause, advisory diversity (#453) - #457
Conversation
Resolves the four in-scope items from the issue #453 execution-risk register by amending the parent ADRs in place; Risk 3 remains tracked at decdn/finance#3. Risk 1 — ADR 014 §3 + ADR 028 §6: add OffenseType enum and Slashed event to ISlashJudge with globally-monotonic slashId allocated inline with StakingRegistry.slash() and per-offense abi.encode() preimage for evidenceHash; ADR 028 §6 forward-references the canonical 014 spec. Risk 2 — ADR 027 §4: pin per-(operator, epochId) rolling MMR accumulator on FeeRouter as MUST (was SHOULD), with domain-separated leaf/internal/peak-bagging hashes (0x00/0x01/0x02), explicit bagging pseudocode, peakHeight + (numPeaks - 1) proof bound, and governance-tunable MMR_RETENTION_BUFFER. Adds matching gas-validation entry to appendix-l2-deployment.md. Risk 4 — ADR 027 §3: tag funding-source diversity criterion as advisory pending ADR 017 storage-proof verification; load-bearing abuse-cost floor restated dimensionally as USDC + rotation cycle. Risk 5 — ADR 026 §2 (canonical home) + ADR 027 §9: pin pre-receipt launch FeeRouter accumulator with gaugeLaunched flag, preLaunchGaugeAccumulator mapping, and one-shot enableGauge() governance setter. Documents partial-epoch cutover behavior, ve- snapshot reuse for retroactive claims, and 26-epoch claim window re-anchored to gaugeLaunchEpoch. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates the protocol ADR documentation to resolve execution-risk items from #453 by pinning previously underspecified contract-surface decisions (slashId emission + evidence hashing, receipt accumulator choice, gauge-pause mechanism) and clarifying what is v1-advisory vs v1-enforced, plus reflecting the new gas-validation surfaces in the L2 deployment appendix.
Changes:
- Canonicalizes
OffenseType, a globally monotonic non-zeroslashId, and theSlashed(...)event (with per-offenseevidenceHashpreimages) in ADR 014, and updates ADR 028 to reference it. - Pins the per-(operator, epochId) rolling MMR accumulator for receipt-root aggregation in ADR 027, and clarifies funding-source diversity as advisory at v1.
- Pins the “gauge-pause until receipts ship” mechanism (
gaugeLaunched+preLaunchGaugeAccumulator+ one-shotenableGauge()) in ADR 026, with ADR 027/appendix references updated accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| adr/appendix-l2-deployment.md | Updates tokenomics validation requirements to include MMR commit costs and adds explicit validation gates. |
| adr/028-slashing-appeals.md | Aligns the appeals surface with ADR 014’s canonical Slashed/slashId spec and clarifies evidence-hash linkage. |
| adr/027-distinct-client-receipts.md | Pins the MMR accumulator design, adds retention/proof details, and marks funding-source diversity as v1-advisory with rationale. |
| adr/026-gauge-boost-tokenomics.md | Specifies the pre-receipt-launch gauge escrow state machine and the one-shot governance cutover. |
| adr/014-on-chain-verification.md | Defines OffenseType, specifies Slashed event semantics, and documents slashId allocation + evidenceHash construction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request refines the protocol's slashing and tokenomics specifications across multiple ADRs. Key changes include the introduction of a canonical Slashed event and monotonic slashId in ADR 014, a pre-launch escrow mechanism for gauge rewards in ADR 026, and the adoption of a Merkle Mountain Range (MMR) accumulator for receipt verification in ADR 027. Additionally, the funding-source diversity criterion is now advisory for v1. Review feedback highlights a redundancy in the evidenceHash preimage for certain offenses and an inconsistency between the prose and pseudocode regarding the MMR peak bagging algorithm.
- ADR 027 §4: drop `address operator` from `commitEpochReceiptRoot` signature; align with §1 / ADR 016 (operator = msg.sender). - ADR 026 §2: rename `claimGauge` to canonical `claimBoost`; correct the pre-launch revert condition to gate on `gaugeLaunched == false` (the previous `epoch < gaugeLaunchEpoch` check was vacuous because `gaugeLaunchEpoch == 0` pre-launch). - ADR 027 §4: remove `MMR_RETENTION_BUFFER` mis-attribution to ADR 009 (which does not enumerate the parameter); state bounds are defined here on FeeRouter and flag the paired ADR 009 update as a follow-up. - ADR 014 §3: drop redundant `blobHash` from `evidenceHash` preimage for Blacklist and Corruption — the EIP-712 `*Response` struct hash already commits to the `hash` field, and §3 evidence verification binds `responseData.hash == blobHash`. - ADR 027 §4: rewrite peak-bagging prose to match the pseudocode (initialise from shortest peak, walk index high→low toward tallest) and replace ambiguous Rust-style range syntax with `down to`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- ADR 014 §3: prefix every `evidenceHash` preimage with `uint8(offenseType)`. Prevents `evidenceHash` collision when two distinct offenses fire on overlapping evidence (e.g., a single (probe, stream) pair with `ok=false` AND `streamRate>probeRate` satisfies both phantom and rate-manipulation verification). `slashId` was already unique per slash, but `evidenceHash` now is too — appeals can pin (slashId, evidenceHash) without ambiguity. - ADR 027 §4: rewrite `epochAggregateRoot` NatSpec to match the pseudocode (shortest-first init, taller peaks accumulate on the LEFT). The previous "highest height to lowest" wording would mislead an implementer reading top-down. - ADR 027 §4: pin domain-tag encoding as `abi.encodePacked(bytes1(0xNN), <fields>)` — single-byte prefix, no length, no padding. Removes ambiguity for an auditor. - ADR 027 §4: correct `commitEpochReceiptRoot` doc-comment cross-references — point at §4 prose (line 126) for the `msg.sender = operator` rule and ADR 016 §3 (cross-contract call graph) instead of the non-existent ADR 016 §FeeRouter. - ADR 026 §2: tighten cutover bullet — explicitly state that after `enableGauge()` returns, `claimBoost(epochs[])` no longer reverts for any epoch ≥ 0. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Closes I2 from the second-pass review: ADR 027 §4 introduced `MMR_RETENTION_BUFFER` as a governable parameter but ADR 009's canonical parameter table didn't enumerate it. - ADR 009 § Other protocol parameters: add `MMR retention buffer` row (FeeRouter, 1d–30d) to the table and a matching rationale bullet covering challenge-window-tail resolution vs L2 storage growth tradeoffs. - ADR 027 §4: drop the "would need a paired editorial update" hedge now that the paired update lands in this PR; prose now attributes the bounds to ADR 009's table directly. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Third-pass review feedback: - ADR 009 §Other protocol parameters (MMR retention buffer bullet): the prior "30 days = ~5 stacked epochs" framing was loose (30/7 ≈ 4.3). Tighten to combined retention = challenge window (7d) + buffer (30d) ≈ 37 days ≈ 5 epochs at the 7-day epoch length pinned in ADR 026 §2; cite the source so the arithmetic is auditable. - ADR 027 §4 epochAggregateRoot NatSpec: replace bare "shortest-first" with "shortest-first (acc seeds at the shortest peak)" to remove residual ambiguity for readers scanning only the one-line summary. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Resolves the four in-scope items from the #453 execution-risk register (Risks 1, 2, 4, 5; Risk 3 stays at decdn/finance#3). All amendments land in the parent ADRs (014, 026, 027, 028) plus the L2 deployment appendix.
OffenseTypeenum +Slashed(slashId, operator, offenseType, amount, evidenceHash)event with globally-monotonicslashIdand explicit per-offenseabi.encode(...)preimage forevidenceHash. ADR 028 §6 forward-references it.FeeRouteras MUST, with0x00/0x01/0x02domain-separated hashes, explicit bagging pseudocode,peakHeight + (numPeaks − 1)proof bound, and a governance-tunableMMR_RETENTION_BUFFERfloor.gaugeLaunchedflag +preLaunchGaugeAccumulator[epoch]+ one-shotenableGauge()governance setter, with documented partial-epoch cutover behavior and retroactive claimability against historical ve-snapshots.Test plan
pre-commit run --files <touched>passes (markdownlint, trailing whitespace, end-of-file, merge-conflict)grepconfirms canonical/consumer split forSlashed/slashId/OffenseType(014 owns, 028+011 consume) andgaugeLaunched/preLaunchGaugeAccumulator/enableGauge()(026 owns, 027 §9 forward-references)#slashed-event-and-slashid-allocation,#2-feerouter-split-40407553,#9-implementation-sequencing-and-launch-prerequisite,#batch-shape,#7-operator-economics-and-minimum-stake§Ncross-references remain inappendix-l2-deployment.mdcontracts/(still unpopulated, workspace-excluded) untouched🤖 Generated with Claude Code