Add time-windowed sign discovery support#38
Open
jairajdev wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates native
tss signbootstrap so a signing session can form with any consistent signer setkwheret+1 <= k <= n.The main change is to treat sign-mode bootstrap as a time-windowed discovery phase instead of finishing as soon as the minimum signer count is seen.
That prevents different nodes from forming different signer sets for the same sign session when more than
t+1parties participate.Documentation Included In This PR
This branch also includes two supporting documents under
doc/for reviewers:doc/sign-time-windowed-discovery-pr-details.md— a detailed design and implementation note covering the problem, behavior change, supporting transport changes, and validation approachdoc/sign-time-windowed-discovery-test-result.log— the full recorded 7-party scenario matrix output used for validation (PASS=34,FAIL=0,total=34)Those files are intended to make review easier without requiring the entire test story to live only in the PR description.
Background
The original behavior could commit a signing session too early. In practice, one node could observe a 2-party signer set and another node could still be trying to join the same sign session. That made session membership timing-dependent and could stall signing when more than
t+1parties started concurrently.This PR changes the session-formation logic so signers that arrive within the same bounded discovery window converge on one committed signer set before signing rounds begin.
Behavior Change
For native
tss sign, bootstrap now stays open until one of these conditions is true:thresholdremote peers have been discoveredThat means the resulting signer set can be any consistent subset size
kwheret+1 <= k <= n.With
--sign_discovery_timeout 0, signing waits for all parties. With a positive timeout such as5s, signing admits the parties that arrive within that window and commits that set.Implementation Details
The feature depends on a few related changes working together:
--sign_discovery_timeoutto the nativetss signcommandSignDiscoveryTimeoutto config decodingWhy this is safe
This PR changes session formation in
tss. It does not change the underlying signing math intss-lib.tss-libalready supports signing with any subset sizekas long ask >= t+1and all participants use the same signer set. This PR makes nativetssconverge on one consistent signer set before rounds start.Files Changed
common/config.gocommon/messages.gocommon/bootstrapper.gocmd/root.goclient/client.gop2p/p2p_transporter.goscripts/test-sign-rounds.shdoc/sign-time-windowed-discovery-pr-details.mddoc/sign-time-windowed-discovery-test-result.logNative Usage
Require all parties to join before signing:
Allow a flexible signer set to form within a 5-second window:
Validation
The change was validated locally with a fresh 7-party keygen setup (
n = 7,t = 3) and nativetss signruns.Representative results:
--sign_discovery_timeout 5scompleted successfully (7/7signed)0 0 0 0 8 12 16produced a clean4/7signing session, with late starters not disrupting the committed sessionFull harness result from the 7-party scenario matrix:
The full scenario-by-scenario output is included in
doc/sign-time-windowed-discovery-test-result.log.Related