Skip to content

Conversation

flcl42
Copy link
Contributor

@flcl42 flcl42 commented Apr 2, 2025

Changes

  • Handle cases of big integers in form of decimal number passed in json

Example:

{"jsonrpc":"2.0","id":2,"method":"taikoAuth_txPoolContentWithMinTip","params": ["0x0000000000000000000000000000000000000000", 

15974323677659503371917880, 

10000, 10000, [], 1, 1 ]}

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

@flcl42 flcl42 force-pushed the handle-big-decimals branch 2 times, most recently from 2fa4178 to 6c41aa0 Compare April 2, 2025 19:50
@flcl42 flcl42 force-pushed the handle-big-decimals branch from 6c41aa0 to 7530058 Compare April 2, 2025 20:22
@flcl42 flcl42 marked this pull request as ready for review April 2, 2025 20:24
@benaadams
Copy link
Member

Can be an issue here as Json should only technically be able to safely represent integers up to 9007199254740991; then it would be float rounded

The Number.MAX_SAFE_INTEGER static data property represents the maximum safe integer in JavaScript (2^53 – 1).

@smartprogrammer93
Copy link
Contributor

Can be an issue here as Json should only technically be able to safely represent integers up to 9007199254740991; then it would be float rounded

The Number.MAX_SAFE_INTEGER static data property represents the maximum safe integer in JavaScript (2^53 – 1).

@benaadams why is that. I can understand that this is a deviation from the standard, but why cant it safely be transmitted that way and then decentralized with a deviation from the standard?

@smartprogrammer93
Copy link
Contributor

Javascript support is not really important here at all

@benaadams
Copy link
Member

txPoolContentWithMinTip

Any reason its not being passed as quoted hex which is standard for all large numbers?

@smartprogrammer93
Copy link
Contributor

txPoolContentWithMinTip

Any reason its not being passed as quoted hex which is standard for all large numbers?

Taiko did it this way

@flcl42
Copy link
Contributor Author

flcl42 commented Apr 3, 2025

Can be an issue here as Json should only technically be able to safely represent integers up to 9007199254740991; then it would be float rounded

The Number.MAX_SAFE_INTEGER static data property represents the maximum safe integer in JavaScript (2^53 – 1).

JSON standard states the numbers can be of any precision, only constrained by implementation. Standard library handles up to max ulong, I'm trying to cover uint256 range additionally.

@flcl42 flcl42 force-pushed the handle-big-decimals branch 2 times, most recently from dc7d193 to acdc99d Compare April 3, 2025 10:44
@flcl42 flcl42 force-pushed the handle-big-decimals branch from acdc99d to a3588c1 Compare April 3, 2025 10:45
@Scooletz Scooletz self-requested a review April 3, 2025 11:49
@flcl42 flcl42 merged commit dbc3fb7 into master Apr 3, 2025
80 checks passed
@flcl42 flcl42 deleted the handle-big-decimals branch April 3, 2025 11:51
@Scooletz Scooletz mentioned this pull request Apr 30, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants