Skip to content

docs(adr): demote watchtower to permissionless fraud-detection appendix - #422

Merged
alpergundogdu merged 2 commits into
mainfrom
claude/laughing-rhodes-6a7b4a
May 6, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
claude/laughing-rhodes-6a7b4a

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Closes #420.

Resolves the ADR 007 ↔ ADR 027 contradiction and the unfunded receipt-validator economics surfaced in #420. Watchtowers were specified as a protocol participant (own ALPN, escrow contract, subscription fee model); with ADR 027's permissionless-challenger model and the existing SlashJudge bond machinery from ADR 014, no dedicated subscription role is needed.

What changes

Reframed as: any third party may monitor the L2 chain and submit bonded challenges against fraudulent settlements (closeChannel with stale vouchers) and fraudulent epoch summaries (commitEpochSummary with inflated claimedDistinctClients). Economics are bond + reward on success, MEV-style — no per-channel registration, no heartbeat, no ALPN, no node collaboration.

Removed

  • adr/007-watchtower.md
  • adr/appendix-watchtower-economics.md (subscription cost model no longer relevant)
  • cdn/watchtower/v1 ALPN (ADR 005, ADR 013, ADR 015, crates/protocol/src/lib.rs)
  • WatchtowerEscrow contract surface (ADR 009 governance params, ADR 016 inventory/call-graph/fund-custody, EIP712 domain list)
  • WatchtowerClient seam from appendix-poc-production-seams
  • §4.1 Watchtowers from appendix-operator-upgrade-path

Added

  • adr/appendix-fraud-detection.md — optional, anyone-can-run on-chain monitoring layer
  • ADR 003 absorbs the L2 sequencer-censorship analysis (own § L2 sequencer censorship) and documents the three-layer stale-close defense (local in-process monitor + operator-arranged redundancy + permissionless disputeChannel submission)

Edited

  • ADR 027 §5 rewritten as "Challenger role" pointing to the appendix; §Negative orphan fee-structure reference replaced with SlashJudge bond mechanism
  • All cross-references swept in ADRs 008, 010, 011, 014, 015, 017, 026, appendix-l2-deployment, appendix-operator-key-rotation, architecture.md, ADR README.md, top-level README.md, CONTRIBUTING.md, CLAUDE.md

Why this is doc-only

The PoC contract shims that the permissionless challenger model needs — no msg.sender restriction on disputeChannel, the ChannelCloseInitiated/Disputed/Settled events, the ChallengeReceiptSummary handler — were already specified in ADR 003 and ADR 014 / ADR 027. ADR 007 §8 had said the PoC didn't implement watchtowers anyway. So this PR is purely documentation; no contract or runtime code changes.

Validation

  • cargo build — clean
  • cargo clippy --workspace --all-targets — clean
  • cargo fmt --check — clean
  • pre-commit run --all-files — all hooks pass (markdownlint, cargo fmt/clippy/doc/deny)
  • Final sweep: grep -rn 'watchtower\|WatchtowerEscrow\|cdn/watchtower\|ALPN_WATCHTOWER' returns no matches outside _history/ and the new appendix

Test plan

  • All ADR cross-references resolve (no broken 007-watchtower.md links)
  • Build + clippy + fmt + doc + deny pass
  • PoC contract shims (permissionless disputeChannel, events) remain documented in ADR 003
  • ADR book PDF builds (manual; build command updated in ADR README)

🤖 Generated with Claude Code

…ix (#420)

Resolves the ADR 007 ↔ ADR 027 contradiction surfaced in #420 and the
unfunded receipt-validator economics referenced by ADR 027 §Negative.
Watchtowers were specified as a protocol participant (own ALPN, escrow
contract, subscription fee model). With ADR 027's permissionless-
challenger model and the existing SlashJudge bond machinery from
ADR 014, no dedicated subscription role is needed.

Reframed as: any third party may monitor the L2 chain and submit
bonded challenges against fraudulent settlements (closeChannel with
stale vouchers) and fraudulent epoch summaries (commitEpochSummary
with inflated claimedDistinctClients). Economics are bond + reward
on success, MEV-style — no per-channel registration, no heartbeat,
no ALPN, no node collaboration.

Changes:
- Delete ADR 007 and appendix-watchtower-economics.md
- New appendix-fraud-detection.md documenting the optional layer
- ADR 003 absorbs the L2 sequencer-censorship analysis (own §) and
  documents the three-layer stale-close defense (local monitor +
  operator redundancy + permissionless dispute submission)
- ADR 027 §5 rewritten as "Challenger role" pointing to the appendix;
  fee-structure orphan reference fixed
- ADR 005 drops cdn/watchtower/v1 ALPN, sequence diagram, stream
  limit, idle-timeout exception
- ADR 013 drops WatchtowerMessage enum
- ADR 009 drops WatchtowerEscrow governance parameters
- ADR 016 drops WatchtowerEscrow contract from inventory, call graph,
  fund-custody table, EIP712 domain list, deployment topology
- appendix-poc-production-seams drops WatchtowerClient seam
- appendix-operator-upgrade-path drops §4.1 Watchtowers; voucher-format
  upgrade now references the local dispute monitor
- Sweep all cross-references in ADRs 008, 010, 011, 014, 015, 017, 026,
  appendix-l2-deployment, appendix-operator-key-rotation,
  architecture.md, README, CONTRIBUTING, CLAUDE
- Drop ALPN_WATCHTOWER constant from crates/protocol/src/lib.rs and
  the WatchtowerAnnounce reservation in gossip.rs

PoC contract shims for permissionless challenger (no msg.sender
restriction on disputeChannel, ChannelClose/Disputed/Settled events)
were already documented in ADR 003 — no new contract surface needed.

Closes #420

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors the protocol's security architecture by decommissioning the formal 'Watchtower' role, the WatchtowerEscrow contract, and the cdn/watchtower/v1 ALPN protocol. These components are replaced by a permissionless fraud-detection layer that leverages the existing SlashJudge bond mechanism for on-chain challenges. The review feedback identifies a missing state flag in the Channel struct necessary to enforce the 'one extension per close' constraint for the newly introduced forced-inclusion deadline extension. Additionally, a correction is required for an internal documentation reference concerning the definition of receipt-fraud rewards.

Comment thread adr/003-payments.md Resolved
Comment thread adr/027-distinct-client-receipts.md Resolved
…pt-fraud reward reference

Addresses gemini-code-assist review on PR #422.

ADR 003 / ADR 010 — Channel struct
- Add `bool extended` flag so the contract can enforce "one extension per
  close" on the forced-inclusion deadline-extension path. Without this
  state, repeated forced-inclusion `disputeChannel` calls could each
  re-trigger an extension whenever the remaining time drops below 24h,
  opening an indefinite-delay vector. The constraint was lifted into
  ADR 003 from the (now removed) ADR 007 in this PR series, so the
  storage layout that backs it now belongs here.
- Update the L2 sequencer censorship section to reference the flag and
  spell out the `closeChannel` reset.

ADR 027 / appendix-fraud-detection
- The receipt-fraud reward size was forwarded to "§7", but §7 is failure
  semantics (gauge-zeroing on successful challenge), not reward sizing.
  Reframe as a parameter on the SlashJudge receipt-fraud challenge
  handler, governable per ADR 009; concrete default/bounds are pending
  with the handler.

Validation: pre-commit run --files passes (markdownlint, deny).
@alpergundogdu
alpergundogdu merged commit 082ba21 into main May 6, 2026
9 checks passed
@alpergundogdu
alpergundogdu deleted the claude/laughing-rhodes-6a7b4a branch May 6, 2026 11:25
alpergundogdu added a commit that referenced this pull request May 15, 2026
The Permissionless Fraud-Detection Layer was demoted from an ADR to an
appendix (#422), but architecture.md's Chapter 5 reading order still
listed it as item 8 — a stale leftover. It already appears in the
Appendices section, and the adrs-book build groups appendices at the
end (not interspersed in chapters), so the Chapter 5 entry contradicted
both the Appendices section and the README command. Remove the line.

Resolves the inconsistency flagged in PR review; the suggested
alternative (also listing it in the README Chapter 5 block) would have
compiled appendix-fraud-detection.md twice into the PDF.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
alpergundogdu added a commit that referenced this pull request May 15, 2026
* docs(adr): fix and enrich the ADR book PDF build

- Fix mermaid-filter build failure: the ADR 011 and ADR 028 appeal
  sequence diagrams used `;` in message text, which Mermaid parses as a
  statement separator. Replace with `—` / `,`. This broke both the
  adrs.pdf and adrs-book.pdf builds.
- Make the reading-order book exhaustive: add appendix-binaries.md and
  appendix-bundles.md to architecture.md's Appendices index and the
  README adrs-book command (they were never wired in — hand-maintained
  list drift, same class as the ADR 031 omission #566 fixed).
- Reading-order book only: add full-page chapter/appendix divider pages
  (_build/part-*.md) with a title and 2–3 sentence intro derived from
  architecture.md's Reading Order. The numeric adrs.pdf is unchanged.
- Drop the redundant `cd adr` from both README build commands —
  README.md lives in adr/, so the reader is already there.
- Exclude adr/_build/ from markdownlint (pandoc concatenation
  fragments, not standalone documents).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* ci: exclude adr/_build/ from markdownlint-cli2

The CI markdownlint job uses DavidAnson/markdownlint-cli2-action, which
does not read .markdownlintignore (that is a markdownlint-cli v1 feature,
used by the local pre-commit hook). Add !adr/_build/** to the workflow
glob negation list so the pandoc build fragments are excluded in CI too,
matching the existing !.github/agents/** pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(adr): drop stale fraud-detection line from architecture.md Ch5

The Permissionless Fraud-Detection Layer was demoted from an ADR to an
appendix (#422), but architecture.md's Chapter 5 reading order still
listed it as item 8 — a stale leftover. It already appears in the
Appendices section, and the adrs-book build groups appendices at the
end (not interspersed in chapters), so the Chapter 5 entry contradicted
both the Appendices section and the README command. Remove the line.

Resolves the inconsistency flagged in PR review; the suggested
alternative (also listing it in the README Chapter 5 block) would have
compiled appendix-fraud-detection.md twice into the PDF.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
thiras added a commit that referenced this pull request Sep 10, 2026
…1983)

* docs: sync README with the tree and retarget dangling ADR citations

README.md had drifted far enough that several of its claims were false
against the code. It documented a `gossip` crate and an `iroh-gossip`
wire protocol that exist nowhere, listed 9 of the 11 workspace crates,
and described a CLI surface of 5 top-level commands when there are 12 --
naming `node peers`, `node announce`, and `bundle create`, none of which
exist. It also pointed at a status note that was never written.

Rewrite it against the tree: three ALPNs, all 11 crates, a grouped table
of the real command surface, and new Status, Quickstart and License
sections. Add CI, Security, license and MSRV badges. Correct the
selection score to the unified formula in ADR 001, the discovery
fallback to the on-chain origin directory per ADR 022, and the bao
mechanism per ADR 038. Drop the multi-token payments bullet: no live ADR
supports an ERC-20 allowlist, and ADR 016 fixes USDC at deployment.

Separately, ADR 007, 020, 021, 023 and 025 were demoted to appendices in
 #349 and #422, but 23 citations across 18 files still named the numbered
files. Retarget them to `adr/appendix-local-admin-http.md` and
`adr/appendix-observability.md`. Add all five numbers to the do-not-reuse
list in CLAUDE.md and advance the counter to 042.

Remove `node region-stats` from CLAUDE.md, the binaries appendix, and the
admin appendix's DTO list -- that subcommand exists nowhere. Update the
crates.io description and the clap help, which claimed a `publish`
vetting step the module doc calls impossible and had `bundle` inverted.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kt6vxCuFjhTgkMfU4Q3WGc

* docs: make the cli crate blurb non-exhaustive

The crate-structure line enumerated 6 of 12 commands, omitting fetch,
setup, pool, publish, appeal and whoami -- the same enumeration drift
this branch removes elsewhere. Point at the CLI Surface table instead,
so the command list lives in exactly one place.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kt6vxCuFjhTgkMfU4Q3WGc

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

ADR 007 scope: decompose watchtower role; reconsider what genuinely needs a dedicated subscription service

1 participant