Skip to content

fix: cancel signing only when collected signatures meet the threshold - #368

Open
ScreamingHawk wants to merge 4 commits into
pausablefrom
fix/conservative-signing-cancellation
Open

fix: cancel signing only when collected signatures meet the threshold#368
ScreamingHawk wants to merge 4 commits into
pausablefrom
fix/conservative-signing-cancellation

Conversation

@ScreamingHawk

Copy link
Copy Markdown
Contributor

Summary

  • BuildRegularSignature and BuildNoChainIDSignature cancelled outstanding signers based on signersWeight, 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).
  • Adds collectedSignersWeight, which counts subdigest leaves as zero, and uses it for the cancellation decision only. 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 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 to master once #367 merges.

Test plan

  • go build ./...
  • New TestBuildRegularSignatureCollectsAllSignersDespiteSubdigestLeaf in core/v3
  • Intent-config suite (TestCreateIntent*, TestGetIntentConfiguration*) against local testchain

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread intent_config.go Outdated
@ScreamingHawk
ScreamingHawk force-pushed the fix/conservative-signing-cancellation branch from 5e11704 to 3bc6209 Compare July 30, 2026 23:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread core/v3/v3.go Outdated
@ScreamingHawk
ScreamingHawk force-pushed the fix/conservative-signing-cancellation branch from 3bc6209 to 09ead03 Compare July 31, 2026 01:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread intent_config.go Outdated
ScreamingHawk and others added 3 commits July 31, 2026 13:27
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>
@ScreamingHawk
ScreamingHawk force-pushed the fix/conservative-signing-cancellation branch from 09ead03 to 0106bc9 Compare July 31, 2026 01:31
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant