Skip to content
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

Extend PoolTransaction trait with tx_type and length #1485

Closed
mattsse opened this issue Feb 21, 2023 · 2 comments · Fixed by #1500
Closed

Extend PoolTransaction trait with tx_type and length #1485

mattsse opened this issue Feb 21, 2023 · 2 comments · Fixed by #1500
Assignees
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

Comments

@mattsse
Copy link
Collaborator

mattsse commented Feb 21, 2023

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

  • extend PoolTransaction trait with two more functions:
    • fn tx_type() -> u8 returns the type of the transaction
    • fn encoded_length() -> usize returns the length of the rlp encoded object. This is then cached in the ValidPoolTransaction type as a field.

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started A-tx-pool Related to the transaction mempool labels Feb 21, 2023
@leruaa
Copy link
Contributor

leruaa commented Feb 21, 2023

Is this blocked by #1482? If not I would like to take this on.

@mattsse
Copy link
Collaborator Author

mattsse commented Feb 21, 2023

unblocked now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants