fix: cancel signing only when collected signatures meet the threshold - #368
fix: cancel signing only when collected signatures meet the threshold#368ScreamingHawk wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e11704b15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5e11704 to
3bc6209
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bc6209401
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3bc6209 to
09ead03
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09ead030a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
BuildRegularSignature and BuildNoChainIDSignature cancelled outstanding signers using signersWeight, which counts payload-blind subdigest leaves as satisfied for any payload. A config containing such a leaf therefore looked satisfied as soon as the first signature arrived, and cancellation nondeterministically dropped signatures that recovery of a non-matching payload still needs. Add collectedSignersWeight, which counts subdigest leaves as zero, and use it for the cancellation decision. validateSigningPower still checks the optimistic signersWeight, so validation semantics are unchanged. This makes the orchestrated path safe for pre-collected signatures, so BuildIntentConfigurationSignature returns to BuildRegularSignature and the BuildRegularSignatureFromSignatures workaround is removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sses The final signersWeight check counts payload-blind subdigest leaves as satisfied even for an empty signer set, so BuildRegularSignature and BuildNoChainIDSignature with validateSigningPower could succeed without collecting any signature. Restore the isValid flag, set only after a non-nil signature brings the optimistic signersWeight to the threshold, while cancellation keeps using collectedSignersWeight. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
09ead03 to
0106bc9
Compare
Routing through BuildRegularSignature cancelled early once the main signer met threshold 1. Restore the no-orchestration path and drop the intent-only churn; collectedSignersWeight remains the fix for live signing cancellation. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
BuildRegularSignatureandBuildNoChainIDSignaturecancelled outstanding signers based onsignersWeight, which counts payload-blind subdigest leaves (WalletConfigTreeSubdigestLeaf/WalletConfigTreeAnyAddressSubdigestLeaf) as satisfied for any payload. A config containing such a leaf therefore looked satisfied as soon as the first signature arrived, and cancellation nondeterministically dropped signatures that recovery of a non-matching payload still needs (reproduced on Add PausableSapient support to Trails intents #367: 221/1000 builds were byte-for-byte gate-only despite both signatures being supplied).collectedSignersWeight, which counts subdigest leaves as zero, and uses it for the cancellation decision only.validateSigningPowerstill checks the optimisticsignersWeight, so validation semantics are unchanged.BuildIntentConfigurationSignaturereturns toBuildRegularSignatureand theBuildRegularSignatureFromSignaturesworkaround from Add PausableSapient support to Trails intents #367 is removed.This is the upstream follow-up promised in #367 (comment). Based on
pausable(#367) since it reverts that branch's workaround; retarget tomasteronce #367 merges.Test plan
go build ./...TestBuildRegularSignatureCollectsAllSignersDespiteSubdigestLeafincore/v3TestCreateIntent*,TestGetIntentConfiguration*) against local testchain🤖 Generated with Claude Code