Skip to content

fix: wrap native coin balance call in try-catch#3280

Merged
TaprootFreak merged 1 commit intodevelopfrom
fix/payment-balance-error-handling
Feb 26, 2026
Merged

fix: wrap native coin balance call in try-catch#3280
TaprootFreak merged 1 commit intodevelopfrom
fix/payment-balance-error-handling

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • getNativeCoinBalanceForAddress() in PaymentBalanceService.getPaymentBalances() was not wrapped in a try-catch, unlike getTokenBalances() directly below it
  • When a blockchain node becomes unresponsive (currently: Firo RPC at 10.0.1.5:8888 timing out after ~137s), the unhandled error propagates through Promise.all and crashes saveTradingLog()
  • This has caused all FinancialDataLog and FinancialChangesLog entries to stop since 14:33 UTC today
  • Fix: move both getNativeCoinBalanceForAddress and getTokenBalances into one shared try-catch that respects the existing catchException flag

Root cause

The Firo RPC node is unresponsive, causing Util.timeout() to throw Error: Timeout after ~137-180 seconds. This error was not caught for native coin balance queries.

Test plan

  • Verify build passes (confirmed locally)
  • Verify FinancialDataLog entries resume after deploy
  • Separately: investigate and restart Firo node at 10.0.1.5:8888

getNativeCoinBalanceForAddress was not protected by error handling,
unlike getTokenBalances. When a blockchain node becomes unresponsive
(e.g. Firo RPC timeout), the unhandled error propagates through
Promise.all and crashes the entire saveTradingLog cron job, stopping
all FinancialDataLog and FinancialChangesLog entries.
@TaprootFreak TaprootFreak marked this pull request as ready for review February 26, 2026 21:33
@TaprootFreak TaprootFreak merged commit 1af21e2 into develop Feb 26, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the fix/payment-balance-error-handling branch February 26, 2026 21:34
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.

2 participants