Skip to content

fix(token): preserve auditor signatures in Request.SetSignatures - #1905

Merged
adecaro merged 1 commit into
LFDT-Panurus:mainfrom
YanYuanFE:fix/set-signatures-preserve-auditor
Jul 15, 2026
Merged

fix(token): preserve auditor signatures in Request.SetSignatures#1905
adecaro merged 1 commit into
LFDT-Panurus:mainfrom
YanYuanFE:fix/set-signatures-preserve-auditor

Conversation

@YanYuanFE

Copy link
Copy Markdown
Contributor

Motivation

Since #1717 action signatures and auditor signatures share the unified Actions.Signatures slice, but Request.SetSignatures kept its whole-field assignment. Any auditor signature attached beforehand via AddAuditorSignature is silently discarded, and endorsement later fails in common.AuditingSignaturesValidate with auditor signatures missing.

We hit this in our test environments with a flow that requests auditing before collecting endorsements (passing WithSkipAuditing() to CollectEndorsementsView). The SDK's default flow is unaffected because it happens to call SetSignatures before requestAudit. See #1897 for the full analysis; maintainers confirmed there that this is an unintended side effect of #1717.

Changes

  • SetSignatures now preserves existing .Auditor entries when assigning action signatures, restoring the pre-Aggregated Protobuf Best Practices Analysis & Improvement Plan #1622 #1717 order-independence of AddAuditorSignature and SetSignatures. The resulting slice order (action entries first, auditor entries after) matches what the default flow produces.
  • Regression test TestRequest_SetSignatures_PreservesAuditorSignatures: an auditor signature attached before SetSignatures survives the call, and a second SetSignatures call does not duplicate it.

Fixes #1897

@adecaro
adecaro self-requested a review July 14, 2026 03:56
@adecaro adecaro self-assigned this Jul 14, 2026
@adecaro
adecaro force-pushed the fix/set-signatures-preserve-auditor branch from fc6eaa7 to e040806 Compare July 14, 2026 03:57
@AkramBitar AkramBitar added this to the Q3/26 milestone Jul 14, 2026
Comment thread token/request.go Outdated

@adecaro adecaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@YanYuanFE , left a comment. Please, have a look.

@YanYuanFE
YanYuanFE force-pushed the fix/set-signatures-preserve-auditor branch from e040806 to 69e5bb4 Compare July 14, 2026 08:20
Comment thread token/request.go Outdated
@adecaro

adecaro commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@YanYuanFE , thanks for the prompt update. Another small thing and we are good to merge 🙏

@YanYuanFE
YanYuanFE force-pushed the fix/set-signatures-preserve-auditor branch from 8977c2a to 75fb814 Compare July 14, 2026 13:40
@adecaro
adecaro self-requested a review July 14, 2026 13:41

@adecaro adecaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@adecaro
adecaro force-pushed the fix/set-signatures-preserve-auditor branch 2 times, most recently from bae6de7 to e6ce76e Compare July 14, 2026 18:15
Since LFDT-Panurus#1717 action and auditor signatures share the unified
Actions.Signatures slice, but SetSignatures still assigned the whole
field, silently dropping auditor signatures attached beforehand via
AddAuditorSignature. Endorsement then fails with 'auditor signatures
missing' when auditing runs before endorsement collection.

Append the action signatures to the ones already attached, restoring
the pre-LFDT-Panurus#1717 order-independence of the two calls, and rename
SetSignatures to AppendSignatures so the name states that contract.

Fixes LFDT-Panurus#1897

Signed-off-by: YanYuan <yan950414@gmail.com>
@adecaro
adecaro force-pushed the fix/set-signatures-preserve-auditor branch from c4bc1d2 to 88b6d35 Compare July 15, 2026 05:35
@adecaro
adecaro merged commit c00c574 into LFDT-Panurus:main Jul 15, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request.SetSignatures silently drops auditor signatures attached beforehand (since #1717)

3 participants