diff --git a/backend/mpc-system/services/server-party/application/use_cases/participate_signing.go b/backend/mpc-system/services/server-party/application/use_cases/participate_signing.go index da81862d..585ae2c3 100644 --- a/backend/mpc-system/services/server-party/application/use_cases/participate_signing.go +++ b/backend/mpc-system/services/server-party/application/use_cases/participate_signing.go @@ -156,6 +156,16 @@ func (uc *ParticipateSigningUseCase) Execute( return nil, err } + // Wait for all parties to subscribe before starting TSS protocol + // This prevents race condition where some parties send broadcast messages + // before others have subscribed to the session + expectedParties := len(sessionInfo.Participants) + logger.Info("Waiting for all parties to subscribe", + zap.String("session_id", input.SessionID.String()), + zap.String("party_id", input.PartyID), + zap.Int("expected_parties", expectedParties)) + time.Sleep(500 * time.Millisecond) + // Use message hash from session if not provided messageHash := input.MessageHash if len(messageHash) == 0 {