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

tx-pool: rm into tx constraint for PoolTransaction #10057

Merged
merged 7 commits into from
Aug 24, 2024

Conversation

tcoratger
Copy link
Contributor

@tcoratger tcoratger commented Aug 3, 2024

Related #8668

@emhane emhane added C-debt Refactor of code section that is hard to understand or maintain A-tx-pool Related to the transaction mempool labels Aug 21, 2024
@emhane
Copy link
Member

emhane commented Aug 22, 2024

make sense if you review @klkvr since your work to make generic over primitives in other crates collides/overlaps. otherwise also @joshieDo currently looking at best way to do this in provider.

@tcoratger
Copy link
Contributor Author

make sense if you review @klkvr since your work to make generic over primitives in other crates collides/overlaps. otherwise also @joshieDo currently looking at best way to do this in provider.

To give a bit more context to this PR, it follows a discussion with @mattsse about #8668 and its resolution in several steps to avoid doing everything at once.

Copy link
Collaborator

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

This currently introduces pretty strict requirements of Tx: T: PoolTransaction<Consensus = TransactionSignedEcRecovered> on many of transaction-pool types which don't rely on this conversion.

Given that most of the conversion consumers are outside of tx-pool crate I am wondering if we should relax those trait bounds to keep tx-pool types more flexible and instead move them to types explicitly relying on those conversions?

crates/transaction-pool/src/validate/mod.rs Outdated Show resolved Hide resolved
crates/transaction-pool/src/traits.rs Show resolved Hide resolved
@emhane emhane requested a review from klkvr August 23, 2024 17:47
Copy link
Collaborator

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

I've tried relaxing the bounds locally and it seems that a lot of them can either be removed or only kept at a small subset of impl blocks

Wondering if the root issue is that you're adding T: PoolTransaction<Consensus = TransactionSignedEcRecovered> to struct definitions? T: PoolTransaction should be mostly enough, and impls can restrict Consensus AT if needed

Though I am wondering if I am missing something about the chosen approach here and those bounds on structs are actually desired? (cc @emhane @mattsse)

crates/rpc/rpc/src/eth/filter.rs Outdated Show resolved Hide resolved
crates/transaction-pool/src/pool/events.rs Outdated Show resolved Hide resolved
crates/transaction-pool/src/traits.rs Outdated Show resolved Hide resolved
@emhane
Copy link
Member

emhane commented Aug 23, 2024

I've tried relaxing the bounds locally and it seems that a lot of them can either be removed or only kept at a small subset of impl blocks

Wondering if the root issue is that you're adding T: PoolTransaction<Consensus = TransactionSignedEcRecovered> to struct definitions? T: PoolTransaction should be mostly enough, and impls can restrict Consensus AT if needed

Though I am wondering if I am missing something about the chosen approach here and those bounds on structs are actually desired? (cc @emhane @mattsse)

I agree that it makes sense to relax bounds on ATs here. since we are not yet completely sure how we will inject NodeTypes::Primitives into reth-transaction-pool crate, narrowing down constraints on ATs to the smallest scope possible is helping us impl that later in the most logic way.

if you already have the code locally @klkvr, feel free to push to this branch.

@tcoratger
Copy link
Contributor Author

@klkvr yes please feel free to push here. I wanted to relax as much as possible but I certainly missed a point here. If you don't push I'll try myself tonight but feel free to do so to make it faster :)

@tcoratger
Copy link
Contributor Author

Nice @klkvr seems logical to me this way! Once this PR is merged, I'll do the last one to close the issue!

@emhane emhane added this pull request to the merge queue Aug 24, 2024
Merged via the queue into paradigmxyz:main with commit 6dc00a2 Aug 24, 2024
34 checks passed
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-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants