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

chore: move database to FullNodeTypes #13414

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Dec 16, 2024

Right now FullNodeTypes::Types are set to NodeTypesWithDBAdapter most of the time, making it impossible to bound like Types = EthereumNode

The reason NodeTypesWithDB exists is so that we can avoid having both db and NodeTypes generics on types depending on ProviderFactory, so we can't just get rid of it. Instead, this PR makes it a responsibility of NodeBuilder to assemble NodeTypesWithDBAdapter, keeping user-configured NodeTypes in FullNodeTypes

Comment on lines +27 to +31
type Types: NodeTypesWithEngine;
/// Underlying database type used by the node to store and retrieve data.
type DB: Database + DatabaseMetrics + DatabaseMetadata + Clone + Unpin + 'static;
/// The provider type used to interact with the node.
type Provider: FullProvider<Self::Types>;
type Provider: FullProvider<NodeTypesWithDBAdapter<Self::Types, Self::DB>>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah this makes sense

@mattsse mattsse added this pull request to the merge queue Dec 16, 2024
Merged via the queue into main with commit 82f21a3 Dec 16, 2024
43 checks passed
@mattsse mattsse deleted the klkvr/move-db-to-full-node-types branch December 16, 2024 16:09
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.

2 participants