-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
anvil/eth: Use the raw v
signature value instead of bool
#7918
Conversation
Instead of converting the boolean corresponding to the y parity byte to a u64/U256, use the raw `v` value for the `v` field when available.
967ae98
to
2091dd9
Compare
I added a 2nd commit that fixes invalid (from geth's PoV) dummy signatures. The issue was that it was using By using |
d913d6e
to
c751351
Compare
OK and one last commit, to actually use the provided signature when creating a transaction. This resolves an issue where the computed transaction hash in This is a bit tangential to the initial issue, so I could if needed open another PR for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I think the failing tests are related |
|
The correct `v` value must be used when using a dummy signature, depending on the transaction type (the Legacy transactions being the ones needing a special case).
This fixes wrong hash being computed for transactions.
57c0cf9
to
a66a0cf
Compare
OK, I found the issue! So TIL, for all transactions that are not legacy, the To see the issue, cf. the signature change in the failing test. The previous signature wasn't actually valid. This can be checked here, for example: https://toolkit.abdk.consulting/ethereum#rlp,transaction (the v value was set to |
Hi @ngotchac thanks for the PR! Would you be able to fix the small merge conflicts so we can get it reviewed one last time and merged? |
whoops, sorry I dropped this |
Done, ready for review :) |
Fixes #7898
Motivation
Cf. the linked issue. The
v
value (which should be deprecated for some tx types) was wrongly set as the y parity byte converted into a uint.Solution
Instead of converting the boolean corresponding to the y parity byte to a u64/U256, use the raw
v
value for thev
field when available.