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

Add failover support to RpcService #5202

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Jan 27, 2025

Explanation

Add a new failoverService option to RpcService. This allows consumers to forward the request to another RPC service in the event that an RPC endpoint is proven to be unreliable (i.e. after attempting the request 5 times, the endpoint is unreachable, returns a a non-200 response, or returns a response that is not JSON-decodable).

References

Closes #4992.

Changelog

(N/A; RpcService is not public yet so no changelog updates)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@mcmire mcmire force-pushed the add-failover-support-to-nc-rpc-service branch 3 times, most recently from 8a973c8 to 3abe368 Compare January 27, 2025 22:20
@mcmire
Copy link
Contributor Author

mcmire commented Jan 27, 2025

@metamaskbot publish-previews

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "21.0.2-preview-3abe3688",
  "@metamask-previews/address-book-controller": "6.0.2-preview-3abe3688",
  "@metamask-previews/announcement-controller": "7.0.2-preview-3abe3688",
  "@metamask-previews/approval-controller": "7.1.2-preview-3abe3688",
  "@metamask-previews/assets-controllers": "46.0.1-preview-3abe3688",
  "@metamask-previews/base-controller": "7.1.1-preview-3abe3688",
  "@metamask-previews/build-utils": "3.0.2-preview-3abe3688",
  "@metamask-previews/composable-controller": "10.0.0-preview-3abe3688",
  "@metamask-previews/controller-utils": "11.4.5-preview-3abe3688",
  "@metamask-previews/ens-controller": "15.0.1-preview-3abe3688",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-3abe3688",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-3abe3688",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-3abe3688",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-3abe3688",
  "@metamask-previews/keyring-controller": "19.0.4-preview-3abe3688",
  "@metamask-previews/logging-controller": "6.0.3-preview-3abe3688",
  "@metamask-previews/message-manager": "12.0.0-preview-3abe3688",
  "@metamask-previews/multichain": "2.1.0-preview-3abe3688",
  "@metamask-previews/multichain-transactions-controller": "0.0.1-preview-3abe3688",
  "@metamask-previews/name-controller": "8.0.2-preview-3abe3688",
  "@metamask-previews/network-controller": "22.1.1-preview-3abe3688",
  "@metamask-previews/notification-services-controller": "0.17.0-preview-3abe3688",
  "@metamask-previews/permission-controller": "11.0.5-preview-3abe3688",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-3abe3688",
  "@metamask-previews/phishing-controller": "12.3.1-preview-3abe3688",
  "@metamask-previews/polling-controller": "12.0.2-preview-3abe3688",
  "@metamask-previews/preferences-controller": "15.0.1-preview-3abe3688",
  "@metamask-previews/profile-sync-controller": "4.1.1-preview-3abe3688",
  "@metamask-previews/queued-request-controller": "9.0.0-preview-3abe3688",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-3abe3688",
  "@metamask-previews/remote-feature-flag-controller": "1.3.0-preview-3abe3688",
  "@metamask-previews/selected-network-controller": "21.0.0-preview-3abe3688",
  "@metamask-previews/signature-controller": "23.2.0-preview-3abe3688",
  "@metamask-previews/token-search-discovery-controller": "1.0.0-preview-3abe3688",
  "@metamask-previews/transaction-controller": "43.0.0-preview-3abe3688",
  "@metamask-previews/user-operation-controller": "22.0.0-preview-3abe3688"
}

Base automatically changed from create-nc-rpc-service to main January 29, 2025 16:39
@mcmire mcmire force-pushed the add-failover-support-to-nc-rpc-service branch from 3abe368 to 357210d Compare January 29, 2025 20:39
@mcmire mcmire marked this pull request as ready for review January 30, 2025 15:45
@mcmire mcmire requested review from a team as code owners January 30, 2025 15:46
@mcmire mcmire force-pushed the add-failover-support-to-nc-rpc-service branch from b24e8e7 to 2448daf Compare January 30, 2025 15:47
Add a new `failoverService` option to RpcService. This allows consumers
to forward the request to another RPC service in the event that an RPC
endpoint is proven to be unreliable (i.e. after attempting the request 5
times, the endpoint is unreachable, returns a a non-200 response, or
returns a response that is not JSON-decodable).
@mcmire mcmire force-pushed the add-failover-support-to-nc-rpc-service branch from 2448daf to 44f59ab Compare January 30, 2025 15:48
Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

LGTM!

@mcmire mcmire merged commit d0dcc50 into main Jan 30, 2025
124 checks passed
@mcmire mcmire deleted the add-failover-support-to-nc-rpc-service branch January 30, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RPC service] Add failover support
2 participants