-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: add monad failover rpc #38428
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: main
Are you sure you want to change the base?
feat: add monad failover rpc #38428
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [8fa30b6]
UI Startup Metrics (1227 ± 101 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [af62975]
UI Startup Metrics (1342 ± 145 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [10e38cf]
UI Startup Metrics (1297 ± 117 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [de1029a]
UI Startup Metrics (1311 ± 115 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [784c258]
UI Startup Metrics (1276 ± 105 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [3d36559]
UI Startup Metrics (1288 ± 120 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [050aba1]
UI Startup Metrics (1251 ± 122 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [9c61c20]
UI Startup Metrics (1283 ± 106 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
| const expectedUrl = `https://${match[1]}.infura.io/v3/${escapeRegExp( | ||
| process.env.INFURA_PROJECT_ID, | ||
| )}`; | ||
| return rpcEndpoint.url.startsWith(expectedUrl); |
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.
Incorrect use of escapeRegExp in string comparison
Low Severity
The escapeRegExp function is incorrectly applied to INFURA_PROJECT_ID when building a string for startsWith comparison. Unlike migration 157 where escapeRegExp is correctly used inside new RegExp(), here the escaped string is used in a plain string comparison. If the project ID contains regex special characters (like .), escapeRegExp would convert . to \., causing the startsWith comparison to fail since the actual URL contains . not \.. The escapeRegExp call should be removed since this is a string comparison, not a regex operation.
8d9a914 to
e1d1c7c
Compare
| const expectedUrl = `https://${match[1]}.infura.io/v3/${escapeRegExp( | ||
| process.env.INFURA_PROJECT_ID, | ||
| )}`; | ||
| return rpcEndpoint.url.startsWith(expectedUrl); |
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.
Incorrect escapeRegExp usage in string comparison
Low Severity
The escapeRegExp function is used incorrectly when building a string for startsWith() comparison. escapeRegExp is meant to escape special regex characters for use in RegExp patterns, but here it's used in a plain string context. If INFURA_PROJECT_ID contains any regex special characters (like .), escapeRegExp would add backslashes that become literal characters in the string, causing startsWith() to fail even for valid Infura URLs. For example, if the ID were "test.123", the escaped version "test\\.123" won't match the actual URL containing "test.123". The escapeRegExp call should be removed since this is a string comparison, not regex matching. This contrasts with migration 157 which correctly uses escapeRegExp inside new RegExp().
Builds ready [e1d1c7c]
UI Startup Metrics (1344 ± 101 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
| const expectedUrl = `https://${match[1]}.infura.io/v3/${escapeRegExp( | ||
| process.env.INFURA_PROJECT_ID, | ||
| )}`; | ||
| return rpcEndpoint.url.startsWith(expectedUrl); |
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.
escapeRegExp misused in string comparison causes incorrect matching
Medium Severity
The escapeRegExp function is designed for regex patterns but is incorrectly used here with startsWith() string comparison. If INFURA_PROJECT_ID contains any regex special characters (like .), escapeRegExp will add escape characters (e.g., \.) that would cause startsWith to return false when it should return true. Migration 157 correctly uses escapeRegExp inside new RegExp(), but this code appears adapted without removing the escaping for the string comparison approach. The escapeRegExp call should be removed since startsWith is a plain string operation.
Builds ready [53b4711]
UI Startup Metrics (1257 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
| const expectedUrl = `https://${match[1]}.infura.io/v3/${escapeRegExp( | ||
| process.env.INFURA_PROJECT_ID, | ||
| )}`; | ||
| return rpcEndpoint.url.startsWith(expectedUrl); |
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.
Incorrect use of escapeRegExp with string comparison
Medium Severity
The escapeRegExp function is used on INFURA_PROJECT_ID, but the result is then compared using startsWith() which is a literal string comparison, not a regex match. If the project ID contains regex special characters like ., *, or +, escapeRegExp will add backslash escapes (e.g., test.id becomes test\.id), causing the startsWith() comparison to fail against the actual URL which contains the unescaped characters. Migration 157 handles this correctly by using escapeRegExp inside a new RegExp() constructor. The fix is to remove the escapeRegExp call since we're doing string comparison.
Builds ready [ee2d32e]
UI Startup Metrics (1305 ± 114 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Description
Adds QuickNode fallback RPC for Monad
Changelog
CHANGELOG entry: added QuickNode fallback RPC for Monad.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
BEFORE MIGRATION

After
AFTER MIGRATION

Pre-merge author checklist
Pre-merge reviewer checklist
Note
Introduces failover support for Monad RPC endpoints backed by Infura.
186to appendQUICKNODE_MONAD_URLasfailoverUrlsfor Monad Infura (or Infura-pattern) endpoints without existing failoversQUICKNODE_MONAD_URLthroughbundle.sh,run-build.yml,publish-release.yml, andbuilds.ymlshared/constants/network.tsto include QuickNode failover formonad-mainnetand in featured RPCsapp/scripts/migrations/index.js, adds comprehensive unit tests, and bumps state snapshot version to186Written by Cursor Bugbot for commit ee2d32e. This will update automatically on new commits. Configure here.