trufflesuite / vscode-ext

Truffle for VSCode simplifies how you create, build, debug and deploy smart contracts on Ethereum and EVM-compatible blockchains
https://marketplace.visualstudio.com/items?itemName=trufflesuite-csi.truffle-vscode
Other
38 stars 24 forks source link

fork network, local debug error "Numbers can only be safely stored up to 53 bits" #236

Open brunsu opened 2 years ago

brunsu commented 2 years ago

Here is the video I recorded reporting the error

https://user-images.githubusercontent.com/109267056/194201193-b6c3c9de-ac41-42aa-8b60-52a1a8660dc3.mp4

link: https://s21.aconvert.com/convert/p3r68-cdx67/84l4l-289cf.mp4

brunsu commented 2 years ago

@xhulz

xhulz commented 2 years ago

Hey @brunsu!

Thank you for open this issue :)

Let me check what is happening and I'll turn to you as soon as possible.

Cheers!

xhulz commented 2 years ago

@brunsu some questions:

Thank you!

brunsu commented 2 years ago

@brunsu some questions:

  • Are you using the HDWallet?
  • Are you trying to debug on local Ganache?

Thank you!

yes I want to debug on local fork network ganache

xhulz commented 2 years ago

Hey @brunsu,

Sorry for the delay. We have released a new version of the VSCode extension with some improvements and debug fixes. Could you please test it again?

Cheers!

kevinbluer commented 2 years ago

Also @brunsu just for reference the fix @xhulz is referencing is in the v2.6.0 release (changelog). Unless you've changed the default behavior, the extension should automatically update itself with VS Code, but it could be worth checking the version via the extensions tab:

Screen Shot 2022-11-02 at 2 32 17 PM
acuarica commented 2 years ago

Hi @brunsu thanks for reporting this. After further investigation, we realized that this issue is caused by a bug in Web3js when forking BSC network. We are using Web3js to interact with the underlying network. Take a look at https://github.com/web3/web3.js/pull/3789 and https://github.com/web3/web3.js/pull/3948 for discussions surrounding this issue. TL;DR; gasLimit is greater than 53 bits in some BSC transactions, that's the reason for the error and it's not going to be fixed in the current version of Web3js https://github.com/web3/web3.js/pull/3789#issuecomment-770925044.

Nevertheless, we did some quick experiments when forking a BSC network. After bypassing this error, we found there is another issue, we get a missing trie node error coming from their RPC. We are going to discuss internally about how we are going to support BSC in the future. We'll keep you posted.