Skip to content

Feat/ledger monitor tx signer 627 630#696

Merged
emdevelopa merged 2 commits into
emdevelopa:mainfrom
OlaGreat:feat/ledger-monitor-tx-signer-627-630
Apr 23, 2026
Merged

Feat/ledger monitor tx signer 627 630#696
emdevelopa merged 2 commits into
emdevelopa:mainfrom
OlaGreat:feat/ledger-monitor-tx-signer-627-630

Conversation

@OlaGreat

Copy link
Copy Markdown
Contributor

closes #632
closes #627
closes #630
closes #631
Feat/ledger monitor tx signe

…hic signature verification to Transaction Signer

Issue emdevelopa#627 — Enhance error recovery for Ledger Monitor (horizon-poller.js):
- Circuit breaker: trips after MAX_CONSECUTIVE_FAILURES (5) DB fetch failures,
  pauses polling for CIRCUIT_BREAKER_RESET_MS (5 min) before auto-recovery
- Exponential back-off: [5s, 15s, 30s, 60s] schedule applied after each DB error
- Per-payment isolation: Horizon errors during lookup are caught individually so
  one bad payment never aborts the full cycle
- Signature verification gate: payments with invalid/unverifiable signatures are
  skipped (not failed) so they can be re-checked next cycle
- Duplicate tx_id guard: atomic update with .is('tx_id', null) prevents double-claim
- Underpayment/overpayment detection via findAnyRecentPayment with graceful fallback
- Structured logging on every error path for observability
- Exposed pollOnce() for deterministic unit testing without timer loops
- getPollerHealth() / resetPollerState() for health-check endpoints and tests
- Full test coverage: 15 tests covering all error paths (horizon-poller.test.js)

Issue emdevelopa#630 — Add cryptographic signature verification to Transaction Signer (stellar.js):
- verifyTransactionSignature() performs full Ed25519 cryptographic verification:
  1. Fetch transaction envelope from Horizon
  2. Deserialise XDR and confirm signatures present
  3. Load source account signers and medium threshold
  4. Verify each signature against known signers using hint-narrowing + Ed25519
  5. Accumulate signing weight and check against medium threshold
- Returns rich SignatureVerificationResult: { valid, reason, isMultiSig,
  signatureCount, thresholdMet } instead of a plain boolean
- Graceful fallback on every failure path (never throws, always returns valid=false)
- Multi-sig support: detects accounts with multiple signers or threshold > 1
- Full test coverage: 16 tests covering all verification paths (transaction-signer.test.js)
- Updated signature-verification.test.js to match new rich-object return type
@vercel

vercel Bot commented Apr 23, 2026

Copy link
Copy Markdown

@OlaGreat is attempting to deploy a commit to the Emmanuel's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Apr 23, 2026

Copy link
Copy Markdown

@OlaGreat Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@emdevelopa emdevelopa merged commit 0d5021f into emdevelopa:main Apr 23, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants