Repository navigation
fix(node): canonicalize the capability owner signature and isolate a reverting redeemMany claim - #2854
Conversation
…reverting redeemMany claim Intake stores the owner signature as the canonical signature.as_bytes() (v = 27 + parity) instead of the raw wire bytes, settlement re-canonicalizes stored rows before building a CapabilityReg, and a reverted multi-claim redeemMany chunk now halves via submit_halves so a poisoned claim ends alone while the healthy claims land. Closes #2835 Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 7 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…parseable owner_sig rows Review follow-ups: the wallet provider estimates gas before every send, so a claim the contract refuses surfaces as a refused send (SendErr), not a mined revert — split that case too (is_revert_send). A stored owner_sig that from_raw cannot parse is the same durability fault as a missing one: error! and skip instead of sending a claim known to revert. An unhalved revert's warn now names the lone claim's lane. Comment/doc corrections (register_lane vacant-slot guard, submit_halves, MAX_SPLIT_DEPTH, metric docs, ADR observability rows) and tests for the estimate-revert split, the depth bound, a transient parent revert, and ScriptedRpc::erroring_sends. Co-Authored-By: Claude Fable 5 <[email protected]>
| // warn-and-retry. Re-sending the chunk's lanes in halves is safe for | ||
| // the same reason as the oversize split above. | ||
| TxOutcome::SendErr(err) | ||
| if lanes.len() >= 2 && depth < MAX_SPLIT_DEPTH && is_revert_send(&err) => |
There was a problem hiding this comment.
Fixed in e830aa0. Revert splits (gas-estimate and mined) no longer take the depth bound: they halve down to the lone claim within the eligible sweep, so no sub-floor sub-chunk is left behind. MAX_SPLIT_DEPTH now bounds only the oversize split. Worst case is 2n − 1 sends for a chunk whose every claim reverts; a deterministic veto fails at the gas estimate, so those sends spend no gas. Test: a_full_chunk_isolates_one_poisoned_claim_in_one_sweep_under_a_floor (300 claims × 4,000 µUSDC, 1,000,000 µUSDC floor, last claim poisoned: 9 splits, 299 claims land, one lone-claim retry).
… sweep A depth-bounded revert split left a few-claim sub-chunk for the next sweep, where the per-chunk redemption floor dropped it on its own value, so its healthy claims waited unpaid until their capabilities expired. Revert splits now run to single claims; the oversize split keeps MAX_SPLIT_DEPTH. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Gas snapshotNo gas changes vs base. |
|
Follow-up: this PR keeps the node-side bisection as a workaround, because the deployed PaymentPool still reverts the whole call on one failing claim. The proper fix is a contract change so |

intake_capabilityparses the owner signature withSignature::from_raw, which accepts recovery bytes 0/1 (and the EIP-155 forms) and recovers the correct owner — but it stored the raw wire bytes. Settlement forwarded them verbatim, and on chainECDSA.tryRecoverreturnsaddress(0)for v ∉ {27, 28}, soredeemManyreverted withInvalidCapabilitySignature— the whole chunk, on every sweep, until the capability expired. One capability and one voucher were enough to block a settlement batch.Four changes:
signature.as_bytes()(a v=0/1 capability is accepted and normalized to 27/28 — recovery already proved the owner, so refusal would only punish a sloppy but honest encoder);register_lanerecords only into a vacant lane slot, so intake alone never rewrites an existing row); a rowfrom_rawcannot parse is a node durability fault: logged and skipped, like a missingowner_sig;redeemManywhose pre-flight gas estimate reverts bisects via the existingsubmit_halves— the wallet provider estimates before every send, so this refused-send leg, not a mined revert, is how a poisoned claim actually surfaces — and a mined revert of a multi-claim chunk (the estimate-to-inclusion state race) bisects the same way, so a poisoned claim ends alone and the healthy claims land;pool_id,lane_signer).Test support:
ScriptedRpc::mined_in_order(per-send receipts),reverted_receipt, anderroring_sends(JSON-RPC error answers, as a node answers a reverting estimate).Closes #2835
🤖 Generated with Claude Code