chore: add detailed logging for keygen_session_id tracing

Add logging at key points to trace keygen_session_id flow:
- Account Handler: log keygen_session_id when creating signing session
- Session Coordinator: log keygen_session_id in CreateSession and JoinSession
- Message Router: log keygen_session_id when proxying JoinSession
- Server Party: log keygen_session_id when joining session

🤖 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-06 09:21:19 -08:00
parent a1b2b760ab
commit fd74bc825a
4 changed files with 27 additions and 5 deletions

View File

@ -814,7 +814,8 @@ func (h *AccountHTTPHandler) CreateSigningSession(c *gin.Context) {
logger.Info("Calling CreateSigningSession via gRPC (auto party selection)",
zap.String("username", req.Username),
zap.Int("threshold_t", accountOutput.Account.ThresholdT),
zap.Int("available_parties", len(partyIDs)))
zap.Int("available_parties", len(partyIDs)),
zap.String("keygen_session_id", accountOutput.Account.KeygenSessionID.String()))
}
resp, err := h.sessionCoordinatorClient.CreateSigningSessionAuto(
@ -835,7 +836,9 @@ func (h *AccountHTTPHandler) CreateSigningSession(c *gin.Context) {
logger.Info("gRPC CreateSigningSession succeeded",
zap.String("session_id", resp.SessionID),
zap.Int("num_parties", len(resp.SelectedParties)))
zap.Int("num_parties", len(resp.SelectedParties)),
zap.String("keygen_session_id", accountOutput.Account.KeygenSessionID.String()),
zap.Strings("selected_parties", resp.SelectedParties))
// Record session_created event for sign
signSessionID, _ := uuid.Parse(resp.SessionID)

View File

@ -532,11 +532,16 @@ func (s *MessageRouterServer) JoinSession(
}
}
keygenSessionID := ""
if resp.SessionInfo != nil {
keygenSessionID = resp.SessionInfo.KeygenSessionId
}
logger.Info("Proxied JoinSession to coordinator",
zap.String("session_id", req.SessionId),
zap.String("party_id", req.PartyId),
zap.Int32("party_index", resp.PartyIndex),
zap.Bool("success", resp.Success))
zap.Bool("success", resp.Success),
zap.String("keygen_session_id", keygenSessionID))
return resp, nil
}

View File

@ -685,7 +685,10 @@ func (c *MessageRouterClient) JoinSession(
logger.Info("Joined session via Message Router",
zap.String("session_id", sessionID.String()),
zap.String("party_id", partyID),
zap.String("session_type", sessionInfo.SessionType))
zap.String("session_type", sessionInfo.SessionType),
zap.String("keygen_session_id", sessionInfo.KeygenSessionID.String()),
zap.Int("threshold_n", sessionInfo.ThresholdN),
zap.Int("threshold_t", sessionInfo.ThresholdT))
return sessionInfo, nil
})

View File

@ -203,7 +203,9 @@ func (s *SessionCoordinatorServer) CreateSession(
logger.Info("gRPC CreateSession completed successfully",
zap.String("session_id", output.SessionID.String()),
zap.Int("num_join_tokens", len(output.JoinTokens)))
zap.Int("num_join_tokens", len(output.JoinTokens)),
zap.String("keygen_session_id", inputData.KeygenSessionID.String()),
zap.String("session_type", req.SessionType))
// Load session to get delegate party ID
session, err := s.sessionRepo.FindByUUID(ctx, output.SessionID)
@ -288,6 +290,15 @@ func (s *SessionCoordinatorServer) JoinSession(
keygenSessionIDStr = output.SessionInfo.KeygenSessionID.String()
}
logger.Info("gRPC JoinSession completed",
zap.String("session_id", output.SessionInfo.SessionID.String()),
zap.String("party_id", req.PartyId),
zap.Int("party_index", output.PartyIndex),
zap.String("keygen_session_id", keygenSessionIDStr),
zap.String("session_type", output.SessionInfo.SessionType),
zap.Int("threshold_n", output.SessionInfo.ThresholdN),
zap.Int("threshold_t", output.SessionInfo.ThresholdT))
return &pb.JoinSessionResponse{
Success: output.Success,
SessionInfo: &pb.SessionInfo{