From 94ab63db300b7bdd582e9ed46afeb671e98aa446 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 31 Dec 2025 06:19:57 -0800 Subject: [PATCH] fix(co-sign): allow T to N participants for sign sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .../domain/services/session_coordinator.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/mpc-system/services/session-coordinator/domain/services/session_coordinator.go b/backend/mpc-system/services/session-coordinator/domain/services/session_coordinator.go index f13331b3..333bd3ec 100644 --- a/backend/mpc-system/services/session-coordinator/domain/services/session_coordinator.go +++ b/backend/mpc-system/services/session-coordinator/domain/services/session_coordinator.go @@ -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 {