Skip to content

feat(signing)!: deliver signature results by pointer - #39

Merged
piotr-roslaniec merged 2 commits into
devfrom
feat/signature-result-pointer
Oct 2, 2026
Merged

piotr-roslaniec merged 2 commits into
devfrom
feat/signature-result-pointer

Conversation

@piotr-roslaniec

Copy link
Copy Markdown

Breaking API change for signing callers.

common.SignatureData is a protobuf message and embeds a mutex. Delivering it by value over the signing end channel makes every receiver copy a lock, so go vet reports copylocks (keep-core already trips it). This switches to the API upstream BNB adopted in fbb0ef7, which this fork had deferred as unneeded API churn. The protobuf runtime upgrade (#19) is what made the by-value form wrong, and #37 already breaks the signing constructor, so making the change before the first tagged release avoids a second breaking release.

Changes

  • signing.NewLocalParty / NewLocalPartyWithKDD take end chan<- *common.SignatureData.
  • LocalParty stores its signature data by pointer, matching upstream.
  • finalize sends proto.Clone(round.data), so the receiver owns a deep copy and shares nothing with the party. Upstream sends round.data itself; this is the only difference.
  • Tests, the mixed-binary harness, and the README example are updated. historical_signer is unchanged because it builds against the pinned historical tss-lib.

Migration

endCh := make(chan *common.SignatureData, 1) // was chan common.SignatureData
// ...
sig := <-endCh // sig is *common.SignatureData

Verification

  • go build ./..., go vet ./..., go test -run ^$ ./... (every test binary compiles): pass
  • go test -race -shuffle=on ./ecdsa/signing: pass
  • Mixed-binary harness: reject in round 3 with both culprits; accept and homogeneous runs reach round 8 on both sides
  • Bidirectional historical transcript oracle: pass
  • keep-core#4349 adapted and tested against this branch

common.SignatureData is a protobuf message and embeds a mutex, so delivering it by value over the signing end channel made every receiver copy a lock (go vet copylocks). The end channel is now chan<- *common.SignatureData and the party stores its data by pointer, matching upstream BNB fbb0ef7. finalize sends a proto.Clone so the receiver owns a deep copy.
@piotr-roslaniec
piotr-roslaniec merged commit 6056170 into dev Oct 2, 2026
4 checks passed
piotr-roslaniec added a commit to threshold-network/keep-core that referenced this pull request Oct 2, 2026
Bump the tss-lib pin to 6056170 (threshold-network/tss-lib#39), whose signing end channel now carries *common.SignatureData. Receiving the protobuf message by value copied its embedded mutex; go vet ./pkg/tecdsa/... is now clean.
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