-
Notifications
You must be signed in to change notification settings - Fork 375
Rpc fallbacks #1583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-61
Are you sure you want to change the base?
Rpc fallbacks #1583
Conversation
divhead
commented
Feb 26, 2025
•
edited
Loading
edited
- To see the specific tasks where the Asana app for GitHub is being used, see below:
- https://app.asana.com/0/0/1209415042251921
✅ Deploy Preview for vigilant-albattani-df38ec ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying gmx-interface with
|
Latest commit: |
0f0ab5e
|
Status: | ✅ Deploy successful! |
Preview URL: | https://e8530015.gmx-interface.pages.dev |
Branch Preview URL: | https://rpc-fallbacks.gmx-interface.pages.dev |
src/config/chains.ts
Outdated
const filteredPrivateUrls = PRIVATE_PROVIDERS[chainId].filter((url) => !blackListedUrls.includes(url)); | ||
|
||
const [urls1, urls2] = | ||
priority === "public" ? [filteredPublicUrls, filteredPrivateUrls] : [filteredPrivateUrls, filteredPublicUrls]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think whole function could be just
priority === 'public' ? getPublic() ?? getPrivate() : getPrivate() ?? getPublic();
src/lib/rpc/bestRpcTracker.ts
Outdated
? filteredProviders | ||
: filteredProviders.filter(({ isPublic }) => isPublic); | ||
|
||
probeResults = await probeProviders(chainId, providersList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case of empty list shouldn't we whitelist back some of rpcs here?
src/lib/rpc/bestRpcTracker.ts
Outdated
}); | ||
|
||
// Recalculate best providers with failed RPC blacklisted | ||
const nextProviderUrls = await getBestRpcProvidersForChain(chainState, [rpcUrl]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
am I understanding correctly that there could be only one blacklisted rpc at time?
why don't you store blacklistedRpcs?