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 KakarotTransactions trait to upstream send_raw_transaction #1352

Merged
merged 8 commits into from
Sep 5, 2024

Conversation

tcoratger
Copy link
Collaborator

Context:

As a follow-up to #1321, this pull request addresses the circular dependency between the mempool and the provider.

Changes Introduced:

  1. Creation of KakarotTransactions Trait:

    • The send_raw_transaction method has been moved to a new trait called KakarotTransactions.
    • This trait is implemented for our EthClient.
    • This design is inspired by the FullEthApi trait in the reth project, where the trait is implemented for EthApi, which itself contains both a provider and a pool.
  2. Separation of Implementations:

    • By upstreaming the send_raw_transaction method, we start to differentiate between the Client's implementations and those of the provider.
    • The provider, being lower in the hierarchy, serves the client. This refactor makes it clear that the pool only needs access to the provider, not the entire client.
  3. Elimination of Circular Dependency:

    • The previous circular dependency between the pool and the provider is removed. Now, the pool relies solely on the provider, not the full client.

eugypalu
eugypalu previously approved these changes Aug 29, 2024
Copy link
Collaborator

@eugypalu eugypalu left a comment

Choose a reason for hiding this comment

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

LGTM

src/client/mod.rs Outdated Show resolved Hide resolved
src/pool/mempool.rs Show resolved Hide resolved
src/pool/mempool.rs Show resolved Hide resolved
Co-authored-by: greged93 <82421016+greged93@users.noreply.github.com>
@greged93 greged93 added this pull request to the merge queue Sep 5, 2024
Merged via the queue into kkrt-labs:main with commit 45f3fb5 Sep 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants