flake: retry GetUSDCBalance RPC calls with exponential backoff#3602
Merged
flake: retry GetUSDCBalance RPC calls with exponential backoff#3602
Conversation
4d6c950 to
97ec31a
Compare
packethog
approved these changes
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.
97ec31a to
523196f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetTokenAccountBalanceRPC call inGetUSDCBalancewith exponential backoff (up to 5 retries, 30s max elapsed) to handle transient Solana RPC HTTP 429 rate-limit errorscenkalti/backoff/v4, matching the existinggetProgramDataWithRetrypattern in the QA test helpersTestQA_MulticastSettlement/record_balance_before_payflake seen in recent testnet QA runsTesting Verification
require.Eventuallyloops (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