Repository navigation
docs: specify fee calculation at settlement, not close - #49
Conversation
Protocol fee is computed at final settlement (after dispute window expires) based on the highest valid voucher, not at closeChannel time. Adds settleChannel to the contract interface, ChannelSettled event, claimedNonce to Channel struct, and updates gas cost table for the three-step lifecycle. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request refines the payment channel mechanism by introducing a three-step lifecycle consisting of initiation, a dispute window, and final settlement. Key changes include the addition of a settleChannel function, a claimedNonce field for tracking the latest valid state, and new events for better observability across the system. The review feedback focused on maintaining a high-level architectural perspective in the ADR documentation by abstracting away low-level implementation details and ensuring consistency across the various documents.
There was a problem hiding this comment.
Pull request overview
Updates the ADR documentation to clarify that protocol fees are computed at final settlement (after the dispute window), and documents the resulting 3-step channel lifecycle (close → dispute → settle).
Changes:
- Clarifies fee timing and fund distribution mechanics in ADR 003, including documenting
settleChannelandChannelSettled. - Updates watchtower monitoring events/behavior to include
ChannelSettled(ADR 007) with a cross-reference to ADR 003. - Updates tokenomics fee wording and the gas/amortization table to include
settleChannel(ADR 004).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| adr/003-payments.md | Documents settlement-time fee calculation, adds settleChannel/ChannelSettled, and introduces claimedNonce in the channel state spec. |
| adr/004-tokenomics.md | Updates fee allocation wording to “at settlement” and extends the gas/amortization section for the 3-step lifecycle. |
| adr/007-watchtower.md | Adds ChannelSettled to the watchtower event set and explains how watchtowers use it to stop monitoring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- disputeChannel step now explicitly mentions claimedNonce update - Client→node bullet reflects 3-step close/settle flow - British spelling consistency (finalised) - PoC action items include ChannelSettled event Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
closeChanneltime — closes ADR 003: Fee calculation on disputed channel closes is unspecified #20settleChannel(bytes32 channelId)to theIStablePaymentChannelinterface andChannelSettledeventclaimedNoncefield toChannelstruct for dispute nonce comparisonChannelSettledevent to ADR 007 watchtower monitoring events with cross-reference to ADR 003Test plan
003-payments.md#fee-calculation-on-disputed-closes)provider = claimedAmount - fee,treasury = fee,client = deposit - claimedAmount🤖 Generated with Claude Code