ethereum-studio icon indicating copy to clipboard operation
ethereum-studio copied to clipboard

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

Open MaxXor opened this issue 4 years ago • 2 comments

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

MaxXor avatar May 11 '20 16:05 MaxXor

Hi @MaxXor !

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

javier-tarazaga avatar May 20 '20 06:05 javier-tarazaga

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

afanasy avatar May 22 '21 13:05 afanasy