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: make reth-stages independent of concrete DatabaseProvider #10934

Merged
merged 12 commits into from
Sep 19, 2024

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Sep 16, 2024

alike #10921

  • Extracts unwind methods into DbTxMut extension trait DbTxUnwindExt
  • Changes Stage generic from DB to Provider
  • Moves take_state and remove_state methods to StateChangeWriter, unsure what's best place for those, lmk if they should be somewhere else

Next step could be to make Pipeline generic over provider factory, removing its dependency on NodeTypesWithDB. However, this would make scope of the PR bigger without much benefit, so can be done in a follow up

@joshieDo joshieDo added C-enhancement New feature or request A-db Related to the database A-sdk Related to reth's use as a library labels Sep 16, 2024
Copy link
Collaborator

@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.

this is pretty cool, this removes the hardcoded db type and instead relies on trait bounds for the various stages impl.

this will be more flexible

very nice.

pending @joshieDo

@@ -11,26 +10,26 @@ use std::{
/// individual stage sets to determine what kind of configuration they expose.
///
/// Individual stages in the set can be added, removed and overridden using [`StageSetBuilder`].
pub trait StageSet<DB: Database>: Sized {
pub trait StageSet<Provider>: Sized {
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool

crates/stages/stages/src/stages/execution.rs Outdated Show resolved Hide resolved
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
@klkvr klkvr added this pull request to the merge queue Sep 19, 2024
Merged via the queue into main with commit 180f100 Sep 19, 2024
36 checks passed
@klkvr klkvr deleted the klkvr/reth-stages-db-provider branch September 19, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database A-sdk Related to reth's use as a library C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants