Problem
There is currently no automated mechanism to verify that the database state matches the on-chain state. If a Stellar transaction fails silently, a webhook is missed, or a manual database edit occurs, the escrow record could become inconsistent with the blockchain. The ConsistencyCheckerService exists but only does basic checks.
Current State
modules/admin/services/consistency-checker.service.ts — Basic checks
modules/admin/controllers/admin-escrow-consistency.controller.ts — Manual trigger endpoint
StellarEvents entity — Stores on-chain events but not cross-referenced
- No automated scheduled consistency checks
Acceptance Criteria
Technical Notes
- Use
StellarService.getAccountInfo() and Soroban contract reads for verification
- Consistency checks should be non-blocking and not affect escrow operations
- Critical discrepancies: status mismatch, amount mismatch
- Warning discrepancies: missing events, stale timestamps
Points: 150 (Medium)
Problem
There is currently no automated mechanism to verify that the database state matches the on-chain state. If a Stellar transaction fails silently, a webhook is missed, or a manual database edit occurs, the escrow record could become inconsistent with the blockchain. The
ConsistencyCheckerServiceexists but only does basic checks.Current State
modules/admin/services/consistency-checker.service.ts— Basic checksmodules/admin/controllers/admin-escrow-consistency.controller.ts— Manual trigger endpointStellarEventsentity — Stores on-chain events but not cross-referencedAcceptance Criteria
ConsistencyCheckerServicewith on-chain verification:ConsistencyReportentity or JSON logGET /admin/consistency/reportsendpoint:POST /admin/consistency/resolveendpoint:AdminAuditLogGET /admin/consistency/:escrowIdendpoint:Technical Notes
StellarService.getAccountInfo()and Soroban contract reads for verificationPoints: 150 (Medium)