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

Add helper to filter pending transactions #12199

Closed
mattsse opened this issue Oct 30, 2024 · 5 comments · Fixed by #12204
Closed

Add helper to filter pending transactions #12199

mattsse opened this issue Oct 30, 2024 · 5 comments · Fixed by #12204
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 Oct 30, 2024

Describe the feature

similar to:

/// Returns all pending transactions sent by a given user
fn get_pending_transactions_by_sender(
&self,
sender: Address,
) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>;

but should accept a predicate FnMut(&ValidPoolTransaction<Self::Transaction>>>) -> bool

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Oct 30, 2024
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started A-tx-pool Related to the transaction mempool and removed S-needs-triage This issue needs to be labelled labels Oct 30, 2024
@lakshya-sky
Copy link
Contributor

can I take this?

@mattsse
Copy link
Collaborator Author

mattsse commented Oct 30, 2024

assigned

@lakshya-sky
Copy link
Contributor

@mattsse what would be the use case for this proposed function. does it make sense to add similar function to TxPool so that get_pending_transactions_by_sender can use the newly added function?

@mattsse
Copy link
Collaborator Author

mattsse commented Oct 30, 2024

not quite, lookup by sender is faster,

what this new function should do instead is essentially a iter().filter().collect()

@gakonst
Copy link
Member

gakonst commented Oct 30, 2024

Is there a next step which integrates these with the PayloadBuilder trait, so that one can build customized payload builder strategies from the txpool?

@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Nov 1, 2024
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.

3 participants