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

chore(txpool): use Vec in validate_all #5044

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Oct 17, 2023

Uses a Vec in validate_all so the order can be preserved. The transactions are now validated in the order they are inserted

@Rjected Rjected added C-enhancement New feature or request A-tx-pool Related to the transaction mempool labels Oct 17, 2023
@Rjected Rjected requested a review from mattsse as a code owner October 17, 2023 03:20
@Rjected Rjected changed the title chore: use Vec in add_transactions chore: use Vec in validate_all Oct 17, 2023
@Rjected Rjected changed the title chore: use Vec in validate_all chore(txpool): use Vec in validate_all Oct 17, 2023
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #5044 (a1935c8) into main (3eb0265) will decrease coverage by 0.01%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

Files Coverage Δ
crates/transaction-pool/src/lib.rs 57.07% <100.00%> (+0.21%) ⬆️

... and 35 files with indirect coverage changes

Flag Coverage Δ
integration-tests 17.02% <100.00%> (-0.04%) ⬇️
unit-tests 62.35% <0.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
reth binary 30.85% <ø> (ø)
blockchain tree 80.82% <ø> (ø)
pipeline 88.41% <ø> (ø)
storage (db) 74.41% <ø> (-0.03%) ⬇️
trie 95.01% <ø> (+0.49%) ⬆️
txpool 54.73% <100.00%> (-0.51%) ⬇️
networking 78.19% <ø> (+<0.01%) ⬆️
rpc 58.25% <ø> (-0.18%) ⬇️
consensus 63.01% <ø> (ø)
revm 28.69% <ø> (ø)
payload builder 7.95% <ø> (-0.01%) ⬇️
primitives 86.43% <ø> (-0.12%) ⬇️

Comment on lines 239 to 242
for tx in transactions.into_iter() {
let validate_outcome = self.validate(origin, tx).await;
outcomes.push(validate_outcome);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not equivalent because now all futures are polled one by one

this should just collect into a vec instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, forgot that join_all would be better and preserves input order

@mattsse mattsse added this pull request to the merge queue Oct 17, 2023
Merged via the queue into main with commit b399e5d Oct 17, 2023
23 checks passed
@mattsse mattsse deleted the dan/return-vec-in-add-transactions branch October 17, 2023 16:05
mattsse pushed a commit that referenced this pull request Nov 8, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants