-
Notifications
You must be signed in to change notification settings - Fork 42
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
rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.txdata).R #24
Comments
This error is caused by the individual values r and s have single leading 0s. This was observed by Eth earlier: |
Thanks mdranger. Sorry, I did not keep it. Will send you if I keep it next time. |
Please let us know if you still see this. Thanks. |
It is hard to reproduce, normally happens when we execute a lot of transfer by one address continuously. JFYI. |
Similar error happen again when I executed a erc20 transfer. rawTx: {"from":"0x460420a40a694e2efbc5defdb8a0a76f3134ecfb","to":"0x3de4c3b9add4f95c74adeb538537f68b7c6dccb4","value":"0x0","nonce":"0x19","gasPrice":"0x17d7840","gasLimit":"0x9c40","data":"0xa9059cbb000000000000000000000000dbc02f7819d8f88dd473974ca516afc78700d3bf00000000000000000000000000000000000000000000000564d702d38f5e0000","chainId":"101"} Error: rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.txdata).R |
Here is the signed tx: |
when decoded the signed TX back, we can see the R and S are like this: |
We added the following lines in the lib/utils/account.js file, line 258: We will update the package soon. |
Great! My pleasure. |
The Chain3 is updated to 0.1.7 to fix this problem. |
I have same problem as you, can you help me how to deal with leading zero in raw-transaction? Boardcast shows error: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.txdata).S" including raw-transaction: How can I deal with leading zero, and how can I re-construction raw-transaction after correct it? |
you can convert r and s to biginteger then convert the result to bytes to del leading zero bytes because the signed r and s must be 32bytes . sometimes them need add zero bytes for padding |
Sometime, such error will happen when we do a lot of transactions in one time. What's the meaning of it? How to avoid such error?
"rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.txdata).R"
The text was updated successfully, but these errors were encountered: