feat: use feature flags for gas estimation buffers #5637
Merged
matthewwalsh0 merged 4 commits intomainfrom Apr 15, 2025
Merged
Conversation
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
0fa0602 to
1634185
Compare
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
jpuri
approved these changes
Apr 15, 2025
pedronfigueiredo
approved these changes
Apr 15, 2025
OGPoyraz
approved these changes
Apr 15, 2025
matthewwalsh0
added a commit
that referenced
this pull request
Apr 16, 2025
Use feature flags to configure the gas estimation buffers, including
support for specific chain and type-4 buffers.
```js
[FeatureFlag.GasBuffer]?: {
/** Fallback buffer for all chains and transactions. */
default?: number;
/**
* Buffer for included network RPCs only and not those added by user.
* Takes priority over `default`.
*/
included?: number;
/** Buffers for specific chains. */
perChainConfig?: {
[chainId: Hex]: {
/**
* Buffer for the chain for all transactions.
* Takes priority over non-chain `included`.
*/
base?: number;
/**
* Buffer if network RPC is included and not added by user.
* Takes priority over `base`.
*/
included?: number;
/**
* Buffer for the chain for EIP-7702 / type 4 transactions only.
* Only if `data` included and `to` matches `from`.
* Takes priority over `included` and `base`.
*/
eip7702?: number;
};
};
};
```
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Merged
7 tasks
dbrans
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Apr 16, 2025
## **Description** Cherry-pick of #31913 for `12.16.1`. Creating manual PR as patch required for `@metamask/transaction-controller`. Patch changes are cherry-picks of [#5600](MetaMask/core#5600), [#5635](MetaMask/core#5635), and [#5637](MetaMask/core#5637), built from [patch/transaction-controller-extension-12-16-1](MetaMask/core@patch/transaction-controller-extension-12-16-0...patch/transaction-controller-extension-12-16-1). [](https://codespaces.new/MetaMask/metamask-extension/pull/32023?quickstart=1) ## **Related issues** ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
matthewwalsh0
added a commit
to MetaMask/metamask-extension
that referenced
this pull request
Apr 21, 2025
Cherry-pick of #31913 for `12.16.1`. Creating manual PR as patch required for `@metamask/transaction-controller`. Patch changes are cherry-picks of [#5600](MetaMask/core#5600), [#5635](MetaMask/core#5635), and [#5637](MetaMask/core#5637), built from [patch/transaction-controller-extension-12-16-1](MetaMask/core@patch/transaction-controller-extension-12-16-0...patch/transaction-controller-extension-12-16-1). [](https://codespaces.new/MetaMask/metamask-extension/pull/32023?quickstart=1) - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
matthewwalsh0
added a commit
that referenced
this pull request
Apr 21, 2025
Use feature flags to configure the gas estimation buffers, including
support for specific chain and type-4 buffers.
```js
[FeatureFlag.GasBuffer]?: {
/** Fallback buffer for all chains and transactions. */
default?: number;
/**
* Buffer for included network RPCs only and not those added by user.
* Takes priority over `default`.
*/
included?: number;
/** Buffers for specific chains. */
perChainConfig?: {
[chainId: Hex]: {
/**
* Buffer for the chain for all transactions.
* Takes priority over non-chain `included`.
*/
base?: number;
/**
* Buffer if network RPC is included and not added by user.
* Takes priority over `base`.
*/
included?: number;
/**
* Buffer for the chain for EIP-7702 / type 4 transactions only.
* Only if `data` included and `to` matches `from`.
* Takes priority over `included` and `base`.
*/
eip7702?: number;
};
};
};
```
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Merged
7 tasks
MajorLift
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Apr 21, 2025
## **Description** Cherry-pick of #31913 for `12.17.0`. Creating manual PR as patch required for `@metamask/transaction-controller`. Patch changes are cherry-picks of [#5635](MetaMask/core#5635) and [#5637](MetaMask/core#5637), built from [patch/transaction-controller-extension-12-17-0](MetaMask/core@@metamask/transaction-controller@54.0.0...patch/transaction-controller-extension-12-17-0). [](https://codespaces.new/MetaMask/metamask-extension/pull/32144?quickstart=1) ## **Related issues** ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
salimtb
pushed a commit
that referenced
this pull request
Apr 23, 2025
## Explanation
Use feature flags to configure the gas estimation buffers, including
support for specific chain and type-4 buffers.
```js
[FeatureFlag.GasBuffer]?: {
/** Fallback buffer for all chains and transactions. */
default?: number;
/**
* Buffer for included network RPCs only and not those added by user.
* Takes priority over `default`.
*/
included?: number;
/** Buffers for specific chains. */
perChainConfig?: {
[chainId: Hex]: {
/**
* Buffer for the chain for all transactions.
* Takes priority over non-chain `included`.
*/
base?: number;
/**
* Buffer if network RPC is included and not added by user.
* Takes priority over `base`.
*/
included?: number;
/**
* Buffer for the chain for EIP-7702 / type 4 transactions only.
* Only if `data` included and `to` matches `from`.
* Takes priority over `included` and `base`.
*/
eip7702?: number;
};
};
};
```
## References
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
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
Use feature flags to configure the gas estimation buffers, including support for specific chain and type-4 buffers.
References
Checklist