-
Notifications
You must be signed in to change notification settings - Fork 23
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
Problems with transactions with large amouts #1533
Comments
Until witnet/witnet-rust#1760 is done, we have implemented #1541 to solve this problem preventively |
Still happens as of sheikah commit b3142ff, and wallet commit witnet/witnet-rust@ed1b152 Steps to reproduce:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the transaction created by the wallet has some outputs with values larger than MAX_SAFE_INTEGER, sheikah may round them to the nearest valid float and then send an invalid transaction.
For example, creating a transaciton that tries to send 9 million wits:
Using the node CLI, we can calculate the value of the inputs, to summarize:
However, if we calculate (inputs - outputs), the actual fee is 1118999999999.
The problem is that the change output should be 25496909012345689 instead of 25496909012345690. This can be seen in the following JSON-RPC logs. The first transaction is the one sent from sheikah and it is invalid with error "Failed to verify the signature of transaction". The second transaction is a copy of the first but with that one output manually changed, and it is sent successfully.
After manually fixing the transaction, sheikah indexes it and shows it, but we can see how the value of the second output and the fee are wrong:
The text was updated successfully, but these errors were encountered: