Retry transient RPC errors on equity price reads#71
Open
TaprootFreak wants to merge 1 commit into
Open
Conversation
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.
Problem
TokenService.syncPricesintermittently logs error-level entries when the RPC endpoint has a transient hiccup (observed as recurring bursts on our DEV deployment, ~36/h during an unstable-RPC window):Root cause
PriceService.getSpecialTokenPricesreads the equity price directly on the raw provider:This is the only on-chain call in the pricing path that bypasses
ProviderService's existing transient-error retry policy (withRetry+isTransientRpcError), whichgetBlock,getBlockNumber, andcallBatchalready use. A single transient 503 / network blip on this one call fails the wholegetTokenPricesInEurcycle.Fix
ProviderService.call<T>(thunk)that delegates to the existing privatewithRetry(same policy: 5 attempts, exponential backoff, transient-only — deterministic errors likeexecution revertedare not retried).price()read through it.Retry-then-fail-loud: persistent failures still propagate unchanged to the caller, so this does not mask real outages — fully in line with the fail-loud direction of #70 (which this PR does not overlap; #70 touches the GeckoTerminal/FX paths, this touches
getSpecialTokenPricesonly).Verification
npm run buildclean, eslint clean on touched files, prettier clean onprice.service.ts(the pre-existingcallBatchformatting drift inprovider.service.tsis untouched/out of scope).