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

perf: remove clones in PooledTransaction encoding #4251

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Aug 17, 2023

Previously there were many clones in the Encodable implementation for PooledTransaction. This first adds a new method called payload_len_with_signature on the individual transaction types, making it usable by PooledTransaction variants. The method is then used in the Encodable::length implementation, and the encode_with_signature method is used for Encodable::encode.

Fixes #4243

@Rjected Rjected added C-perf A change motivated by improving speed, memory usage or disk footprint A-networking Related to networking in general M-eip This change relates to the implementation of an EIP E-cancun Related to the Cancun network upgrade labels Aug 17, 2023
@Rjected Rjected requested a review from mattsse August 17, 2023 17:07
@Rjected Rjected requested a review from gakonst as a code owner August 17, 2023 17:07
@mattsse mattsse enabled auto-merge August 17, 2023 17:12
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #4251 (3d4e16c) into main (ca99ee2) will decrease coverage by 0.12%.
Report is 2 commits behind head on main.
The diff coverage is 87.50%.

Impacted file tree graph

Files Changed Coverage Δ
crates/primitives/src/transaction/pooled.rs 44.73% <64.70%> (-5.01%) ⬇️
crates/primitives/src/transaction/eip1559.rs 81.96% <100.00%> (+0.93%) ⬆️
crates/primitives/src/transaction/eip2930.rs 91.66% <100.00%> (+0.43%) ⬆️
crates/primitives/src/transaction/eip4844.rs 35.95% <100.00%> (+1.47%) ⬆️
crates/primitives/src/transaction/legacy.rs 100.00% <100.00%> (ø)
crates/primitives/src/transaction/mod.rs 80.04% <100.00%> (-0.07%) ⬇️

... and 16 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.88% <18.75%> (-0.03%) ⬇️
unit-tests 63.75% <87.50%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 26.13% <ø> (ø)
blockchain tree 82.56% <ø> (ø)
pipeline 90.07% <ø> (ø)
storage (db) 74.71% <ø> (ø)
trie 94.71% <ø> (ø)
txpool 49.03% <ø> (-1.67%) ⬇️
networking 77.46% <ø> (-0.05%) ⬇️
rpc 58.65% <ø> (+<0.01%) ⬆️
consensus 63.53% <ø> (ø)
revm 32.15% <ø> (ø)
payload builder 6.82% <ø> (ø)
primitives 86.31% <87.50%> (+0.08%) ⬆️

@mattsse mattsse added this pull request to the merge queue Aug 17, 2023
Merged via the queue into main with commit 60ad6b2 Aug 17, 2023
24 checks passed
@mattsse mattsse deleted the dan/encode-with-signature-fn-pooled-element branch August 17, 2023 17:25
alessandromazza98 pushed a commit to alessandromazza98/reth that referenced this pull request Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Related to networking in general C-perf A change motivated by improving speed, memory usage or disk footprint E-cancun Related to the Cancun network upgrade M-eip This change relates to the implementation of an EIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove redundante clones in PooledTransactionElement type
2 participants