SuperblocksHQ / ethereum-studio

Official Ethereum Studio project repository. And IDE specially tailored to make it as simple as possible to onboard new users into the Ethereum ecosystem
https://ethereum.org/build/
GNU General Public License v3.0
187 stars 103 forks source link

eth.getBlock fails with "Number can only safely store up to 53 bits" #231

Open MaxXor opened 4 years ago

MaxXor commented 4 years ago

Re-opening the issue here (from: https://github.com/ethereum/web3.js/issues/3512) as it was suggested that this might be a problem with the custom EVM.

Expected behavior

Get the block.

Actual behavior

Error "Number can only safely store up to 53 bits"

Example code

        this.web3.eth.getBlock(number, function(error, result) {
            if (error) {
                console.log(error);
                return;
            }
            console.log(result.timestamp);
        });

Ethereum Studio example: https://studio.ethereum.org/5eb924ed26b4730012351a47?openFile=app/app.js Lines (133-145)

Steps to reproduce the behavior

  1. Load the Ethereum Studio example
  2. Deploy the contract
  3. See the error in console log

Environment

Javascript with web3.js version 1.2.7

javier-tarazaga commented 4 years ago

Hi @MaxXor !

Lets use take a look as they have pointed out correctly, might be an issue with the custom EVM Ethereum Studio implements.

afanasy commented 3 years ago

The patch from @dvcrn seems to fix it: https://github.com/dvcrn/web3.js/commit/b868c5fece70fba6d34b577ef59f3fa3159390ad