-
Notifications
You must be signed in to change notification settings - Fork 795
feat(core): implemented signed transaction RLP decoding #1096
Conversation
678aaff
to
1b6dddb
Compare
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.
awesome!
before we merge this, mind having a look at this
that's part of the forge node PR foundry-rs/foundry#1037
whether we can somehow unify some things
@Rjected have you had the chance to look at Matt's code above? Are there maybe more utils to add? |
(bump @Rjected) |
thanks @Rjected for the write up here foundry-rs/foundry#1037 (comment) agree with most of that, current blocker is that I need to convert from foundry node I think for now I'll try to do conversion in both ways and figure out how to unify afterwards, because I believe it could be replaced with ethers' types eventually. so my recommendation, get this PR and the node PR over the line individually and unify and clean up afterwards. |
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 if @mattsse thinks this is OK to merge as-is - need to fix minor conflict in changelog
1b6dddb
to
eeb8d37
Compare
eeb8d37
to
f50da3b
Compare
Cool, just fixed changelog, rebased |
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.
based rebase, lgtm thank you for getting this over the line
Motivation
There are often cases where we might have some RLP encoding of a transaction, for example when receiving P2P messages, and want to decode that into a transaction type.
Solution
This implements RLP decoding for signed transactions, extracting the signature from the decoding as well as building and returning the transaction. This also recovers the sender from the signature so we can populate the
from
field. This can error, so we introduce new error types (Eip1559RequestError
,TypedTransactionError
,RequestError
) which also wrap errors we might encounter when decoding and recovering the sender.This also introduces a
hash
method onTypedTransaction
which returns the hash of the signed transaction's RLP encoding.PR Checklist