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

feat(advanced): Provider trait over reth-db #144

Merged
merged 27 commits into from
Oct 4, 2024
Merged

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented Sep 25, 2024

Motivation

In the latest release of alloy-0.3.6, ProviderCall was introduced as a return type in the Provider trait.

ProviderCall enables to fetch the result of an RPC call from any data source such as the node's db, cache etc.

More on this can be found here alloy-rs/alloy#788

Solution

Example showing how to wrap the Provider trait over reth-db and use ProviderCall to fetch responses from the db directly.

PR Checklist

  • Added Documentation
  • Breaking changes

@yash-atreya yash-atreya changed the title feat(advanced): Provider trait over reth-db feat(advanced): Provider trait over reth-db Sep 25, 2024
@yash-atreya yash-atreya marked this pull request as ready for review September 26, 2024 06:36
examples/advanced/Cargo.toml Outdated Show resolved Hide resolved
examples/advanced/examples/reth_db_provider.rs Outdated Show resolved Hide resolved
examples/advanced/examples/reth_db_provider.rs Outdated Show resolved Hide resolved
examples/advanced/examples/reth_db_provider.rs Outdated Show resolved Hide resolved
examples/advanced/examples/reth_db_provider.rs Outdated Show resolved Hide resolved
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

cool,
I think maintaining this could be a chore and these are very useful primitives, so I suggest that we move the rethdblayer and the helpers to a new crate in reth: reth-alloy

examples/advanced/examples/reth_db_layer.rs Outdated Show resolved Hide resolved
examples/advanced/Cargo.toml Outdated Show resolved Hide resolved
examples/advanced/examples/reth_db_provider.rs Outdated Show resolved Hide resolved
examples/advanced/examples/reth_db_layer.rs Show resolved Hide resolved
@yash-atreya
Copy link
Member Author

@mattsse final review and merge pls

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, pending rev update

examples/advanced/Cargo.toml Outdated Show resolved Hide resolved
@yash-atreya
Copy link
Member Author

CI will be fixed with alloy release that includes alloy-rs/alloy#1428

@yash-atreya yash-atreya merged commit c184890 into main Oct 4, 2024
3 of 4 checks passed
@zerosnacks zerosnacks mentioned this pull request Oct 9, 2024
@onbjerg onbjerg deleted the yash/reth-db-prov-call branch October 28, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants