Extend PoolTransaction trait with tx_type and length #1485
Labels
A-tx-pool
Related to the transaction mempool
C-enhancement
New feature or request
D-good-first-issue
Nice and easy! A great choice to get started
Describe the feature
with eth68 newPooledTransaction Hashes (#1482) we also need to send the type and encoded length of the transaction.
This can already be obtained by converting
PoolTransaction -> TransactionSigned
and then get the length by encoding the transaction.however, this is pretty wasteful because we need to reencode the transaction everytime it is requested or announced.
TODO
fn tx_type() -> u8
returns the type of the transactionfn encoded_length() -> usize
returns the length of the rlp encoded object. This is then cached in theValidPoolTransaction
type as a field.Additional context
No response
The text was updated successfully, but these errors were encountered: