MetaMask / metamask-extension

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

[Bug]: Transactions not processed with MetaMask on local Ganache blockchain #25693

Open MinHtet-O opened 6 days ago

MinHtet-O commented 6 days ago

Describe the bug

I am using MetaMask with a local Ganache blockchain to test my smart contracts. While using MetaMask, I am encountering an issue in my local blockchain where I cannot perform any transactions, whether they are smart contract interactions or simple ETH transfers to another wallet.

Expected behavior

Transactions sent from MetaMask should be processed, a new block with successful transaction are created, and logged correctly in Ganache, similar to the behaviour observed when executing transactions via nodeJS script.

Screenshots/Recordings

Metamask extension account activity after I attempted to initiate smart contract transactions or send ETH Screenshot 2024-07-05 at 4 54 30 PM

Transaction detail of contract failure Screenshot 2024-07-05 at 4 54 57 PM

Error in browser console of my frontend app

Screenshot 2024-07-05 at 5 49 54 PM

Blocks view in Ganache UI after doing transactions. Please notice that there are no transactions in the blocks, created after I attempt to do transactions with metmask

Monosnap Screenshot 2024-07-05 at 4 58 51 PM 2024-07-05 17-54-00

Steps to reproduce

  1. Add local ganache network to metamask
  2. Attempt to perform a transaction (either smart contract interaction from frontend app or ETH transfer).
  3. Ganache logs shows that metamask initiated eth_sendRawTransaction. But no successful transaction after that.

Error messages or log output

// the logs when my nodeJS script makes smart contract transaction with local ganache. the new block is created which is the expected behaviour

[2024/07/05 16:53:10.111] -    >  eth_estimateGas: [
   >   {
   >     "type": "0x2",
   >     "maxFeePerGas": "0x8ab3fc14",
   >     "maxPriorityFeePerGas": "0x59682f00",
   >     "from": "0xe0a71284ef59483795053266cb796b65e48b5124",
   >     "to": "0x40b3b172608bea2afd246f1d5e26cc0b2acb38b6",
   >     "data": "0xfd4c9b96000000000000000000000000cdfacbb428dd30ddf6d99875dcad04cbefcd6e60"
   >   }
   > ]
[2024/07/05 16:53:10.157] -    >  eth_chainId: []
[2024/07/05 16:53:10.164] -    >  eth_blockNumber: []
[2024/07/05 16:53:10.165] -    >  eth_chainId: []
[2024/07/05 16:53:10.167] -    >  eth_sendRawTransaction: [
   >   "0x02f890820539068459682f00848ab3fc1482bb2e9440b3b172608bea2afd246f1d5e26cc0b2acb38b680a4fd4c9b96000000000000000000000000cdfacbb428dd30ddf6d99875dcad04cbefcd6e60c001a0b6a3930c84b148e3ec60695032973606b8e0fc6af9ddaff841940ab9b0ca4129a05a38c78a166ce921cf2daa4f5739566271f1d3d33b5b70091a6ad29059db9d38"
   > ]
[2024/07/05 16:53:10.179] - 
  Transaction: 0xb90f24f12a9a3a1b6f63391591f8514925309a57efea552c95fec52ce645fea0
  Gas usage: 47538
  Block number: 9
  Block time: Fri Jul 05 2024 16:53:10 GMT+0800 (Singapore Standard Time)

// the logs when metamask initiates smart contract transaction with local ganache. metamask initiates the eth_sendRawTransaction with data. Neither the transaction is successful or the error is logged after that.

[2024/07/05 16:54:34.159] -    >  eth_call: [
   >   {
   >     "to": "0x40b3b172608bea2afd246f1d5e26cc0b2acb38b6",
   >     "data": "0x01ffc9a780ac58cd00000000000000000000000000000000000000000000000000000000"
   >   },
   >   "0xa"
   > ]
[2024/07/05 16:54:34.684] -    >  eth_call: [
   >   {
   >     "to": "0x40b3b172608bea2afd246f1d5e26cc0b2acb38b6",
   >     "data": "0x01ffc9a7d9b67a2600000000000000000000000000000000000000000000000000000000"
   >   },
   >   "0xa"
   > ]
[2024/07/05 16:54:35.207] -    >  eth_call: [
   >   {
   >     "to": "0x40b3b172608bea2afd246f1d5e26cc0b2acb38b6",
   >     "data": "0x95d89b41"
   >   },
   >   "0xa"
   > ]
[2024/07/05 16:54:35.211] -    >  eth_call: [
   >   {
   >     "to": "0x40b3b172608bea2afd246f1d5e26cc0b2acb38b6",
   >     "data": "0x313ce567"
   >   },
   >   "0xa"
   > ]
[2024/07/05 16:54:47.027] -    >  eth_blockNumber: []
[2024/07/05 16:54:50.720] -    >  eth_blockNumber: []
[2024/07/05 16:55:07.534] -    >  eth_blockNumber: []
[2024/07/05 16:55:11.234] -    >  eth_blockNumber: []
[2024/07/05 16:55:26.941] -    >  eth_sendRawTransaction: [
   >   "0x02f89082053980840c3137f9840c31380a82bb2e9440b3b172608bea2afd246f1d5e26cc0b2acb38b680a4fd4c9b96000000000000000000000000cdfacbb428dd30ddf6d99875dcad04cbefcd6e60c080a02a5ccaa44f36ef9beb5471e27a61c45567e12d1388bbbb163ab222418e9e4cc1a079db0416bf3a26433b875db2d4c08e3ce53a02b30880bacc7e7fbe53787a0d9d"
   > ]
[2024/07/05 16:55:26.957] -    >  eth_getBlockByNumber: [
   >   "0xb",
   >   true
   > ]
[2024/07/05 16:55:26.966] -    >  eth_getBlockByNumber: [
   >   "0xb",
   >   false
   > ]
[2024/07/05 16:55:26.968] -    >  eth_getBalance: [
   >   "0xe0a71284ef59483795053266cb796b65e48b5124",
   >   "latest"
   > ]
[2024/07/05 16:55:26.968] -    >  eth_getTransactionCount: [
   >   "0xe0a71284ef59483795053266cb796b65e48b5124",
   >   "latest"
   > ]
[2024/07/05 16:55:26.969] -    >  eth_getBalance: [
   >   "0xcdfacbb428dd30ddf6d99875dcad04cbefcd6e60",
   >   "latest"
   > ]
[2024/07/05 16:55:26.970] -    >  eth_getTransactionCount: [
   >   "0xcdfacbb428dd30ddf6d99875dcad04cbefcd6e60",
   >   "latest"
   > ]
[2024/07/05 16:55:26.971] -    >  eth_getBalance: [
   >   "0x391aff3942857a10958425febf1fc1938d9f5ae7",
   >   "latest"
   > ]

Version

11.15.0 ( Synpress's Google Chrome environment ) 11.16.14

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

Severity

Since this is only happening on the local blockchain we are using for end-to-end testing, the current users on mainnets are not affected. However, since the CI is not passing, the changes from bug fixes and features are stuck in the pipeline and blocked by this issue.

seaona commented 5 days ago

Dup: https://github.com/MetaMask/metamask-extension/issues/25655