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

QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'metamask-config' exceeded the quota. #3071

Closed
kumavis opened this issue Jan 23, 2018 · 3 comments
Labels
area-background Issues relating to the extension background process. type-bug

Comments

@kumavis
Copy link
Member

kumavis commented Jan 23, 2018

https://sentry.io/metamask/metamask/issues/439078556/

QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'metamask-config' exceeded the quota.
  at LocalStorageStore._putState (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:76821:34)
  at LocalStorageStore.putState (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:76537:12)
  at ObsStoreStream._write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:76670:21)
  at doWrite (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:80795:64)
  at writeOrBuffer (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:80784:5)
...
(9 additional frame(s) were not displayed)
@kumavis kumavis added type-bug P0-stopdroproll area-background Issues relating to the extension background process. labels Jan 23, 2018
@tmashuang
Copy link
Contributor

Function in chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:76537:12 is:

function pbkdf2 (password, salt, iterations, keylen, digest) {
  if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)
  if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)

  checkParameters(iterations, keylen)

  digest = digest || 'sha1'

  var hmac = new Hmac(digest, password, salt.length)

  var DK = Buffer.allocUnsafe(keylen)
  var block1 = Buffer.allocUnsafe(salt.length + 4)
  salt.copy(block1, 0, 0, salt.length)

  var destPos = 0
  var hLen = sizes[digest]
  var l = Math.ceil(keylen / hLen)

  for (var i = 1; i <= l; i++) {
    block1.writeUInt32BE(i, salt.length)

    var T = hmac.run(block1, hmac.ipad1)
    var U = T

    for (var j = 1; j < iterations; j++) {
      U = hmac.run(U, hmac.ipad2)
      for (var k = 0; k < hLen; k++) T[k] ^= U[k]
    }

    T.copy(DK, destPos)
    destPos += hLen
  }

  return DK
}

@kumavis
Copy link
Member Author

kumavis commented Mar 22, 2018

We released a version that uses extension.storage.local to address this issue - however we have not yet removed writing to localStorage

@kumavis
Copy link
Member Author

kumavis commented Mar 26, 2018

localStorage writing was removed here #3732

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-background Issues relating to the extension background process. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants