Skip to content

Implement idempotent escrow operations - #129

Open
kimanicode wants to merge 1 commit into
Eduvault-stellar:mainfrom
kimanicode:feat/idempotent-escrow-reconciliation-109
Open

Implement idempotent escrow operations#129
kimanicode wants to merge 1 commit into
Eduvault-stellar:mainfrom
kimanicode:feat/idempotent-escrow-reconciliation-109

Conversation

@kimanicode

Copy link
Copy Markdown

Summary

Implements idempotent escrow command execution and reconciliation for the Stellar/Trustless Work escrow integration.
closes #109

Changes

  • Added persisted escrow_operations and escrow_operation_audit schema/index definitions.
  • Added escrow operation lifecycle handling with:
    • database-enforced idempotency keys
    • deterministic payload hashes
    • resumable submission, confirmation, and projection stages
    • bounded exponential backoff
    • terminal failure handling
    • reconciliation against on-chain/indexed escrow state
    • audit entries for lifecycle and replay/reconcile actions
    • operation age, retry count, and reconciliation failure metrics
  • Extended scripts/replay-escrow.mjs with a reconcile mode.
  • Added a read-only escrow operation status API.
  • Extended escrow hooks with operation status helpers.
  • Split indexer event identity helpers into a small shared module to avoid unnecessary decoder imports in escrow projection.
  • Added backend tests for idempotency, state transitions, retry/backoff, reconciliation, confirmation failure, and crash recovery.

Verification

node --test tests/backend/escrowOperations.test.mjs tests/backend/escrowIndexer.test.mjs
1..10
# tests 10
# suites 0
# pass 10
# fail 0
# cancelled 0
# skipped 0
# todo 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BLOCKCHAIN]: Build idempotent escrow command execution and reconciliation

1 participant