From b51d5687b212477e5866c82f856d777a8429a090 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 6 Dec 2025 00:01:14 -0800 Subject: [PATCH] fix(server-party): include self in participants list for keygen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JoinSession response contains OtherParties (excluding self) and PartyIndex (self's index). The participants list passed to TSS keygen must include all parties including self, otherwise validation fails with "invalid party count" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../output/grpc/message_router_client.go | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go b/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go index d69c3f4e..4104ccbc 100644 --- a/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go +++ b/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go @@ -637,16 +637,28 @@ func (c *MessageRouterClient) JoinSession( } // Convert response to SessionInfo - participants := make([]use_cases.ParticipantInfo, len(resp.OtherParties)) - for i, p := range resp.OtherParties { + // Include both other parties AND self in the participants list + participants := make([]use_cases.ParticipantInfo, 0, len(resp.OtherParties)+1) + + // Add self first + participants = append(participants, use_cases.ParticipantInfo{ + PartyID: partyID, + PartyIndex: int(resp.PartyIndex), + }) + logger.Debug("Added self to participants", + zap.String("party_id", partyID), + zap.Int32("party_index", resp.PartyIndex)) + + // Add other parties + for _, p := range resp.OtherParties { logger.Debug("Received party_index from Message Router", zap.String("party_id", p.PartyId), zap.Int32("party_index", p.PartyIndex)) - participants[i] = use_cases.ParticipantInfo{ + participants = append(participants, use_cases.ParticipantInfo{ PartyID: p.PartyId, PartyIndex: int(p.PartyIndex), - } + }) } sessionInfo := &use_cases.SessionInfo{