rwadurian/backend/services/mpc-service
hailin d983525aa5 fix(wallet): resolve account creation and wallet status query issues
This commit fixes three critical bugs that prevented the wallet creation
flow from completing successfully:

1. mpc-service: extraPayload not included in Kafka messages
   - KeygenCompletedEvent's extraPayload (containing userId, accountSequence,
     username, derivedAddresses) was being set dynamically but not serialized
   - identity-service received events without userId and skipped processing
   - Fix: Merge extraPayload into the published payload in event-publisher

2. mpc-service: KAFKA_BROKERS hostname mismatch
   - mpc-service used KAFKA_BROKERS=rwa-kafka:29092
   - Kafka advertises itself as kafka:29092 in cluster metadata
   - During consumer group rebalance, mpc-service couldn't connect to
     the coordinator address returned by Kafka
   - Fix: Use kafka:29092 to match Kafka's advertised listener

3. blockchain-service: recovery_mnemonics table missing
   - RecoveryMnemonic model exists in schema.prisma but not in migration
   - prisma migrate deploy found no pending migrations
   - Address derivation failed with "table does not exist" error
   - Fix: Use prisma db push instead of migrate deploy to sync schema

Tested: E2E flow now completes successfully
- POST /user/auto-create creates account
- MPC keygen completes and publishes event with extraPayload
- blockchain-service derives addresses and saves recovery mnemonic
- GET /user/wallet returns status=ready with 3 addresses and mnemonic

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 07:57:17 -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(wallet): resolve account creation and wallet status query issues 2025-12-08 07:57:17 -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 refactor: unify docker-compose configs to use shared infrastructure 2025-12-07 00:35:56 -08:00
docker-entrypoint.sh fix(mpc-service): convert docker-entrypoint.sh line endings from CRLF to LF 2025-12-06 23:34:40 -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