Skip to content
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

Namadillo: querying next rpc if the previous one fails #1479

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

pedrorezende
Copy link
Contributor

If we query an RPC endpoint and it fails for whatever reason (timeout, CORS, etc), we should query the next one in the list.

Closes #1464

Copy link
Contributor

@euharrison euharrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice!

For Cosmos, I ended up using the lavenderfive, but the balance is zero on UI
It can be an issue with the TransferModule or the api, I'll investigate it better

Screenshot 2025-01-07 at 15 48 44

Screenshot 2025-01-07 at 15 48 38

Screenshot 2025-01-07 at 15 49 40

// On error, saves the next available rpc
set(rpcByChainAtom, {
...lastRpc,
[chain.chain_id]: getRpcByIndex(chain, rpc.index + 1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in the future we could get from a random order. Loading all rpc urls into an atom and shuffling them. It could helps to don't have a bias for one or another rpc. But I see it is more work to do, so we can do it later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had that in the past, but we noticed that the first RPCs on the list were more reliable, so we switched to this solution

@pedrorezende pedrorezende merged commit 4b87ef6 into main Jan 7, 2025
10 checks passed
@pedrorezende pedrorezende deleted the namadillo/query-next-rpc-on-error branch January 7, 2025 19:55
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.

Namadillo: query next RPC if the previous one fails
2 participants