Skip to content

flake: retry GetUSDCBalance RPC calls with exponential backoff#3602

Merged
nikw9944 merged 1 commit intomainfrom
flake/retry-usdc-balance-rpc
Apr 29, 2026
Merged

flake: retry GetUSDCBalance RPC calls with exponential backoff#3602
nikw9944 merged 1 commit intomainfrom
flake/retry-usdc-balance-rpc

Conversation

@nikw9944
Copy link
Copy Markdown
Contributor

@nikw9944 nikw9944 commented Apr 29, 2026

Summary

  • Wrap the GetTokenAccountBalance RPC call in GetUSDCBalance with exponential backoff (up to 5 retries, 30s max elapsed) to handle transient Solana RPC HTTP 429 rate-limit errors
  • Uses cenkalti/backoff/v4, matching the existing getProgramDataWithRetry pattern in the QA test helpers
  • Fixes the "Too many requests from your IP" TestQA_MulticastSettlement/record_balance_before_pay flake seen in recent testnet QA runs

Testing Verification

  • Callers inside require.Eventually loops (validate_balance_after_pay, validate_balance_after_withdraw) are unaffected — they already tolerate errors by returning false, and the added retry only adds a brief delay before surfacing the error
  • Test passed when run locally

@nikw9944 nikw9944 self-assigned this Apr 29, 2026
The Solana RPC can return HTTP 429 "Too many requests" when fetching
USDC ATA balances, causing qa_multicast_settlement_test to fail at the
record_balance_before_pay step. Wrap GetTokenAccountBalance with
exponential backoff (up to 5 retries, 30s max) using cenkalti/backoff,
matching the retry pattern already used by getProgramDataWithRetry.
@nikw9944 nikw9944 force-pushed the flake/retry-usdc-balance-rpc branch from 97ec31a to 523196f Compare April 29, 2026 17:45
@nikw9944 nikw9944 enabled auto-merge (squash) April 29, 2026 17:46
@nikw9944 nikw9944 merged commit 7ee787b into main Apr 29, 2026
36 checks passed
@nikw9944 nikw9944 deleted the flake/retry-usdc-balance-rpc branch April 29, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flake: testnet QA tests hit "Too many requests from your IP" (HTTP 429) from DZ ledger RPC

2 participants