Repository navigation
fix(contracts)!: register a signer's capability at the larger value of each field - #2994
Merged
Merged
Conversation
…f each field `_registerCapability` keeps max(cap) and max(expiry) over every owner-signed capability landed for a signer, instead of the first one. A pool owner can no longer land a narrow capability ahead of the wide one a node serves under: the node's first redemption carries its own capability and raises the registration, so its vouchers redeem in full. The node's admission clamp to the on-chain registration is removed; it would mark the lane registered and stop the node landing its capability. ADR 003 drops the "two capabilities for an unregistered signer" residual. Closes #2839 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 6 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Gas snapshotNo gas changes vs base. |
This was referenced Nov 25, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2839.
Problem
Capability registration was write-once. A pool owner could sign a wide capability and a narrow one (1 µUSDC, or near-expiry) for the same signer, open streams on the wide one, and land the narrow one first with a capability-only
redeemMany. Every stream served under the wide capability then redeemed for about nothing.Fix
_registerCapabilitykeepsmax(cap)andmax(expiry)over every owner-signed capability landed for a signer. A capability that raises neither field is a no-op and is not verified. A zero-cap or already-expired capability is still never recorded. The node's first redemption carries its own capability, so the registration rises to the terms it served under and its vouchers redeem in full. The node needs no chain watching.[low cap, long expiry]and[high cap, short expiry]are not comparable, so a both-fields rule would keep the race.The issue's payee-gate and
CapabilityRegisteredevent checkboxes are not needed with this rule. sponsord is unaffected: it rotates signer keys and never raises terms.Registration costs about 400 gas more (the conditional writes).
.gas-snapshotis regenerated.Tests
presented_capability_raises_a_narrower_registrationreplaces the clamp e2e test: the owner lands narrow A, the delegate fetches the whole blob under wide B, every accepted payment redeems, and the registration ends at B's terms. This drops that test's drained-signer "new signer key" tail; the remedy wording stays covered by the CLI unit tests.forge test(642), slither,cargo clippy --all-features,cargo docwith warnings denied,cargo nextestfor node/incentive/cli/client (4405 pass), and the delegated anvil e2e all pass locally.🤖 Generated with Claude Code