Skip to content

fix(resilience): wrap Horizon calls in retry/circuit-breaker for mult… - #1070

Merged
Mystery-CLI merged 1 commit into
Ethereal-Future:mainfrom
Good-Coded:fix/944-945-946-horizon-resilience-trustline-consolidation
Aug 3, 2026
Merged

fix(resilience): wrap Horizon calls in retry/circuit-breaker for mult…#1070
Mystery-CLI merged 1 commit into
Ethereal-Future:mainfrom
Good-Coded:fix/944-945-946-horizon-resilience-trustline-consolidation

Conversation

@Good-Coded

Copy link
Copy Markdown
Contributor

…iSig, trustlines, pathPayment

closes #944 — multiSig.js Horizon resilience

  • Import withHorizonRetry and extractStellarErrorCode/getStellarErrorInfo from stellar.js/stellarErrors.js
  • Wrap all getHorizonServer().loadAccount() and .submitTransaction() calls in withHorizonRetry() in createMultiSigAccount, buildMultiSigTransaction, submitMultiSigTransaction, getMultiSigConfig, and updateMultiSigConfig
  • Map caught Horizon errors through extractStellarErrorCode/getStellarErrorInfo before re-throwing so callers receive user-friendly messages matching the pattern already used by sendPayment
  • expireStaleTransactions and getPendingTransactions (Prisma-only) left as-is

closes #945 — Trustline consolidation

  • Add updateTrustlineLimit() to stellar.js with withHorizonRetry and TrustlineLimitUpdated event emission
  • Add batchCreateTrustlines() to stellar.js delegating to createTrustline() with per-asset success/failure collection
  • Extend createTrustline() signature to accept optional assetIssuer and limit parameters (backward-compatible; falls back to config/assets.js registry)
  • Migrate routes/assets.js off TrustlineManagerService to stellar.js functions
  • Migrate routes/stellar/trustline-balance.js off trustline.js to stellar.js
  • Add @deprecated banners + console.warn() to trustlineManager.js, trustline.js

closes #946 — pathPayment.js resilience

  • Remove private _server/getServer() singleton; use shared getHorizonServer()
  • Wrap all Horizon calls with withHorizonRetry()
  • Eliminate duplicate findPaths() call in sendPathPayment
  • Map errors through extractStellarErrorCode/getStellarErrorInfo

Tests

  • Update multiSig.test.js stellar.js mock to expose withHorizonRetry
  • Add resilience suites to multiSig.test.js (retry-then-succeed, error mapping, Prisma-only functions confirmed unaffected)
  • Add backend/tests/issues-944-946.test.js covering updateTrustlineLimit, batchCreateTrustlines, and pathPayment resilience + error mapping

…iSig, trustlines, pathPayment

Closes Ethereal-Future#944, Ethereal-Future#945, Ethereal-Future#946

## Ethereal-Future#944 — multiSig.js Horizon resilience
- Import withHorizonRetry and extractStellarErrorCode/getStellarErrorInfo from stellar.js/stellarErrors.js
- Wrap all getHorizonServer().loadAccount() and .submitTransaction() calls in
  withHorizonRetry() in createMultiSigAccount, buildMultiSigTransaction,
  submitMultiSigTransaction, getMultiSigConfig, and updateMultiSigConfig
- Map caught Horizon errors through extractStellarErrorCode/getStellarErrorInfo
  before re-throwing so callers receive user-friendly messages matching the
  pattern already used by sendPayment
- expireStaleTransactions and getPendingTransactions (Prisma-only) left as-is

## Ethereal-Future#945 — Trustline consolidation
- Add updateTrustlineLimit() to stellar.js with withHorizonRetry and
  TrustlineLimitUpdated event emission
- Add batchCreateTrustlines() to stellar.js delegating to createTrustline()
  with per-asset success/failure collection
- Extend createTrustline() signature to accept optional assetIssuer and limit
  parameters (backward-compatible; falls back to config/assets.js registry)
- Migrate routes/assets.js off TrustlineManagerService to stellar.js functions
- Migrate routes/stellar/trustline-balance.js off trustline.js to stellar.js
- Add @deprecated banners + console.warn() to trustlineManager.js, trustline.js

## Ethereal-Future#946 — pathPayment.js resilience
- Remove private _server/getServer() singleton; use shared getHorizonServer()
- Wrap all Horizon calls with withHorizonRetry()
- Eliminate duplicate findPaths() call in sendPathPayment
- Map errors through extractStellarErrorCode/getStellarErrorInfo

## Tests
- Update multiSig.test.js stellar.js mock to expose withHorizonRetry
- Add resilience suites to multiSig.test.js (retry-then-succeed, error mapping,
  Prisma-only functions confirmed unaffected)
- Add backend/tests/issues-944-946.test.js covering updateTrustlineLimit,
  batchCreateTrustlines, and pathPayment resilience + error mapping
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Good-Coded 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

@Mystery-CLI
Mystery-CLI merged commit 6f401b4 into Ethereal-Future:main Aug 3, 2026
7 of 44 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