Uh oh!
There was an error while loading. Please reload this page.
Fix block tracker not resolving for failed requests - #5860
Merged
Conversation
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
mcmireforce-pushed
the
upgrade-eth-block-tracker-to-v12
branch
from
May 27, 2025 14:53
cda8835 to
4a9e3c1Comparemcmireforce-pushed
the
upgrade-eth-block-tracker-to-v12
branch
from
May 27, 2025 14:58
4a9e3c1 to
8058614CompareUpgrade `@metamask/eth-block-tracker` to ^12.0.0 and `@metamask/eth-json-rpc-middleware` to ^17.0.1. This fixes a bug where calls to `getLatestBlock` within middleware would hang if an error was thrown while making the request to the network.
mcmireforce-pushed
the
upgrade-eth-block-tracker-to-v12
branch
from
May 27, 2025 18:52
8058614 to
88a682bComparemcmire
commented
May 27, 2025
CollaboratorAuthor
Marking |
mcmire
marked this pull request as ready for review
May 27, 2025 19:15
mcmire
commented
May 27, 2025
CollaboratorAuthor
@metamaskbot publish-previews |
Contributor
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
mcmire
commented
May 28, 2025
CollaboratorAuthor
We are waiting on another fix for the block tracker before merging this. |
mcmire
marked this pull request as draft
May 28, 2025 17:37
mcmire
marked this pull request as ready for review
May 29, 2025 14:43
Merged
mcmire added a commit
that referenced
this pull request
May 29, 2025
This release primarily includes the following two fixes to `network-controller`: - Rather than throwing an error, NetworkController now corrects an invalid initial `selectedNetworkClientId` to point to the default RPC endpoint of the first network sorted by chain ID, then logs the error via Sentry ([#5851](#5851)) - Fix the block tracker so that it will now reject if an error is thrown while making the request instead of hanging ([#5860](#5860)) --- Full list of packages and versions in this release: - `@metamask/error-reporting-service` (1.0.0) - `@metamask/network-controller` (23.5.0 -> 23.5.1)
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
Currently, if a consumer makes a request to an RPC endpoint via a network provider object, and that request continually fails in some way and then throws a circuit breaker error, it will never resolve. Naturally, this causes problems if the consuming code (e.g. TransactionController, or UI code) is expecting a response from the network in order to proceed.
This problem occurs because internally the NetworkController wraps requests in special middleware that use the block tracker to get the latest block number. This middleware gets executed before the desired request reaches the network, and in this case because the block tracker does not return a resolved promise, the middleware does not resolve along with the entire request.
This bug has been resolved in
@metamask/eth-block-tracker12.0.1 and@metamask/eth-json-rpc-middleware17.0.1. So, to fix this problem, this PR upgrades these packages.For more see:
@metamask/eth-block-trackerchangelog: https://github.com/MetaMask/eth-block-tracker/blob/main/CHANGELOG.md#1200@metamask/eth-json-rpc-middlewarechangelog: https://github.com/MetaMask/eth-json-rpc-middleware/blob/main/CHANGELOG.md#1701. (There is one breaking change made in 17.0.0, but that doesn't affect our usage of this package.)References
Checklist