MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.9k stars 4.86k forks source link

[Bug]: Gas Limit value suggested from a Dapp is not respected, defaulting always to `21000` #18417

Open seaona opened 1 year ago

seaona commented 1 year ago

Describe the bug

Problem: when I start a transaction from a Dapp, if I've set a gasLimit value, I can see how it is not respected and it always defaults to 21000.

This happens both to Legacy and EIP1159 transactions.

https://user-images.githubusercontent.com/54408225/229527219-f76a9035-32b1-4be2-b934-ad7293903056.mp4

Steps to reproduce

  1. Clone test dapp
  2. Change line 865 and 882 gasLimit to another value (i.e. 0x5277 which is 21111)
  3. Start test dapp yarn start
  4. Connect MM
  5. Click Send Legacy // Send EIP1159
  6. Click Edit Fees
  7. Click Edit --- see how gasLimit is the same as always 21000

Error messages or log output

No response

Version

10.27.0

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

bschorchit commented 1 year ago

Possibly related with https://github.com/MetaMask/metamask-extension/issues/16593

And possibly caused by this: https://github.com/MetaMask/metamask-extension/pull/6625

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

github-actions[bot] commented 11 months ago

This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.

seaona commented 6 months ago

this issue is still present

bschorchit commented 1 week ago

@seaona do you know if this (overriding the dapp proposed value for gas limit) also happens for other transaction types?

bschorchit commented 1 week ago

Potential solution: we should not use the dapp gas limit with it's below 21000, but use it if it's higher than that.