Repository navigation
feat(payments): delegated voucherSigner + voucher-less close - #1478
Conversation
Split the funder role from the voucher-signing role on PaymentChannel. `ch.client` stays the funder and refund destination; a new immutable `ch.voucherSigner`, pinned at open (address(0) means msg.sender), is what all four settlement paths recover voucher signatures against. There is no setter — a mutable signer would let a funder retroactively void a voucher a provider had already earned. Co-Authored-By: Claude Opus 5 <[email protected]>
Drop the `claimedNonce == 0` conjunct from `closeChannel`s zero-voucher branch and add `closeChannelWithoutVoucher(bytes32)`, a thin alias over the same close path. Neither advances a watermark, so the counterparty keeps its full `disputeChannel` ratchet-up right for the dispute window; a voucher is now required only to raise the watermark, not to close. Also folds in five doc/test cleanups from the delegated-signer review: the cooperativeClose residual-authority note now states the provider waiver is also required, records that the pinned signer is deliberately not a party to the other lifecycle entry points, warns against passing the counterparty as voucherSigner, renames ChannelOpenedSig to CHANNEL_OPENED_SIG, and asserts the delegate cannot topUp. Co-Authored-By: Claude Opus 5 <[email protected]>
…loseChannelWithoutVoucher tests The `cooperativeClose` @dev clause claimed topUp and withdraw "remain client/provider-only" for both parties, but topUp is client-only and withdraw is provider-only; only the two close functions accept either party. Reworded to say so explicitly. Also closes three test gaps flagged in Task 2's review: - test_closeChannelWithoutVoucher_disputeStillRatchets now warps past the dispute deadline and settles, proving the ratcheted watermark actually routes the delta, not just that it moved. - Added revertsWhenAlreadyClosing and revertsAfterExpiry negative guards for closeChannelWithoutVoucher's own _requireOpenAndUnexpired check, since it is a distinct entry point whose guard could otherwise be dropped with no test failing. - Pinned ChannelCloseInitiated's emitted arguments in test_closeChannelWithoutVoucher_byProvider via expectEmit, since _initiateClose now has two callers. Co-Authored-By: Claude Opus 5 <[email protected]>
openChannel gained a pinned voucherSigner param (extra SSTORE + calldata word) and closeChannelWithoutVoucher is a new entry point; both changed gas costs and the ABI. Regenerated via `FOUNDRY_PROFILE=ci forge snapshot --snap .gas-snapshot` after landing the four carry-over test/doc fixes from Task 2's review so the snapshot does not go stale again immediately. Co-Authored-By: Claude Opus 5 <[email protected]>
`PaymentChannel` now splits the funder (`client`) from the address whose EIP-712 signature authorizes vouchers (`voucherSigner`), pinned at `openChannel` and immutable thereafter. Mirror that split off-chain: `ChannelState` gains `voucher_signer` and `apply_voucher` recovers against it instead of `client`, matching the four on-chain settlement paths. `client` keeps its meaning as the funder and stays the subject of the ADR-011 blacklist gates — moving those onto the signer would let a blacklisted funder serve behind a throwaway key. The production `sol!` binding picks up the third `openChannel` argument, the trailing unindexed `ChannelOpened.voucherSigner`, the new `Channel.voucherSigner` struct member, and `closeChannelWithoutVoucher`. Persistence of the field (task 5), the serve-path gates (task 6), and hydration from the event (task 7) are follow-ups; the persistence decoder and `apply_channel_opened` pass the funder as the signer for now. Co-Authored-By: Claude Opus 5 <[email protected]>
The redb seller record gains a fourth trailing postcard segment, a bare `[u8; 20]` holding the channel's pinned voucher signer, appended after the cooperative-close flag. `SUPPORTED_SCHEMA_VERSION` stays at 2: this is additive, and records written before delegated signers existed have no such segment and hydrate with `voucher_signer = client` — the on-chain default `openChannel` applies when `voucherSigner` is passed as zero. Presence is tested by width (postcard writes a byte array as raw bytes with no length prefix), so a shorter future trailer is never misread as an address. Removes the task-4 decoder placeholder that passed `client` for both legs. Also, in decdn-incentive: correct `hydrate`'s round-trip-coverage claim now that the decoder really does persist the two addresses separately, reflow an orphaned doc line, and drop a duplicated channel-id literal from the two delegation tests in favour of the fixture's own id. Co-Authored-By: Claude Opus 5 <[email protected]>
The channel_store.rs comment overstated what the length-gated decode of the untagged, fixed-width voucher_signer segment actually guarantees: any >= 20 byte remainder at that position decodes as an address, so it's an ordering invariant (append after it) not a misread-proofing mechanism. Document that invariant once at decode_record and cross-reference it at the record write site and the StoredChannelState doc; annotate the now-unreachable Corrupt branch as a deliberate guard. Also de-triplicate the three tests' hand-encoded fixture bytes into one encode_pre_signer helper, strengthen the self-referential client-vs-signer test assertion, and flag the 20-byte trap in the trailing-junk regression test. No behavioural change: same bytes written and decoded. Co-Authored-By: Claude Opus 5 <[email protected]>
The binding gate in dispatch.rs and the pull-through gate in fill.rs ask a signer question: only the channel's pinned voucher_signer can produce a voucher the channel accepts, so it is the only identity that can authorize paid delivery or an upstream spend. Both now compare against state.voucher_signer. The three ADR-011 takedown gates (the dispatch origin-blacklist gate, and the in-flight re-checks in window.rs and delivery.rs) stay keyed on state.client, the funder, and say so explicitly: a blacklisted funder can pin a clean throwaway key as its signer, so moving them would silently stop enforcing takedowns. pull_authorized now checks BOTH — signer for ownership, funder for compliance. Also replaces the line-number cross-references added to channel_store.rs with symbol references. Co-Authored-By: Claude Opus 5 <[email protected]>
The watcher discarded the events voucherSigner and registered the funder as both client and signer, so a delegated channel rejected every voucher it was opened to accept. Split the field mapping into a pure opened_channel_state kernel and hydrate the pinned signer from the event (already resolved on-chain, so no client-side defaulting). Co-Authored-By: Claude Opus 5 <[email protected]>
Both inline sol! blocks still declared the pre-delegation signature. They compiled fine and would only have misencoded against the deployed contract at runtime. Every buyer-side call now passes Address::ZERO, which the contract resolves to msg.sender — todays exact behaviour. Co-Authored-By: Claude Opus 5 <[email protected]>
Additive #[serde(default)] DTO field plus a SIGNER column in "decdn node channels"; a pre-delegation server omits it and renders "?" rather than echoing the funder. Co-Authored-By: Claude Opus 5 <[email protected]>
…down One test crosses the whole seam — delegate-signed vouchers accepted, the stream completing, funder and signer staying distinct. The other blacklists the funder mid-stream on a channel with a clean delegate signer; it fails if the per-MB re-check is re-keyed onto the signer (verified by mutating delivery.rs). Co-Authored-By: Claude Opus 5 <[email protected]>
Also reflow a channel_store trailing-segment paragraph that a rewrap left with a two-word orphan line. Co-Authored-By: Claude Opus 5 <[email protected]>
…hrough path The delegated mid-stream takedown test in `client_loopback.rs` reaches only `delivery.rs`: its harness wires no `pull_through_origin`, and `serve_via_window_pull_through` is entered only when that provider is `Some`. So `window.rs`'s per-interval funder re-check was guarded by a comment and nothing else — re-keying it onto `voucher_signer` left the suite green. Adds a window-path sibling built on the existing node A/B pull-through fixture: the leaf's channel is funded by one address and signed by a distinct, never-blacklisted delegate; the funder goes on the deny-set only once the window loop is demonstrably running (its pause counter has ticked). Mutating `window.rs` to read `state.voucher_signer` now fails the test with the 12 MiB delivery completing. `build_node_b_with_leaves` grows a per-leaf voucher-signer leg and an optional content deny-set; every existing caller keeps the undelegated, deny-nothing default. Co-Authored-By: Claude Opus 5 <[email protected]>
…omment `buyer_channel.rs` carried `TODO(task 7): plumb a configurable delegate signer` for a task that deliberately declined that work — the delegate-signer surface needs a publisher-pays UX, not an extra argument. Says so instead. `payment_settlement.rs` repeated "Only channels where this node is the provider concern us." above a `let … else` that delegates exactly that decision to `opened_channel_state`, which already carries it. Keeps the copy in the kernel. Co-Authored-By: Claude Opus 5 <[email protected]>
The column is operator-visible and output-breaking: the table is ~15 characters wider and positions after COUNTERPARTY shift, so positional parsers need updating. Its value equals COUNTERPARTY for every channel opened today, since a zero voucherSigner resolves on-chain to msg.sender. Co-Authored-By: Claude Opus 5 <[email protected]>
…n ADR 003 Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…nder notes Co-Authored-By: Claude Opus 5 <[email protected]>
…fication claims State that the ephemeral client binding gates channel use rather than supplying voucher attribution, in ADR 003 and ADR 012, matching ADR 005 and the dispatch gate. Restate the voucher-less-close safety premise against the claimed/withdrawn pair actually read at settlement. Correct the Channel slot-packing byte count. Collapse the PaymentChannel signature-verification table to the shape that exists. Co-Authored-By: Claude Opus 5 <[email protected]>
… close openChannel's selector, ChannelOpened's topic0, and the getChannel tuple layout all changed with the pinned voucherSigner; none were logged. Add the BREAKING entry with the ABI sub-bullet, plus the additive closeChannelWithoutVoucher entry point and the relaxed zero-voucher close. Co-Authored-By: Claude Opus 5 <[email protected]>
… close note _verifyVoucher still declared `address client` though all four call sites pass ch.voucherSigner — the innermost spot where funder and signer could transpose silently. Parameter names are not part of the selector; no behaviour change. The cooperativeClose @dev overstated the pinned signer's residual authority: both signatures are verified independently of msg.sender, so the provider — which holds the vouchers and signs its own waiver — could already submit the identical call. Widening the party check only moves who pays the gas. Co-Authored-By: Claude Opus 5 <[email protected]>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughPayment channels now separate the funder from a pinned voucher signer. Contract settlement, Rust state, persistence, node authorization, admin APIs, CLI output, ABI bindings, documentation, and tests are updated for delegated voucher signing and voucher-less closure. ChangesVoucher signer delegation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Funder
participant PaymentChannel
participant VoucherSigner
participant Provider
Funder->>PaymentChannel: openChannel(provider, deposit, voucherSigner)
PaymentChannel-->>Provider: ChannelOpened with voucherSigner
VoucherSigner->>PaymentChannel: sign voucher
Provider->>PaymentChannel: withdraw or close
PaymentChannel-->>Funder: settle using funder/refund role
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Contracts coverageLine coverage: 89.57% (2422/2704 lines) |
Gas snapshotNo gas changes vs base. |
There was a problem hiding this comment.
Pull request overview
Implements the delegated voucherSigner + voucher-less close work from #1476 across the Solidity PaymentChannel contract, Rust bindings/runtime, CLI/admin surfaces, and ADR documentation to keep funder-vs-signer semantics consistent end-to-end.
Changes:
- Extends
PaymentChannel.openChannelto pin an immutablevoucherSigner(defaulting tomsg.sender) and updates all settlement-path signature verification to recover against it. - Adds a voucher-less close flow by removing the
claimedNonce == 0restriction and introducingcloseChannelWithoutVoucher(bytes32)as an explicit alias over the same close-at-watermark path. - Splits node-side channel state into
client(funder) vsvoucher_signer(signer), persists it to redb, updates serve gates accordingly, and expands tests/admin/CLI/docs to reflect the new roles.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/node/tests/origin_range_pull.rs | Updates ChannelState::new construction for new funder/signer arguments. |
| crates/node/tests/node_to_node_pull_through.rs | Updates test fixtures for funder vs signer fields. |
| crates/node/tests/node_origin_pull.rs | Updates leaf channel fixtures, adds compliance regression test for mid-stream funder takedown with delegated signer. |
| crates/node/tests/client_loopback.rs | Adds delegated-signer fixtures and coverage for binding/pull-through authorization and funder-deny compliance. |
| crates/node/tests/channel_state_store.rs | Updates store tests for new ChannelState shape. |
| crates/node/tests/anvil_settlement_e2e.rs | Updates on-chain buyer binding for new openChannel signature (self-signing via Address::ZERO). |
| crates/node/src/payment_settlement.rs | Hydrates ChannelOpened into ChannelState including voucherSigner, with unit tests to prevent transposition. |
| crates/node/src/handlers/client/window.rs | Documents/anchors that in-flight takedown checks stay keyed on funder (state.client). |
| crates/node/src/handlers/client/mod.rs | Updates internal test state construction for new ChannelState signature. |
| crates/node/src/handlers/client/fill.rs | Re-keys pull-through spend authorization to voucher_signer while preserving funder-deny backstop. |
| crates/node/src/handlers/client/dispatch.rs | Keeps origin-deny gate keyed on funder; re-keys binding authorization to voucher_signer. |
| crates/node/src/handlers/client/delivery.rs | Documents/anchors that in-flight takedown checks stay keyed on funder (state.client). |
| crates/node/src/channel_store.rs | Persists/decodes voucher_signer as an additive trailing segment with tests for legacy decode and delegated round-trip. |
| crates/node/src/admin.rs | Exposes voucher_signer on the admin channel snapshot surface. |
| crates/incentive/src/store.rs | Updates incentive-store tests to the new ChannelState::hydrate ordering. |
| crates/incentive/src/payment_channel.rs | Updates Rust sol! bindings: Channel tuple, openChannel signature, ChannelOpened event, and new close entrypoint. |
| crates/incentive/src/channel.rs | Adds voucher_signer to ChannelState and verifies vouchers against it (plus new delegated-signer tests). |
| crates/e2e/src/client.rs | Updates e2e buyer openChannel call to pass Address::ZERO. |
| crates/e2e/src/bindings.rs | Updates duplicated buyer-side PaymentChannelOpen binding to new openChannel signature and documents duplication. |
| crates/common/src/admin.rs | Extends ChannelSnapshot DTO with voucher_signer and preserves backward compatibility via #[serde(default)]. |
| crates/client-pull/src/buyer_channel.rs | Updates buyer open path to pass zero voucherSigner (self-signing default). |
| crates/cli/tests/admin_peers.rs | Updates CLI admin test to assert voucher_signer is surfaced and distinct when delegated. |
| crates/cli/src/commands/node.rs | Adds SIGNER column and legacy “unknown” rendering for missing voucher_signer. |
| contracts/test/PaymentChannel.t.sol | Adds coverage for delegated signer behavior and voucher-less close/alias semantics. |
| contracts/test/InterfaceFreeze.t.sol | Re-freezes openChannel selector and adds new selector for closeChannelWithoutVoucher. |
| contracts/test/E2EProtocol.t.sol | Updates protocol e2e to the new openChannel signature. |
| contracts/src/PaymentChannel.sol | Implements pinned voucherSigner, voucher-less close-at-watermark, and adds closeChannelWithoutVoucher. |
| contracts/.gas-snapshot | Updates gas snapshot for new/changed contract paths. |
| CHANGELOG.md | Records breaking ABI/event/tuple changes and the additive close entrypoint. |
| adr/glossary.md | Updates glossary definitions for channel roles and voucher signer semantics. |
| adr/appendix-operator-key-rotation.md | Updates operational guidance to account for pinned voucherSigner and voucher-less close. |
| adr/appendix-fraud-detection.md | Updates stale-close detector semantics for voucher-less closes and signer recovery target. |
| adr/024-account-abstraction.md | Updates account-abstraction ADR to reflect voucherSigner as the verification target and Safe-as-funder viability. |
| adr/016-contract-interactions.md | Updates interface-surface wording and function signature reference. |
| adr/012-client.md | Updates client key-role discussion and binding semantics keyed on pinned signer. |
| adr/005-protocol.md | Updates binding description and WrongSigner semantics to reference pinned voucherSigner. |
| adr/003-payments.md | Updates canonical payments ADR for role split, voucher-less close, cooperative close caller set, and verification target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage reportTotal: 81.18% (was 81.10%, ▲ +0.08%) — 52667/64873 lines
History
|
…width The pinned `voucher_signer` shipped as an untagged, fixed-width trailing postcard segment whose presence was detected by `leftover.len() >= 20`. That fails open: any record carrying >= 20 bytes of unknown trailer at that position — a future additive segment, padding, a partial write — is read as an address, moving the voucher signature-recovery target and making the node verify against a key the chain will reject. Bump `SUPPORTED_SCHEMA_VERSION` to 3 and read the segment only when `schema_version >= 3`. v1/v2 records never wrote it, so their trailer is left alone and `voucher_signer` hydrates from `client` — correct by construction, since those channels predate the funder/signer split and are self-signing. On v3 the segment is mandatory: `record` always emits it, so absence or truncation is corruption and surfaces as `StoreError::Corrupt` instead of silently defaulting. Rollback is not supported: an older binary reading a v3 record raises `UnsupportedSchema`, and the seller table is fail-closed, so startup aborts. No production channels exist on disk yet. Co-Authored-By: Claude Opus 5 <[email protected]>
`pull_authorized` carried two ADR 011 origin-blacklist checks: an early return on the *bound* address and a later one on `state.client`. The early return predates the funder/signer split — the bound address was necessarily the funder then, so it was a funder check that silently became a signer check when `voucher_signer` was pinned separately. ADR 011 makes the funding address the compliance subject: a takedown sanctions the money, not whichever throwaway key signs the vouchers. Drop the early return and keep the funder check, so this gate and the origin gate in `dispatch.rs` agree on the subject. Behaviour-preserving today (`voucher_signer == client` on every channel that exists — no delegate surface has shipped). The unknown-channel case is unaffected: the `None` arm below the lookup still returns `false`. Co-Authored-By: Claude Opus 5 <[email protected]>
…lWithoutVoucher No production path closed with the zero-voucher form of `closeChannel`: the seller `send_close` and the buyer `close_unilateral` are both guarded on holding a signed voucher, so they always present a real one. The one caller that could reach an empty claim is the CLI `channel close`/`clean`, which re-signs the persisted watermark unconditionally — including the all-zero watermark of a channel opened but never drawn. That branch is now `closeChannelWithoutVoucher`. It is not just cheaper: `closeChannel` treats a signature of any length as a voucher to verify, so a zero-amount voucher is still checked against the channel's pinned `voucherSigner` — and once a channel can name a delegate, the funder's own signature does not recover to it and the close reverts. The voucher-less entry point is exactly the escape hatch for that case. Both functions take `nonReentrant` only (neither is `whenNotPaused`, so exit paths stay open under pause), gate on `_requireOpenAndUnexpired`, and admit client or provider — so the switch preserves the caller set and the revert conditions. Behaviour today is unchanged: with signer == funder on every channel, both forms reach `_initiateClose` at the same watermark. The anvil settlement e2e's three zero-voucher setup calls move over too, and the binding declaration records why the node's own paths never use it. Co-Authored-By: Claude Opus 5 <[email protected]>
Precision-only fixes, no behaviour change: - buyer_channel.rs: close_unilateral comment said the contract checks sig against `channel.client`; it checks `ch.voucherSigner`. Node self-signs today so its key is that signer. - cli/channel.rs: submit_close's send-failure message named closeChannel even on the closeChannelWithoutVoucher branch; made neutral for both. - cli/channel.rs: documented the residual gap in has_claim_watermark as a proxy for "holds an accepted key", unreachable today with no delegation CLI surface. - channel_store.rs: CHANNEL_TABLE doc no longer implies additive-only segments on `_v1`; states the actual rule (table name tracks key/value shape, schema_version gates segment presence, a mandatory segment is reader-breaking and bumps SUPPORTED_SCHEMA_VERSION). - channel_store.rs: kept the `<= SUPPORTED_SCHEMA_VERSION` conjunct in decode_record's voucher-signer branch (confirmed via future_schema_version_refuses_to_load failing under nextest when dropped) and documented why it is not dead: it defers rejection of an unknown future segment layout to into_state's clean UnsupportedSchema instead of a confusing Corrupt. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Good catch — fixed in f189625 (schema gate in bac6d96). You and an internal reviewer landed on this independently, so rather than defer it I took the version-gate option you suggested:
The regression test is mutation-proven: I went with the gate over a self-describing One consequence worth flagging, since it's a real behavioural change and not free: a node that writes a v3 record and is then rolled back to an older binary will abort startup with |
Implements all four parts of #1476.
1 —
openChannel(address provider, uint256 deposit, address voucherSigner)Splits the funder role from the signer role.
ch.clientstays the funder: puts up the deposit, receives the refund, owns thechannelIdnonce sequence, and is the subject of the ADR-011 blacklist gates.ch.voucherSigneris what all four settlement paths (withdraw,closeChannel,disputeChannel,cooperativeClose) verify EIP-712 voucher signatures against.address(0)resolves tomsg.sender— today's self-signing behaviour is unchanged, and every buyer-side caller in-tree passes zero.setVoucherSigner, stated explicitly in NatSpec rather than implied. A mutable signer would let a funder retroactively void a voucher a provider had already earned.channelIdderivation is unchanged — stillkeccak256(client, provider, nonce), not keyed on the signer, so the funder keeps nonce control and can predict IDs.cooperativeCloseis callable by the pinned signer.One deviation from the issue, approved before implementation
The issue asks for
voucherSignerto be indexed onChannelOpened. It cannot be: the event already carriedchannelId,clientandproviderindexed, which is the EVM maximum of three. It ships unindexed, which satisfies the issue's stated rationale (the node builds channel state from the event with no extragetChannelRPC) and breaks no existing filter — nothing in the tree filters logs by signer. The consequence is documented in ADR 003: signer-side enumeration is noteth_getLogs-filterable.A second correction, found during implementation: the issue describes
cooperativeClose's residual authority as a compromised hot key being able to force settlement at the watermark. Verified against the code, that was already true before this change — both signatures are checked regardless ofmsg.sender, and the provider holds both by construction, so widening the caller set only changes who pays gas. The NatSpec and ADR say that rather than the stronger claim.2 & 3 — voucher-less close
closeChannellost thech.claimedNonce == 0conjunct, andcloseChannelWithoutVoucher(bytes32)was added as a thin alias over the same shared_initiateClosepath, callable by client or provider.Neither advances the watermark.
settleChannelcomputes what it pays fromclaimed*netted againstwithdrawn*, so a voucher-less close settles at the already-validated watermark and can never settle below it; the counterparty keeps its fulldisputeChannelratchet-up right for the dispute window. A voucher is required only to raise the watermark. This removes up to 90 days of capital lock-in when a voucher is lost or withheld.The new function copies
closeChannel's actual modifier list —external nonReentrant, withoutwhenNotPaused, since exit paths deliberately stay open under pause. Adding the pause guard would have made the alias strictly weaker than the call it aliases.4 — node-side keying
ChannelStategainedvoucher_signer, hydrated fromChannelOpenedand persisted to redb as a trailing postcard segment gated on schema version 3; v1/v2 records decode tovoucher_signer = client, matching the on-chain zero default.apply_voucherverifies against it.The trap the issue names — handled explicitly. Five serve-path sites read
state.client. Two are signer semantics and moved; three are ADR-011 funder compliance and deliberately did not:dispatch.rsorigin-blacklist gateclientdispatch.rsbinding gatevoucher_signerfill.rspull_authorizedvoucher_signerfor ownership; blacklist keyed on funderwindow.rsin-flight takedown re-checkclientdelivery.rsin-flight takedown re-checkclientThe three unmoved sites carry do-not-move comments naming the concrete attack (a blacklisted funder pinning a clean throwaway signer). Two compliance regression tests cover it, and the
window.rsgate is mutation-proven: re-keying it tovoucher_signermakeswindow_pull_through_funder_blacklisted_mid_stream_cuts_off_a_delegated_deliveryfail.Both blacklist paths key on the funder — see the follow-ups section below.
Interface freeze
openChannel— deliberate re-freeze (breaking selector change).closeChannelWithoutVoucher— additive baseline entry.Both ABI changes plus the
ChannelOpenedtopic0 change and thegetChanneltuple change are recorded under### Changed (BREAKING)inCHANGELOG.md.Not in scope
No CLI flag or config key for choosing a delegate signer — the publisher-pays UX is follow-up work. The duplicated
PaymentChannelOpenbinding incrates/e2eis kept (with a note), and the ADR 024 operator-side Safe hole is untouched.Verification
* the sole
pre-commitfailure ismarkdownlinton.github/workflows/issue-triage.md, which this branch does not touch — pre-existing.slitheris not installed on this machine, so that gate is CI-only for this branch;aderynran with no new High findings on the touched surface. Theanvil-e2esuites are compile-checked only.Review follow-ups — all folded in
The three items originally listed here as follow-ups are now part of this PR.
On-disk schema gated on a version, not a byte width. The voucher-signer redb segment was untagged and fixed-width, so presence was detected by
leftover.len() >= 20— a fail-open where any record carrying ≥20 bytes of unknown trailer would be silently read as a signer, moving the signature verification target. Flagged independently by review and by Copilot.SUPPORTED_SCHEMA_VERSIONis now 3: v1/v2 records never inspect the segment and defaultvoucher_signer = client(correct — channels predating this contract change are self-signing by construction), v3 records treat it as mandatory so absence is genuine corruption. The regression test is mutation-proven. Consequence, documented inCHANGELOG.md: a node that writes a v3 record and is then rolled back to an older binary aborts startup withUnsupportedSchema. That is this codebase's deliberate fail-closed posture, and there are no production channels on disk yet.Blacklist subject aligned on the funder, both paths.
pull_authorized's early return predated the role split — it used to be a funder check and had silently become a signer check. Per ADR 011 the funding address is the compliance subject, so it is removed and both paths now key on the funder. Behaviour is identical today (signer == funder on every channel); the future divergence is asserted by a test rather than left to omission.closeChannelWithoutVoucherwired — and it caught a latent bug. The premise that the node settlement sweep was the zero-voucher caller was wrong: both node paths are guarded on holding a signed voucher. The real zero branch is the CLI'ssubmit_close, which re-signs even an all-zero watermark — and that non-empty signature skips the contract'szeroVouchershort-circuit (signature.length == 0is one of its conjuncts). So once a delegate is pinned, the funder's own signature would not recover tovoucherSigneranddecdn channel closewould revert. That branch now callscloseChannelWithoutVoucher.One residual is recorded in a comment rather than fixed:
BuyerChannelStatecarries novoucher_signer, so the CLI uses "do we hold a watermark" as a proxy for "do we hold a key this channel accepts". A funder-run CLI holding a non-zero watermark it did not sign would still take the reverting branch. Unreachable until a delegation CLI surface exists.Closes #1476
🤖 Generated with Claude Code
Summary by CodeRabbit
voucherSignerat open (self-signing remains the default when unset).closeChannelWithoutVoucherfor voucher-less closure.voucherSigner, and the CLI output format shifts accordingly.