rwadurian/backend/services/mpc-service
hailin 10b25e222e fix: 防止钱包生成中状态下重复触发MPC keygen
问题:
- 前端在钱包状态为"generating"时仍然调用retryWalletGeneration
- 后端identity-service没有检查生成中状态
- mpc-service没有幂等保护,可能导致同一用户多次keygen

修复:
1. 前端 wallet_status_provider.dart:
   - 只在"failed"状态下才触发重试
   - "generating"状态只更新UI,继续轮询等待

2. 后端 identity-service user-application.service.ts:
   - retryWalletGeneration添加Redis状态检查
   - pending/generating/deriving状态下跳过重试
   - 只有failed或无状态时才触发重试

3. 后端 mpc-service keygen-requested.handler.ts:
   - 使用分布式锁防止同一用户重复keygen
   - 锁TTL为5分钟,覆盖整个keygen过程
   - 无法获取锁时跳过请求

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:55:51 -08:00
..
config refactor: simplify mpc-service to gateway mode 2025-12-06 17:16:14 -08:00
docs refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
prisma fix(prisma): remove redundant migrations and duplicate indexes 2025-12-08 07:08:24 -08:00
src fix: 防止钱包生成中状态下重复触发MPC keygen 2025-12-21 18:55:51 -08:00
tests refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
.env.example docs(config): update .env.example files for production deployment 2025-12-07 04:55:21 -08:00
.gitignore refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
Context(微服务)架构.jpg feat: 添加MPC多方计算服务模块 2025-11-27 17:31:43 -08:00
Dockerfile refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
MPC-Service-Context-Complete-Specification.md refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
deploy.sh . 2025-12-07 00:40:19 -08:00
docker-compose.yml fix: 修复多个服务的 accountSequence 类型和推荐关系 bug 2025-12-12 12:29:11 -08:00
docker-entrypoint.sh fix(mpc-service): use docker-entrypoint.sh instead of inline script 2025-12-09 02:54:11 -08:00
nest-cli.json refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
package-lock.json refactor: simplify mpc-service to gateway mode 2025-12-06 17:16:14 -08:00
package.json refactor: simplify mpc-service to gateway mode 2025-12-06 17:16:14 -08:00
tsconfig.json refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
项目目录架构.jpg feat: 添加MPC多方计算服务模块 2025-11-27 17:31:43 -08:00