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: Feature gate traits inside storage-api that still depend on db-api #14647

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

frankudoags
Copy link
Contributor

Feature gate traits inside storage-api that still depend on db-api, updates reth-provider features flag for storage-api dependency to include new db-api feature

@frankudoags
Copy link
Contributor Author

Addresses second task for #14613

cc @mattsse

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.

ty, a few suggestions

Comment on lines 1 to 5
#[cfg(feature = "db-api")]
use reth_db_api::table::Table;
use reth_storage_errors::provider::ProviderResult;

/// The trait for fetching provider statistics.
#[cfg(feature = "db-api")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

these we don't need if we instead put the feature above mod stats;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix, leftover from iterations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be compatible?

so we dont need a feature here?

Copy link
Contributor Author

@frankudoags frankudoags Feb 22, 2025

Choose a reason for hiding this comment

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

BlockNumberAddress is declared inside of dp-api, and the StorageChangeSetReader trait uses that, hence the need for the feature over that trait alone

Copy link
Collaborator

Choose a reason for hiding this comment

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

right, actually we should move these to db-models

opening an issue for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will take it up. That particular type is indeed supposed to live in db-models.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think here we want to group all of the db-api traits into its own module, like


#[cfg("db-api)]
pub use db::*;

#[cfg("db-api)]
mod db {
 ....
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

noted, cleaner too. Will fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mattsse mattsse added the A-db Related to the database label Feb 22, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants