fix(co-sign): allow T to N participants for sign sessions

- Change ValidateSessionCreation to accept T <= participantCount <= N for sign sessions
- Co-managed sign uses exactly T parties
- Persistent sign uses T+1 parties
- Both now pass validation with correct keygenThresholdN

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-31 06:19:57 -08:00
parent 99fa003b12
commit 94ab63db30
1 changed files with 6 additions and 4 deletions

View File

@ -29,12 +29,14 @@ func (s *SessionCoordinatorService) ValidateSessionCreation(
// Validate participant count based on session type
// For keygen: all n parties must participate (participantCount == n or 0 for dynamic)
// For sign: only t parties participate (participantCount == t or 0 for dynamic)
// For sign: at least t parties required, can have up to n (participantCount >= t && <= n)
// - Co-managed sign uses exactly T parties
// - Persistent sign uses T+1 parties
if participantCount != 0 {
if sessionType == entities.SessionTypeSign {
// Signing session: participant count should equal threshold t
// (the minimum number of parties needed to sign)
if participantCount != threshold.T() {
// Signing session: participant count must be at least t (threshold)
// and at most n (total parties from keygen)
if participantCount < threshold.T() || participantCount > threshold.N() {
return entities.ErrSessionFull
}
} else {