-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
treat RLP 'r' and 's' fields as quantity, not string #1258
Conversation
This change in output seems like the right thing to do, but it doesn't completely fix #1170. |
You are right of course; should be better now |
Would love to get this merged in! |
Applying the patch in our code, and running it against parity, returns the following error (from Parity):
Apparently, the issue is more complex than I had hoped. This issue seems related as well: ethereumjs/ethereumjs-tx#51 In our code, we have gone back to the "strip two leading zeros" code, and that seems to work fine against parity. |
@jellegerbrandy I also received an error (using geth) when stripping zeros resulted in an odd numbered string. I will try removing two leading zeros - should at least improve the number of times I receive this error which is A LOT. |
This reverts commit 3f5ea28.
I reverted the commit stripping all leading zeros, which clearly was mistaken. Apparently, |
RLP encoding is one byte at the smallest unit. Represented as a hex string, that's two hex characters at a time. So for the rlp encoding here, it should only trim null bytes (double 0 hex characters): https://github.com/ethereum/web3.js/pull/1258/files#diff-7bb2a20126193b9ecfe4723f83429c49R162 But for the |
Thanks for the fix! And sorry for the delay, i was not available over christmas. |
Woot! Thanks for this! |
It would be good to add a few test cases, does somebody have a tx and key which results in the 0x00.. r, s values? |
Of course now I am unable to get an error. I will comment here if I come across one. |
I just posted short r & s values in #1170 |
@malissa you could use a previous commit :) |
* treat RLP 'r' and 's' fields as quantity, not string * strip _all_ leading zeros in rlp encoding * Revert "strip _all_ leading zeros in rlp encoding" This reverts commit 3f5ea28.
This fixes #1170 by using the patch provided by @ldn0x7dc in that issue