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

Create RPC service #4990

Open
Gudahtt opened this issue Nov 27, 2024 · 1 comment
Open

Create RPC service #4990

Gudahtt opened this issue Nov 27, 2024 · 1 comment
Assignees
Labels

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Nov 27, 2024

Create an RPC service that can be used by the NetworkController to make RPC requests. This service would be responsible for intelligently retrying failed requests, and for avoid undue network load using exponential backoff, jitter, and circuit breaker patterns. This would be in accordance with the External API Integrations ADR: https://github.com/MetaMask/decisions/blob/main/decisions/core/0002-external-api-integrations.md

This would live alongside the NetworkController, not within it. It would be a separate package export. Whether it's in its own package or not can be a decision for the author, that is less important.

@mcmire
Copy link
Contributor

mcmire commented Dec 6, 2024

Instead of having the service take onBreak and onDegraded callbacks, we could consider having the service emit events, and emit separate events for the primary RPC endpoint vs. the failover RPC endpoints. This way clients could react to the failover status at each appropriately, and we'd also give the network controller a way to react to the status as well (if we, say, need to capture in state which RPC endpoint among a primary and list of failovers is the active one).

We could also keep things simple and make this change in #4992, whichever makes the most sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants