Skip to content

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

Open
wants to merge 6 commits into
base: release-61
Choose a base branch
from
Open

Rpc fallbacks #1583

wants to merge 6 commits into from

Conversation

divhead
Copy link
Collaborator

@divhead divhead commented Feb 26, 2025


Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for vigilant-albattani-df38ec ready!

Name Link
🔨 Latest commit 0f0ab5e
🔍 Latest deploy log https://app.netlify.com/sites/vigilant-albattani-df38ec/deploys/67c078a62ba0c4000848b25b
😎 Deploy Preview https://deploy-preview-1583--vigilant-albattani-df38ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

cloudflare-workers-and-pages bot commented Feb 26, 2025

Deploying gmx-interface with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0f0ab5e
Status: ✅  Deploy successful!
Preview URL: https://e8530015.gmx-interface.pages.dev
Branch Preview URL: https://rpc-fallbacks.gmx-interface.pages.dev

View logs

const filteredPrivateUrls = PRIVATE_PROVIDERS[chainId].filter((url) => !blackListedUrls.includes(url));

const [urls1, urls2] =
priority === "public" ? [filteredPublicUrls, filteredPrivateUrls] : [filteredPrivateUrls, filteredPublicUrls];
Copy link
Collaborator

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();

? filteredProviders
: filteredProviders.filter(({ isPublic }) => isPublic);

probeResults = await probeProviders(chainId, providersList);
Copy link
Collaborator

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?

});

// Recalculate best providers with failed RPC blacklisted
const nextProviderUrls = await getBestRpcProvidersForChain(chainState, [rpcUrl]);
Copy link
Collaborator

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?

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