Open tcoratger opened 1 month ago
@emhane Maybe we should keep this for a follow up PR right? My reasoning was as follows:
BlockBody
contains a vector of TransactionSigned
TransactionSigned
type but we have the TxEnvelope
type which is equivalent because it is an enum that contains all the Signed
variants.
recover_signer
method which is already implemented for TxEnvelope
.BlockBody<TxEnvelope>
to use it in reth. But maybe if we want to be even more generic we could open a follow up issue to move the recover_signer
and recover_signers
methods to the appropriate traits right?cc @mattsse
Related https://github.com/paradigmxyz/reth/issues/11208
The ideal for the reth issue is to restrict the functions to be implemented as much as possible to the alloy
Transaction
trait however it doesn't make much sense to add arecover_signer
orrecover_signers
method to theTransaction
trait because we can only fetch the signer in theSigned<Tx>
case, which is almost never the case when trying to implementTransaction
.So I think the simplest approach to replace https://github.com/paradigmxyz/reth/blob/0270128d4f7a9f6fad27dff69273095abdfa7452/crates/primitives/src/block.rs#L564-L566 is to do the similar implementation here in alloy using what already exists in
TxEnvelope
to recover the signers from an iterator of transactionsTxEnvelope
.