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

feat: Add gasLimitNoBuffer to transactionMeta #5113

Merged
merged 7 commits into from
Jan 9, 2025

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Jan 8, 2025

Explanation

This PR aims to add gasLimitNoBuffer to transactionMeta to show minimum value while calculating network fee.

References

Changelog

@metamask/transaction-controller

  • Added: Add gasLimitNoBuffer to transactionMeta
    • gasLimitNoBuffer is the estimated gas (via eth_estimateGas) for the transaction without buffer.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@OGPoyraz
Copy link
Member Author

OGPoyraz commented Jan 8, 2025

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-bf2027a",
  "@metamask-previews/address-book-controller": "6.0.2-preview-bf2027a",
  "@metamask-previews/announcement-controller": "7.0.2-preview-bf2027a",
  "@metamask-previews/approval-controller": "7.1.1-preview-bf2027a",
  "@metamask-previews/assets-controllers": "45.1.2-preview-bf2027a",
  "@metamask-previews/base-controller": "7.1.0-preview-bf2027a",
  "@metamask-previews/build-utils": "3.0.2-preview-bf2027a",
  "@metamask-previews/chain-controller": "0.2.2-preview-bf2027a",
  "@metamask-previews/composable-controller": "10.0.0-preview-bf2027a",
  "@metamask-previews/controller-utils": "11.4.4-preview-bf2027a",
  "@metamask-previews/ens-controller": "15.0.1-preview-bf2027a",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-bf2027a",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-bf2027a",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-bf2027a",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-bf2027a",
  "@metamask-previews/keyring-controller": "19.0.2-preview-bf2027a",
  "@metamask-previews/logging-controller": "6.0.3-preview-bf2027a",
  "@metamask-previews/message-manager": "11.0.3-preview-bf2027a",
  "@metamask-previews/multichain": "2.0.0-preview-bf2027a",
  "@metamask-previews/name-controller": "8.0.2-preview-bf2027a",
  "@metamask-previews/network-controller": "22.1.1-preview-bf2027a",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-bf2027a",
  "@metamask-previews/permission-controller": "11.0.4-preview-bf2027a",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-bf2027a",
  "@metamask-previews/phishing-controller": "12.3.1-preview-bf2027a",
  "@metamask-previews/polling-controller": "12.0.2-preview-bf2027a",
  "@metamask-previews/preferences-controller": "15.0.1-preview-bf2027a",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-bf2027a",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-bf2027a",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-bf2027a",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-bf2027a",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-bf2027a",
  "@metamask-previews/signature-controller": "23.2.0-preview-bf2027a",
  "@metamask-previews/transaction-controller": "42.1.0-preview-bf2027a",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-bf2027a"
}

@OGPoyraz OGPoyraz changed the title feat: Add estimatedGas to transactionMeta feat: Add gasLimitNoBuffer to transactionMeta Jan 8, 2025
@OGPoyraz OGPoyraz marked this pull request as ready for review January 8, 2025 11:42
@OGPoyraz OGPoyraz requested review from a team as code owners January 8, 2025 11:42
@OGPoyraz
Copy link
Member Author

OGPoyraz commented Jan 8, 2025

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-981e1d0",
  "@metamask-previews/address-book-controller": "6.0.2-preview-981e1d0",
  "@metamask-previews/announcement-controller": "7.0.2-preview-981e1d0",
  "@metamask-previews/approval-controller": "7.1.1-preview-981e1d0",
  "@metamask-previews/assets-controllers": "45.1.2-preview-981e1d0",
  "@metamask-previews/base-controller": "7.1.0-preview-981e1d0",
  "@metamask-previews/build-utils": "3.0.2-preview-981e1d0",
  "@metamask-previews/chain-controller": "0.2.2-preview-981e1d0",
  "@metamask-previews/composable-controller": "10.0.0-preview-981e1d0",
  "@metamask-previews/controller-utils": "11.4.4-preview-981e1d0",
  "@metamask-previews/ens-controller": "15.0.1-preview-981e1d0",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-981e1d0",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-981e1d0",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-981e1d0",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-981e1d0",
  "@metamask-previews/keyring-controller": "19.0.2-preview-981e1d0",
  "@metamask-previews/logging-controller": "6.0.3-preview-981e1d0",
  "@metamask-previews/message-manager": "11.0.3-preview-981e1d0",
  "@metamask-previews/multichain": "2.0.0-preview-981e1d0",
  "@metamask-previews/name-controller": "8.0.2-preview-981e1d0",
  "@metamask-previews/network-controller": "22.1.1-preview-981e1d0",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-981e1d0",
  "@metamask-previews/permission-controller": "11.0.4-preview-981e1d0",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-981e1d0",
  "@metamask-previews/phishing-controller": "12.3.1-preview-981e1d0",
  "@metamask-previews/polling-controller": "12.0.2-preview-981e1d0",
  "@metamask-previews/preferences-controller": "15.0.1-preview-981e1d0",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-981e1d0",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-981e1d0",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-981e1d0",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-981e1d0",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-981e1d0",
  "@metamask-previews/signature-controller": "23.2.0-preview-981e1d0",
  "@metamask-previews/transaction-controller": "42.1.0-preview-981e1d0",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-981e1d0"
}

@OGPoyraz
Copy link
Member Author

OGPoyraz commented Jan 9, 2025

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Jan 9, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-0f92cfaa",
  "@metamask-previews/address-book-controller": "6.0.2-preview-0f92cfaa",
  "@metamask-previews/announcement-controller": "7.0.2-preview-0f92cfaa",
  "@metamask-previews/approval-controller": "7.1.1-preview-0f92cfaa",
  "@metamask-previews/assets-controllers": "45.1.2-preview-0f92cfaa",
  "@metamask-previews/base-controller": "7.1.0-preview-0f92cfaa",
  "@metamask-previews/build-utils": "3.0.2-preview-0f92cfaa",
  "@metamask-previews/chain-controller": "0.2.2-preview-0f92cfaa",
  "@metamask-previews/composable-controller": "10.0.0-preview-0f92cfaa",
  "@metamask-previews/controller-utils": "11.4.4-preview-0f92cfaa",
  "@metamask-previews/ens-controller": "15.0.1-preview-0f92cfaa",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-0f92cfaa",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-0f92cfaa",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-0f92cfaa",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-0f92cfaa",
  "@metamask-previews/keyring-controller": "19.0.2-preview-0f92cfaa",
  "@metamask-previews/logging-controller": "6.0.3-preview-0f92cfaa",
  "@metamask-previews/message-manager": "11.0.3-preview-0f92cfaa",
  "@metamask-previews/multichain": "2.0.0-preview-0f92cfaa",
  "@metamask-previews/name-controller": "8.0.2-preview-0f92cfaa",
  "@metamask-previews/network-controller": "22.1.1-preview-0f92cfaa",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-0f92cfaa",
  "@metamask-previews/permission-controller": "11.0.4-preview-0f92cfaa",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-0f92cfaa",
  "@metamask-previews/phishing-controller": "12.3.1-preview-0f92cfaa",
  "@metamask-previews/polling-controller": "12.0.2-preview-0f92cfaa",
  "@metamask-previews/preferences-controller": "15.0.1-preview-0f92cfaa",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-0f92cfaa",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-0f92cfaa",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-0f92cfaa",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-0f92cfaa",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-0f92cfaa",
  "@metamask-previews/signature-controller": "23.2.0-preview-0f92cfaa",
  "@metamask-previews/transaction-controller": "42.1.0-preview-0f92cfaa",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-0f92cfaa"
}

@OGPoyraz OGPoyraz force-pushed the feat/add-estimated-gas-txmeta branch from 0f92cfa to cb92f63 Compare January 9, 2025 10:12
@OGPoyraz OGPoyraz enabled auto-merge (squash) January 9, 2025 12:19
@OGPoyraz OGPoyraz merged commit 3b94a7c into main Jan 9, 2025
120 checks passed
@OGPoyraz OGPoyraz deleted the feat/add-estimated-gas-txmeta branch January 9, 2025 17:05
PatrykLucka pushed a commit that referenced this pull request Jan 13, 2025
## Explanation

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

This PR aims to add `gasLimitNoBuffer` to `transactionMeta` to show
minimum value while calculating network fee.

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

* Fixes MetaMask/MetaMask-planning#3773

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/transaction-controller`

- **Added**: Add `gasLimitNoBuffer` to `transactionMeta`
- `gasLimitNoBuffer` is the estimated gas (via `eth_estimateGas`) for
the transaction without buffer.

## 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 highlighted breaking changes using the "BREAKING" category
above as appropriate
- [X] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants