feat: Add defaults for policy and block tracker options#9002
Merged
FrederikBolding merged 7 commits intoJun 4, 2026
Conversation
policyOptions
a292e7d to
86fa366
Compare
policyOptions
FrederikBolding
commented
Jun 4, 2026
|
|
||
| ### Added | ||
|
|
||
| - Add defaults for policy and block tracker options ([#9002](https://github.com/MetaMask/core/pull/9002)) |
Member
Author
There was a problem hiding this comment.
Do we consider this breaking?
Each client already uses these values FWIW.
Member
There was a problem hiding this comment.
I don't think so. It doesn't require any changes in consumers.
Mrtenz
previously approved these changes
Jun 4, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e8d81a4. Configure here.
Mrtenz
previously approved these changes
Jun 4, 2026
Mrtenz
approved these changes
Jun 4, 2026
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 free
to 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
Port defaults for
maxRetries,maxConsecutiveFailuresandcircuitBreakDurationfrom the clients into core. This also enables us to makegetRpcServiceOptionsoptional. Also brings in defaults forpollingIntervalandretryTimeout.References
https://consensyssoftware.atlassian.net/browse/WPC-1054
Checklist
Note
Medium Risk
Changes default RPC retry/circuit-break and block polling behavior for all network clients; consumers who omitted
getRpcServiceOptionsor depended on prior client-only defaults may see different failover and unavailable timing.Overview
Network clients now ship built-in RPC and block-tracker tuning so callers no longer have to supply
getRpcServiceOptionsfor standard retry/circuit behavior.getRpcServiceOptionsis optional onNetworkControllerand network client creation paths. When omitted,create-network-clientmerges@metamask/controller-utilsdefaults into each RPC endpoint:maxRetries3,circuitBreakDuration30s, andmaxConsecutiveFailures12 on the primary URL vs 40 on failover URLs (higher threshold so QuickNode-style activation does not trip the circuit too early). Custom overrides fromgetRpcServiceOptionsstill win via spread after those defaults.Block tracker defaults are set in the same layer: 20s
pollingIntervaland retryTimeout (still 1s for custom networks underIN_TEST). Tests were updated for the new retry counts and circuit timing (e.g. 12 vs 40 mocked failures, 30s timer advance).Reviewed by Cursor Bugbot for commit 6ae0d77. Bugbot is set up for automated code reviews on this repo. Configure here.