Skip to content

ADR 026 / 027 / 028 surface lock-down: review formula shapes, state machines, and signatures before implementation #451

Closed

Description

@alpergundogdu

Summary

End-to-end review pass over ADR 026 (gauge-boost tokenomics), ADR 027 (distinct-client receipts), and ADR 028 (slashing appeals) to lock the contract-shape decisions before implementation. Parameter values stay governance-tunable post-deploy; this review locks the shape — formula structure, state machines, function signatures, storage commitments, event shapes — that compiles into bytecode and cannot be changed without redeployment.

Why now

Surfaced as a hard prerequisite by #449 and #450. The unified contract surface (#449) and the canonical interface specs (#450) both reference this trio extensively. The implementation issue (downstream) cannot start until each ADR is signed off as surface-final.

The earlier framing — "ADR 026/027/028 are still settling, defer the production-only contracts" — is no longer valid under #449's tunable-from-launch design. We're shipping the full surface; the surface needs to lock.

Scope

A single review pass per ADR. Each yields either a sign-off comment or a list of surface-changing concerns to resolve before sign-off.

A. ADR 026 — gauge-boost tokenomics

Lock-targets:

  • Gauge-boost formula structure (§3) — the parametric form min(bytes_i, bytes_i^veShare × boostFloor + bytes_i × (1 - boostFloor)) or whatever the current canonical form is. Constants stay tunable; the formula shape compiles in.
  • Six-bucket structure (§2) — bucket count, bucket categories, sum-to-100 invariant. Share percentages stay tunable per ADR: unify contract surface; drop PoC/Production phasing in favor of tunable economics #449.
  • Epoch mechanics (§2) — epoch length unit, claim window length unit, epoch-rollover semantics, claim-rounding direction. Specific durations stay tunable.
  • VotingEscrow lock semantics (§4) — max lock duration ceiling, no-early-exit invariant, checkpoint pattern, balanceOfAt / totalSupplyAt signatures.
  • Slashing distribution (§8) — 50/30/20 split structure (challenger / SafetyReserve / burn). Percentages stay tunable.
  • Burn semantics — ERC20Burnable.burnFrom integration; how SafetyReserve / FeeRouter authorize burns.

Out of lock: parameter values, governable bounds, rollout schedule.

B. ADR 027 — distinct-client receipts

Lock-targets:

  • DeliveryReceipt EIP-712 typed-data shape (§1) — fields, ordering, type hash structure.
  • Receipt-batch Merkle anchoring (§4) — root commitment shape, who-can-call rules, when-callable rules, storage layout.
  • commitEpochReceiptRoot / commitEpochSummary signatures — currently referenced from ADR 003 §407 and ADR 016 §538 but the canonical spec lives here. Surface needs to be pinned.
  • Distinct-client diversity threshold structure — the formula gating gauge eligibility on receipt counts (parameters tunable; structure compiled in).
  • Challenge path interaction — how individual receipts surface on-challenge via SlashJudge per ADR 008's reputation gate.

Out of lock: parameter values (diversity thresholds, batch size limits), reputation-gate constants.

C. ADR 028 — slashing appeals

Lock-targets:

  • Appeal state machine — states (Open, FastTracked, Rejected, Ratified, Reversed, Lapsed) and the legal transitions between them. State graph compiles in; window durations stay tunable.
  • SafetyReserve extension function signatures (§123) — openSlashAppeal, fastTrackAppeal, rejectAppeal, ratifyAppeal, reverseAppeal parameters and access control.
  • Three-window timing model (§112) — APPEAL_FILING_WINDOW, MULTISIG_REVIEW_WINDOW, RATIFICATION_WINDOW independence and per-clock semantics. Window durations stay tunable.
  • payout integration — how the appeal-ratification path uses the existing SafetyReserve.payout interface (per §130: "additional authorization path into the same payout machinery").
  • Bond / restitution caps — the structural caps (per-operator yearly limits, coordinated-attack waiver path). Specific cap values stay tunable.

Out of lock: window durations, bond size, restitution cap values, frequency-cap thresholds.

Out of scope

Acceptance

  • ADR 026 reviewed end-to-end; surface-lock sign-off or findings list comment posted
  • ADR 027 reviewed end-to-end; surface-lock sign-off or findings list comment posted
  • ADR 028 reviewed end-to-end; surface-lock sign-off or findings list comment posted
  • Any findings resolved via separate ADR PRs and re-reviewed
  • All three ADRs marked Status: Locked-for-implementation in their headers (currently all three are Status: Draft)

Related

Activity

  1. added
    kind:docs
    design:adr
    on May 7, 2026
  2. alpergundogdu commented on May 7, 2026

    @alpergundogdu
    ContributorAuthor

    Cross-link: decdn#453 is the complementary execution-risk register for 026/027/028 — surfaces decisions the ADRs explicitly defer (slashId emission, MMR vs plain-hash accumulator, gauge-pause mechanism, funding-source diversity enforceability) that need to land before this surface-lock review can sign off.

    In particular, ADR 028 sign-off depends on the SlashJudge slashId-emission gap (Risk 1) and ADR 027 sign-off depends on the MMR pinning decision (Risk 2). SafetyReserve sizing validation (Risk 3) moved to a finance/ issue; the remaining items resolve in this repo.

  3. thiras commented on May 16, 2026

    @thiras
    Contributor

    Surface-lock review — sign-off (ADR 026 / 028 / 032)

    End-to-end review pass complete. Findings resolved in #575; re-reviewed below. Note up front: ADR 027 no longer exists — its distinct-client / delivery-receipt surface was deliberately collapsed into the ADR 026 §3 per-operator gauge-share cap. The "three ADRs" of this issue resolve to 026, 028, and 032 (the contract-surface pin ADR 028 normatively defers to).

    A. ADR 026 — gauge-boost tokenomics — ✅ SIGN-OFF (one finding resolved)

    Lock-target Verdict
    Gauge-boost formula structure (§3) Locked. working_bytes_i = min(bytes_i, 0.4·bytes_i + 0.6·(ve_i/total_ve)·total_bytes), share_i = min(working_bytes_i/sum, MAX_GAUGE_SHARE_PER_OPERATOR); degenerate fallbacks (total_ve==0, sum==0, bytes_i==0) pinned.
    Six-bucket structure (§2) Locked. Six buckets, named categories, sum-to-100 invariant fixed at contract level; shares tunable via setShares.
    Epoch mechanics (§2) Finding (resolved #575). Epoch length / claim-window units / rollover semantics were pinned, but claim-rounding direction was unspecified — a surface-changing gap (floor-vs-round + dust disposition compile into bytecode). #575 pins floored integer division (no round-up, for final-claimant revert safety) with truncation dust routed through the existing 26-epoch claim-window treasury sweep, explicitly distinct from the §3 next-epoch rollover path.
    VotingEscrow lock semantics (§4) Locked. 4y max-lock ceiling, no-early-exit invariant, per-lock checkpoints, balanceOfAt/totalSupplyAt signatures all present.
    Slashing distribution (§8) Locked. 50/30/20 structure pinned; percentages tunable.
    Burn semantics (§1, §8) Locked. ERC20Burnable burn/burnFrom; standard-interface integration.

    B. ex-ADR-027 — distinct-client receipts — ✅ RESOLVED-BY-REMOVAL

    The §B lock-targets (DeliveryReceipt EIP-712 shape, receipt-batch Merkle anchoring, commitEpochReceiptRoot/commitEpochSummary, distinct-client diversity threshold) do not exist anywhere canonical and have zero dangling references. This is an architecture decision already taken, not a gap: the receipt-counting wash-trading defense was replaced by the ADR 026 §3 per-operator gauge-share cap. The byte source is the EIP-712 voucher bytesDelivered field flowing settleChannel → routeSettlement → FeeRouter.bytesPerEpoch; ADR 003 §116 and ADR 016 §249 pin the "no separate commit step" invariant. Nothing left to lock for §B.

    C. ADR 028 — slashing appeals — ✅ SIGN-OFF (no surface change)

    Lock-target Verdict
    Appeal state machine Locked. ADR 032 §4 pins exactly the 6 states in this issue (Open/FastTracked/Ratified/Reversed/Rejected/Lapsed) and the legal transitions.
    SafetyReserve extension signatures (§6) Locked. openSlashAppeal/fastTrackAppeal/rejectAppeal/ratifyAppeal/reverseAppeal + permissionless cleanupExpiredAppeal, with access-control modifiers, across ADR 028 §6 + ADR 026 §5 ISafetyReserve + ADR 032.
    Three-window timing model (§5) Locked. APPEAL_FILING_WINDOW/MULTISIG_REVIEW_WINDOW/RATIFICATION_WINDOW independence + per-clock semantics + window-timing invariant pinned; durations tunable.
    payout integration Locked. Restitution routed through the existing payout(bundleHash, recipient, amount) entry point (§6); ADR 032 §2 pins the CEI lien-release-then-payout sequence.
    Bond / restitution caps Locked. §4 bond economics + §5 MAX_APPEAL_RESTITUTION / OPERATOR_APPEAL_FREQUENCY structural caps; values tunable.

    Dependency note: ADR 028's state machine, storage layout, and six event signatures are normatively delegated to ADR 032, which fully pins them. ADR 032 is therefore locked alongside 028 (it would be incoherent to lock 028 against a Draft contract-surface dependency). Risk-1 (Slashed/slashId) is canonical in ADR 014 §2 — appeal pinning is sound.

    Acceptance

    Closing recommended on #575 merge. #453 Risk 3 (decdn/finance#3, SafetyReserve sizing) is finance-tracked and explicitly not a surface-shape blocker — does not gate this lock or #452.

  4. added a commit that references this issue on May 18, 2026
    32b543a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrkind:docs

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions