question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ganache throws on calculation w/ >53 bits

See original GitHub issue

Expected Behavior

Test cases pass!

Current Behavior

During test execution, ganache throws and error and spoils the test run:

...
eth_sendTransaction

  Transaction: 0xf7d661285d3b1a577fcfc4cbcade805ae0d21c4eaca75699dace0312aca8dd30
  Gas usage: 61894
  Block Number: 10
Error: Number can only safely store up to 53 bits
    at assert (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/node_modules/bn.js/lib/bn.js:6:21)
    at BN.toNumber (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/node_modules/bn.js/lib/bn.js:506:7)
    at Object.t.bufferToInt (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:148279)
    at Object.number (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:67837)
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:219900
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:42:48553
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:2092107
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:21088
    at s (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:24209)
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:24251
    at Bt (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:33684)
    at Object.<anonymous> (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:4:24340)
    at Object.decode (~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:2091974)
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:2057355
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:2062165
    at ~/.nvm/versions/node/v12.19.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:2059465

Possible Solution

Add actual integers to JS

Steps to Reproduce (for bugs)

  1. clone branch from PR (below)
  2. brownie test test/integration
  3. …profit!

Context

It makes me sad

Your Environment

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fubuloubucommented, Nov 26, 2020

So, the current iteration of tests/integration/test_calculation.py is actually mining a ton of blocks (2.3m), this could be what causes it to fail. I actually need to update it to no longer be mining all those blocks due to a change we made to use timestamps instead.

1reaction
fubuloubucommented, Nov 25, 2020

Are you able to pin-point which test call is failing? Usually this error occurs when you accidentally pass in an ethereum address where a number is expected.

Not really, no but I will check if this is the case. I doubt it, because usually eth-abi Python library is very good about detecting mismatching w/ call types, but you never know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Releases · trufflesuite/ganache - GitHub
Launching ganache with fork is throwing revert errors when communicating with 3rd party contracts (#956); Build a real pending block! (#772); VM Exception...
Read more >
How much ganache do I need? - Jessica Harris Cake ...
How do I calculate the amount of ganache needed if I am only doing crump coat with ganache? Filling would be in butter...
Read more >
Untitled
God song tagalog with lyrics, Prepaid paypal gift cards, 1984 chevy blazer mpg, Hotel dimitra beach kos opinie, Make a wooden window frame...
Read more >
pVk - River Thames Conditions - Environment Agency - GOV.UK
Gammelshausen lokmuseum, So take a look at me now film, Origen tilapia chitralada, Rangda taiwan nok neng, Irs w-4 calculator 2016, Illinois city ......
Read more >
Chocolate Ganache Cake | Rouxbe Online Culinary School
This incredibly moist chocolate cake is smothered with a creamy ... Milk chocolate ganache is a bit trickier to make since quality milk ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found