topfans/backend/services/assetService/service
zerosaturation 3407e30395 refactor(assetService): CreateMintOrder 3-phase txn + orphan reconciliation (P0-2)
- CreateMintOrder 拆三段: txn1(PENDING→PROCESSING,不调RPC/不写asset)
  → 事务外 UpdateCrystalBalance 扣水晶 → txn2(建asset+registry→SUCCESS);
  消除 DB 事务内嵌跨服务 gRPC(连接池占用+跨服务事务风险)。
- 任一步失败 markMintOrderFailed 独立事务标 FAILED(不回滚已扣水晶=审计流水,
  重试靠 Task1 source_id 幂等 + Task2 入口短路防双扣); nil-cause 防御。
- 孤儿订单对账 ReconcileStuckMintOrders: 扫陈旧 PROCESSING 单,查 mint_cost 流水—
  已扣未建→FOR UPDATE 行锁下幂等补完 SUCCESS(串行化并发防双建),未扣→FAILED,绝不退款。
- main.go 接线周期 worker(MINT_RECONCILE_INTERVAL_SEC 默认600s,0关,优雅退出)。
- 测试: RPC失败落FAILED / 对账未扣→FAILED / 已扣未建→补完(含幂等二次跑)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 12:28:57 +08:00
..
asset_level_service_test.go fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
asset_level_service.go fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
asset_like_service.go
asset_service.go
castlove_config_service.go
material_service.go
minimax_service.go
mint_rate_limiter.go fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
mint_service_idempotency_test.go refactor(assetService): CreateMintOrder 3-phase txn + orphan reconciliation (P0-2) 2026-07-23 12:28:57 +08:00
mint_service.go refactor(assetService): CreateMintOrder 3-phase txn + orphan reconciliation (P0-2) 2026-07-23 12:28:57 +08:00
peripheral_service_test.go fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
peripheral_service.go fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
peripheral_test_helpers_test.go refactor(assetService): CreateMintOrder 3-phase txn + orphan reconciliation (P0-2) 2026-07-23 12:28:57 +08:00
ranking_service.go
share_service_test.go
share_service.go