-
Notifications
You must be signed in to change notification settings - Fork 200
feat: add RPC fallback resilience for unchained outages #12017
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
Merged
+395
−261
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
61939dc
feat: add RPC fallback resilience for unchained outages
0xApotheosis eceb0b4
Merge branch 'develop' into feat/rpc-fallback-resilience
kaladinlight 82f684d
single source of truth for fallback urls and validated endpoints
kaladinlight 35b8765
Merge branch 'develop' into feat/rpc-fallback-resilience
kaladinlight eca7571
remove old fallback urls for bsc
kaladinlight f0c25fe
Merge branch 'feat/rpc-fallback-resilience' of https://github.com/sha…
kaladinlight efaf1e6
unify rpc env vars and use viem client for second class evm chains to…
kaladinlight e7badca
flip back dev env var
kaladinlight 578367d
fix fail case for chains with only legacy fees
kaladinlight d304f36
Merge branch 'develop' into feat/rpc-fallback-resilience
kaladinlight def4dca
handle getAccountFallback error
kaladinlight b297809
Merge branch 'feat/rpc-fallback-resilience' of https://github.com/sha…
kaladinlight 8b5d01b
extra safety
kaladinlight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_BERACHAIN_NODE_URL], | ||
| 'connect-src': [env.VITE_BERACHAIN_NODE_URL, ...FALLBACK_RPC_URLS.berachain], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_BLAST_NODE_URL], | ||
| 'connect-src': [env.VITE_BLAST_NODE_URL, ...FALLBACK_RPC_URLS.blast], | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_BOB_NODE_URL], | ||
| 'connect-src': [env.VITE_BOB_NODE_URL, ...FALLBACK_RPC_URLS.bob], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_CELO_NODE_URL], | ||
| 'connect-src': [env.VITE_CELO_NODE_URL, ...FALLBACK_RPC_URLS.celo], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_CRONOS_NODE_URL], | ||
| 'connect-src': [env.VITE_CRONOS_NODE_URL, ...FALLBACK_RPC_URLS.cronos], | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_FLOWEVM_NODE_URL], | ||
| 'connect-src': [env.VITE_FLOWEVM_NODE_URL, ...FALLBACK_RPC_URLS.flowEvm], | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_HEMI_NODE_URL], | ||
| 'connect-src': [env.VITE_HEMI_NODE_URL, ...FALLBACK_RPC_URLS.hemi], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_HYPEREVM_NODE_URL], | ||
| 'connect-src': [env.VITE_HYPEREVM_NODE_URL, ...FALLBACK_RPC_URLS.hyperEvm], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_INK_NODE_URL], | ||
| 'connect-src': [env.VITE_INK_NODE_URL, ...FALLBACK_RPC_URLS.ink], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_KATANA_NODE_URL], | ||
| 'connect-src': [env.VITE_KATANA_NODE_URL, ...FALLBACK_RPC_URLS.katana], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_LINEA_NODE_URL], | ||
| 'connect-src': [env.VITE_LINEA_NODE_URL, ...FALLBACK_RPC_URLS.linea], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_MANTLE_NODE_URL], | ||
| 'connect-src': [env.VITE_MANTLE_NODE_URL, ...FALLBACK_RPC_URLS.mantle], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_MEGAETH_NODE_URL], | ||
| 'connect-src': [env.VITE_MEGAETH_NODE_URL, ...FALLBACK_RPC_URLS.megaEth], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const envMode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(envMode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_MODE_NODE_URL, 'https://modescan.io'], | ||
| 'connect-src': [env.VITE_MODE_NODE_URL, 'https://modescan.io', ...FALLBACK_RPC_URLS.mode], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_MONAD_NODE_URL], | ||
| 'connect-src': [env.VITE_MONAD_NODE_URL, ...FALLBACK_RPC_URLS.monad], | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { loadEnv } from 'vite' | ||
|
|
||
| import { FALLBACK_RPC_URLS } from '../../../packages/contracts/src/fallbackRpcUrls' | ||
| import type { Csp } from '../../types' | ||
|
|
||
| const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development' | ||
| const env = loadEnv(mode, process.cwd(), '') | ||
|
|
||
| export const csp: Csp = { | ||
| 'connect-src': [env.VITE_PLASMA_NODE_URL], | ||
| 'connect-src': [env.VITE_PLASMA_NODE_URL, ...FALLBACK_RPC_URLS.plasma], | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.