-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: use custom address recovery for fake signature #4890
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
I think I would have solved this differently, but this fixes the issue for now.
The function transaction_from_block
can return the ExecutableTransaction
which includes the from-address, voiding the need for recovery. This PR shows my intended solution.
Something we should wonder is whether the concept of faking a transaction should be incorporated in the raw transaction type? This PR does so now, which I'm not a fan of.
A limiting factor atm is that we don't have a way of expressing that an Address
is a valid Ethereum address.
E.g. it's currently still possible that someone uses a JSON-RPC client with fake transactions for testing, which would result in the recovery of an invalid Ethereum address.
I'll approve to expedite the merging process, but if you agree with the above, I'd prefer a minimal change to use the ExecutionTransaction
(which already contains the correct address) and to revisit this discussion when we deal with NomicFoundation/edr#260
I don't think it should.
I'm not sure I understand this. Could you elaborate? |
Thanks for thinking deeply about this @Wodann! I'm answering between the lines below.
Faking a transaction is already incorporated into the raw transaction type:
The source of the bug is that this is not taken into account when doing recovery which this PR fixes.
I don't follow either, sorry. Please elaborate :)
That's a good idea, but it still leaves
The right way to handle this imo would be to have two signed transaction types: But moving the check to compile time is a bigger change, hence the approach in this PR. All in all, I'd prefer the solution in this PR over #4911 as while the latter fixes the immediate problem, it doesn't prevent it from reoccurring. |
I agree with this. The
It's unnecessary to use |
Make sure we're not trying to recover the address from fake signatures. Fixes NomicFoundation/edr#294