-
Notifications
You must be signed in to change notification settings - Fork 346
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
Int53 does not match golang int64 type size #1133
Comments
Right. This is intentional in order to be able to use JavaScript |
Because I'm doing a test, my validator voting power is overflowing. |
Arg, we fixed this before when we hit the limit of the 32 bit range (confio/ts-relayer#204). Now you exceed the 53 bit range? How is that possible? Using some crazy Ethereum tokens for staking? |
This is because the precision of the staking token I use is 18. If the number of delegations is 10^20 and the power reduce is 100, then the voting power is 10^18 which is greater than 2^53-1 |
In more extreme cases, set DefaultPowerReduction to 100 |
For the Tendermint 0.35 client we can use BigInt for the voting powers. Then we are safe. It would be the first usage of bigint in CosmJS API. Hope it would not cause trouble for devs. |
Do you know the expected value range in the |
Given that Cosmos SDK 0.46 will use Tendermint 0.34 (#1093 (comment)), I think we'll make the change for both Tendermint 0.34 and 0.35 client from CosmJS 0.29 on. |
The |
Thanks. #1187 is ready for review now. |
Hi!
In the Tendermint34 package, there is an overflow of Int53 type when decoding the data returned on the blockchain, such as block height and voting power, the int64 type used by tendermint, the range is: -2^63-1 to 2^63 but Int53 only has - (2^53 - 1) to 2^53 - 1.
cosmjs tendermint34 reponses types
tendermint rpc responses types
Integer parse error
The text was updated successfully, but these errors were encountered: