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

Merge BlockBodyTxExt trait into BlockBody #13609

Open
mattsse opened this issue Dec 31, 2024 · 3 comments · May be fixed by #13613
Open

Merge BlockBodyTxExt trait into BlockBody #13609

mattsse opened this issue Dec 31, 2024 · 3 comments · May be fixed by #13613
Assignees
Labels
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 Dec 31, 2024

Describe the feature

this extension trait is required because it makes use of rayon functions

pub trait BlockBodyTxExt: BlockBody {

ref #13552

instead of the approach in #13552 we should feature gate this rayon usage and move to reth-primitives-traits

TODO

  • move BlockBodyTxExt functions into BlockBody
  • feature gate rayon for
    pub fn recover_signers<'a, I, T>(txes: I, num_txes: usize) -> Option<Vec<Address>>
    where
    T: SignedTransaction,
    I: IntoParallelIterator<Item = &'a T> + IntoIterator<Item = &'a T> + Send,
    {
    if num_txes < *PARALLEL_SENDER_RECOVERY_THRESHOLD {
    txes.into_iter().map(|tx| tx.recover_signer()).collect()
    } else {
    txes.into_par_iter().map(|tx| tx.recover_signer()).collect()
    }
    }
    /// Recovers a list of signers from a transaction list iterator _without ensuring that the
    /// signature has a low `s` value_.
    ///
    /// Returns `None`, if some transaction's signature is invalid.
    pub fn recover_signers_unchecked<'a, I, T>(txes: I, num_txes: usize) -> Option<Vec<Address>>

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Dec 31, 2024
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started and removed S-needs-triage This issue needs to be labelled labels Dec 31, 2024
@hoank101
Copy link
Contributor

hi, i can do it

@mattsse
Copy link
Collaborator Author

mattsse commented Dec 31, 2024

cool, we def need a rayon feature in reth-primitives-traits

also relevant:

#13552 (comment)

because we want feature gated functions

@hoank101 hoank101 linked a pull request Jan 1, 2025 that will close this issue
@mymiracle0118
Copy link

May I take this issue on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants