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

[Bug]: Infinity crashing, can't start it #29795

Open
Laurentiu-Andronache opened this issue Jan 18, 2025 · 16 comments
Open

[Bug]: Infinity crashing, can't start it #29795

Laurentiu-Andronache opened this issue Jan 18, 2025 · 16 comments
Assignees
Labels
external-contributor needs-reproduction regression-prod-12.10.1 Regression bug that was found in production in release 12.10.1 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-extension-platform Extension Platform team type-bug Something isn't working

Comments

@Laurentiu-Andronache
Copy link

Laurentiu-Andronache commented Jan 18, 2025

Describe the bug

I click on it, it "loads" for 10 seconds, then it crashes. First it did it in one Chrome profile, and I stopped using it there. Then it did the same in another profile.

Expected behavior

Not this.

Screenshots/Recordings

Image

Steps to reproduce

I can replicate the issue by just doing 20-30 transactions in a row with a lot of calldata. Afterwads, MetaMask doesn't open anymore.

How to clear the transaction data from the Metamask local database without losing the wallets?

Error messages or log output

"""md
SCRIPTS IMPORT COMPLETE in Seconds: 1.8
sentry-install.js:1 MetaMask initialization complete.
sentry-install.js:1 RPC (https://metamask.github.io): metamask_getProviderState -> success
sentry-install.js:1 RPC (https://metamask.github.io): metamask_sendDomainMetadata -> success

sentry-install.js:1 **(Error#1)**
(anonymous) @ sentry-install.js:1
(anonymous) @ sentry-install.js:3
error @ runtime-lavamoat.js:7134
(anonymous) @ common-0.js:1
(anonymous) @ common-8.js:1
(anonymous) @ sentry-install.js:1
(anonymous) @ common-8.js:1
(anonymous) @ common-8.js:1
(anonymous) @ sentry-install.js:1
(anonymous) @ common-8.js:1
d @ common-8.js:1
(anonymous) @ common-5.js:13
y @ common-5.js:13
m @ common-5.js:13
(anonymous) @ sentry-install.js:1
(anonymous) @ common-7.js:1
h @ common-7.js:1
(anonymous) @ sentry-install.js:1
i @ sentry-install.js:3
**setTimeout**
(anonymous) @ sentry-install.js:1
(anonymous) @ sentry-install.js:3
(anonymous) @ runtime-lavamoat.js:12866
(anonymous) @ runtime-lavamoat.js:12866
(anonymous) @ runtime-lavamoat.js:12866
u @ common-7.js:1
(anonymous) @ common-7.js:1
C @ common-8.js:1
I @ common-8.js:1
S @ common-8.js:1
(anonymous) @ common-8.js:1
_write @ common-1.js:1
S @ common-8.js:1
(anonymous) @ common-8.js:1
(anonymous) @ common-8.js:1
l @ common-5.js:13
(anonymous) @ common-5.js:13
H @ common-5.js:13
U @ common-5.js:13
F.push @ common-5.js:13
_onMessage @ common-5.js:13
(anonymous) @ common-5.js:13Understand this errorAI

sentry-install.js:1 **Error#1: PortDuplexStream - disconnected**
(anonymous) @ sentry-install.js:1
(anonymous) @ sentry-install.js:3
logError @ runtime-lavamoat.js:7087
logSubErrors @ runtime-lavamoat.js:7030
error @ runtime-lavamoat.js:7136
(anonymous) @ common-0.js:1
(anonymous) @ common-8.js:1
(anonymous) @ sentry-install.js:1
(anonymous) @ common-8.js:1
(anonymous) @ common-8.js:1
(anonymous) @ sentry-install.js:1
(anonymous) @ common-8.js:1
d @ common-8.js:1
(anonymous) @ common-5.js:13
y @ common-5.js:13
m @ common-5.js:13
(anonymous) @ sentry-install.js:1
(anonymous) @ common-7.js:1
h @ common-7.js:1
(anonymous) @ sentry-install.js:1
i @ sentry-install.js:3
setTimeout
(anonymous) @ sentry-install.js:1
(anonymous) @ sentry-install.js:3
(anonymous) @ runtime-lavamoat.js:12866
(anonymous) @ runtime-lavamoat.js:12866
(anonymous) @ runtime-lavamoat.js:12866
u @ common-7.js:1
(anonymous) @ common-7.js:1
C @ common-8.js:1
I @ common-8.js:1
S @ common-8.js:1
(anonymous) @ common-8.js:1
_write @ common-1.js:1
S @ common-8.js:1
(anonymous) @ common-8.js:1
(anonymous) @ common-8.js:1
l @ common-5.js:13
(anonymous) @ common-5.js:13
H @ common-5.js:13
U @ common-5.js:13
F.push @ common-5.js:13
_onMessage @ common-5.js:13
(anonymous) @ common-5.js:13Understand this errorAI

sentry-install.js:1   **at o._write** (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:13:550465)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:13:611855
  at C (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:13:611923)
  at I.write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:13:615291)
  at c.h (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:27737)
  at c.emit (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:13:546666)
  at I (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:22542)
  at S (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:22372)
  at c.push (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:23159)
  at i._write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:733016)
  at S (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:37745)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:40845
  at i.write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-8.js:1:40872)
  at i.<anonymous> (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-5.js:1:472288)
"""

Detection stage

In production (default)

Version

12.10.1

Build type

None

Browser

Chrome

Operating system

Windows

Hardware wallet

Ledger

Additional context

No response

Severity

10/10 terrible

@Laurentiu-Andronache Laurentiu-Andronache added the type-bug Something isn't working label Jan 18, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Jan 18, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Jan 18, 2025
@metamaskbot metamaskbot added external-contributor regression-prod-12.10.1 Regression bug that was found in production in release 12.10.1 labels Jan 18, 2025
@Laurentiu-Andronache
Copy link
Author

I can replicate the issue by just doing 20-30 transactions in a row with a lot of calldata. How to clear the transaction data from the Metamask local database without losing the wallets?

@benjisclowder benjisclowder added team-extension-platform Extension Platform team Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. labels Jan 20, 2025
@MetaMask MetaMask deleted a comment from Welbert5753 Jan 21, 2025
@MetaMask MetaMask deleted a comment from Welbert5753 Jan 21, 2025
@benjisclowder
Copy link
Contributor

@Laurentiu-Andronache Hi and thank you for reporting this. Can you please provide a bit more details regarding which type of transactions you were performing and what did the calldata look like that triggered this behavior? It would be a big help in the efforts of reproducing this. Currently, 20-30 regular transactions don't trigger this crash.

@Laurentiu-Andronache
Copy link
Author

@Laurentiu-Andronache Hi and thank you for reporting this. Can you please provide a bit more details regarding which type of transactions you were performing and what did the calldata look like that triggered this behavior? It would be a big help in the efforts of reproducing this. Currently, 20-30 regular transactions don't trigger this crash.

Sure, it's 15-20 transactions like this one: https://basescan.org/tx/0x0a7bf0f34093701537c95cf973470ebd226063f0dd846b33a14d047a9451546e
It's easy to understand what they're about.

It would be cool if it can't load all the transactions, to just start with the ones currently loaded, or ask the user to reset them. Currently, it crashes. Is there a way to reset the transactions without reseting the wallet? I tried deleting the .ldb files but it just regenerates it and they're of very large size.

@Laurentiu-Andronache
Copy link
Author

Here's how AppData\Local\Google\Chrome\User Data\Profile 2\IndexedDB\chrome-extension_nkbihfbeogaeaoehlefnkodbefgpgknn_0.indexeddb.leveldb looks like, notice the large files:

Image

@Laurentiu-Andronache
Copy link
Author

Is there some way to still access the wallets? Or I need to wait for a Metamask fix?

@Laurentiu-Andronache
Copy link
Author

Is there some way to still access the wallets? I can share screen with a Metamask dev and maybe we achieve something?

@Laurentiu-Andronache
Copy link
Author

@gauthierpetetin @benjisclowder @dbrans to replicate this:

Disperse an airdrop with a test token on Base!
You can use https://disperse.app or https://drop.gaslite.org
Disperse to 1500 addresses at a time, up to 2000. After ~12 such transactions Metamask shouldn't finish loading anymore when you click on the icon. To prevent the issue, you'd have to click on this button every 10 transactions.

Image

@gauthierpetetin
Copy link
Contributor

Hi @Laurentiu-Andronache , thanks a lot for the additional information.
Could you please reach out to our support (https://support.metamask.io/), such that we can plan a screen sharing session with you and @danjm ?

@Laurentiu-Andronache
Copy link
Author

@gauthierpetetin they can't do it, but if you add me on @LaurWin on Discord, I can share screen there.

Image

@Laurentiu-Andronache
Copy link
Author

They can't even open a GitHub link. I don't think Metamask support could be useful in any way.

@gauthierpetetin
Copy link
Contributor

Sure I reached out to you on Discord (@gauthierpetetin)

@Laurentiu-Andronache
Copy link
Author

Sure I reached out to you on Discord (@gauthierpetetin)

I accepted, you can call directly when you're around.

@Laurentiu-Andronache
Copy link
Author

In 12.12.0 the wallet still crashes in the same way.

@davidmurdoch davidmurdoch self-assigned this Feb 25, 2025
@davidmurdoch
Copy link
Contributor

⚠️ Warning: Do not try this on a production build with real accounts and data you want to keep. It will very likely break your MetaMask installation. ⚠️

Reproduction steps are here: #30572

⚠️ Warning: Do not try this on a production build with real accounts and data you want to keep. It will very likely break your MetaMask installation. ⚠️

@gauthierpetetin gauthierpetetin moved this from To be triaged to Ready to be mitigated in Bugs by team Mar 4, 2025
@dlefloch dlefloch moved this from Ready to be mitigated to Needs to be root caused in Bugs by team Mar 4, 2025
@dlefloch dlefloch moved this from Needs to be root caused to Ready to be fixed in Bugs by team Mar 4, 2025
@davidmurdoch
Copy link
Contributor

One approach to solve this is to reduce the amount of state transferred from the background to the UI:

In metamask-controller.js, we could add a controllers array to filter them out.

  /**
   * The metamask-state of the various controllers, made available to the UI
   *
   * @param {string[]} controllers - A list of controller names to include in the state.
   * If empty, all controllers are included.
   * @returns {object} status
   */
  getState(controllers = []) {
    const { vault } = this.keyringController.state;
    const isInitialized = Boolean(vault);
    const flatState = this.memStore.getFlatState(controllers);

    return {
      isInitialized,
      ...sanitizeUIState(flatState),
    };
  }

This approach would likely require updating much of the UI to handle partial state.

@davidmurdoch
Copy link
Contributor

Some further information:

A single transaction can easily take up over 6MB of memory.

Simple state sent from the background to the UI is is about 25MB, after sending 3 large transactions it increased to over 73MB.

The data param of each transaction is stored at least 3 times per transaction.

getFlatState and sanitizeUIState are both horribly inefficient as well, which isn't related to this specific bug, but is related to performance issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor needs-reproduction regression-prod-12.10.1 Regression bug that was found in production in release 12.10.1 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-extension-platform Extension Platform team type-bug Something isn't working
Projects
Status: To be fixed
Status: Ready to be fixed
Development

No branches or pull requests

8 participants
@davidmurdoch @dbrans @vpintorico @gauthierpetetin @Laurentiu-Andronache @metamaskbot @benjisclowder and others