@metamask-previews/network-controller
Advanced tools
Comparing version 22.2.1-preview-ac664446 to 22.2.1-preview-af470a9
@@ -10,2 +10,37 @@ # Changelog | ||
### Added | ||
- Implement circuit breaker pattern when retrying requests to Infura and custom RPC endpoints ([#5290](https://github.com/MetaMask/core/pull/5290)) | ||
- If the network is perceived to be down after 5 attempts, further retries will be paused for 30 seconds | ||
- "Down" means the following: | ||
- A failure to reach the network (exact error depending on platform / HTTP client) | ||
- The request responds with a non-JSON-parseable or non-JSON-RPC-compatible body | ||
- The request returns a non-200 response | ||
- Use exponential backoff / jitter when retrying requests to Infura and custom RPC endpoints ([#5290](https://github.com/MetaMask/core/pull/5290)) | ||
- As requests are retried, the delay between retries will increase exponentially (using random variance to prevent bursts) | ||
- Add support for automatic failover when Infura is down ([#5630](https://github.com/MetaMask/core/pull/5630)) | ||
- An Infura RPC endpoint can now be configured with a list of failover URLs via `failoverUrls`. | ||
- If, after many attempts, an Infura network is perceived to be down, the list of failover URLs will be tried in turn. | ||
### Changed | ||
- **BREAKING:** `NetworkController` constructor now takes two required options, `fetch` and `btoa` ([#5290](https://github.com/MetaMask/core/pull/5290)) | ||
- These are passed along to functions that create the JSON-RPC middleware. | ||
- **BREAKING:** Add required property `failoverUrls` to `RpcEndpoint` ([#5630](https://github.com/MetaMask/core/pull/5630)) | ||
- **BREAKING:** Add required property `failoverRpcUrls` to `NetworkClientConfiguration` ([#5630](https://github.com/MetaMask/core/pull/5630)) | ||
- Synchronize retry logic and error handling behavior between Infura and custom RPC endpoints ([#5290](https://github.com/MetaMask/core/pull/5290)) | ||
- A request to a custom endpoint that returns a 418 response will no longer return a JSON-RPC response with the error "Request is being rate limited" | ||
- A request to a custom endpoint that returns a 429 response now returns a JSON-RPC response with the error "Request is being rate limited" | ||
- A request to a custom endpoint that throws an "ECONNRESET" error will now be retried up to 5 times | ||
- A request to a Infura endpoint that fails more than 5 times in a row will now respond with a JSON-RPC error that encompasses the failure instead of hiding it as "InfuraProvider - cannot complete request. All retries exhausted" | ||
- A request to a Infura endpoint that returns a non-retriable, non-2xx response will now respond with a JSON-RPC error that has the underling message "Non-200 status code: '\<code\>'" rather than including the raw response from the endpoint | ||
- A request to a custom endpoint that fails with a retriable error more than 5 times in a row will now respond with a JSON-RPC error that encompasses the failure instead of returning an empty response | ||
- A "retriable error" is now regarded as the following: | ||
- A failure to reach the network (exact error depending on platform / HTTP client) | ||
- The request responds with a non-JSON-parseable or non-JSON-RPC-compatible body | ||
- The request returns a 503 or 504 response | ||
- Bump dependencies to support usage of RPC services internally for network requests ([#5290](https://github.com/MetaMask/core/pull/5290)) | ||
- Bump `@metamask/eth-json-rpc-infura` to `^10.1.0` | ||
- Bump `@metamask/eth-json-rpc-middleware` to `^15.1.0` | ||
## [22.2.1] | ||
@@ -15,3 +50,3 @@ | ||
- Bump `@metamask/base-controller` from `^7.1.1` to `^8.0.0` [#5305](https://github.com/MetaMask/core/pull/5305)) | ||
- Bump `@metamask/base-controller` from `^7.1.1` to `^8.0.0` ([#5305](https://github.com/MetaMask/core/pull/5305)) | ||
@@ -18,0 +53,0 @@ ## [22.2.0] |
{ | ||
"name": "@metamask-previews/network-controller", | ||
"version": "22.2.1-preview-ac664446", | ||
"version": "22.2.1-preview-af470a9", | ||
"description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object", | ||
@@ -53,4 +53,4 @@ "keywords": [ | ||
"@metamask/eth-block-tracker": "^11.0.3", | ||
"@metamask/eth-json-rpc-infura": "^10.0.0", | ||
"@metamask/eth-json-rpc-middleware": "^15.0.1", | ||
"@metamask/eth-json-rpc-infura": "^10.1.0", | ||
"@metamask/eth-json-rpc-middleware": "^15.1.0", | ||
"@metamask/eth-json-rpc-provider": "^4.1.8", | ||
@@ -61,3 +61,3 @@ "@metamask/eth-query": "^4.0.0", | ||
"@metamask/swappable-obj-proxy": "^2.3.0", | ||
"@metamask/utils": "^11.1.0", | ||
"@metamask/utils": "^11.2.0", | ||
"async-mutex": "^0.5.0", | ||
@@ -64,0 +64,0 @@ "fast-deep-equal": "^3.1.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
842505
4563