-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Formatter has a large number of overflow bugs #3227
Comments
Thanks for opening this issue! Those properties are known to us and we will update the handling of them as soon as possible. This would be a bigger breaking change for all of us. Because of this will we do the mentioned improvements at the earliest for the next minor release of web3.js. |
Could you provide more information about your execution context? Why do you require these values be so large / have such precision? |
I continue to execute a lot of gas consuming contracts on the private chain.
|
@usd-yamazaki Thank you for providing the link to the EIP. @nivida discussed this in a meeting yesterday and I argued these changes should not be made to the 1.x branch as a bug fix because:
One way to address this is for someone to publish an extension lib that serves high performance forks and private chains which Web3 could link to in the docs. @nivida has highlighted the changes that would be necessary in #3234. An existing example can be seen at jpmorganchase/quorum.js, which supports a nanosecond precision timestamp by applying a @usd-yamazaki What is your opinion of this approach? |
@cgewecke Another idea could be to optionally choose whether the parameter supports BigNumber.
|
Thanks @usd-yamazaki, I like the interface you've proposed there. Will think about this further... |
Closing in favor of #3442 |
outputBlockFormatter currently has a bug where multiple parameters overflow.
For example, the theoretical condition value of block.gasLimit is 0x7fffffffffffffff. Since this exceeds 53 bits that can be handled by javascript Number, it is necessary to use BigNumber.
https://github.com/ethereum/web3.js/blob/ca9869fba7a87087079c24195ebb522b587e148f/packages/web3-core-helpers/src/formatters.js#L263
Incorrect
Correct
There are other reports of similar problems.
#1905 block.timestamp
#1960 block.number
Probably the same problem will occur with block.gasUsed.
In addition, similar potential bugs are expected for outputTransactionFormatter, outputTransactionReceiptFormatter, and outputLogFormatter.
The text was updated successfully, but these errors were encountered: