-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Introduce StateCommitment in StateProviders #12602
Introduce StateCommitment in StateProviders #12602
Conversation
@@ -41,13 +41,15 @@ use std::fmt::Debug; | |||
/// - [`tables::AccountChangeSets`] | |||
/// - [`tables::StorageChangeSets`] | |||
#[derive(Debug)] | |||
pub struct HistoricalStateProviderRef<'b, Provider> { | |||
pub struct HistoricalStateProviderRef<'b, Provider, SC> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that Provider
we pass here already knows the StateCommitment
type let's avoid introducing an additional generic here and instead just add a trait like
trait StateCommitmentProvider {
type StateCommitment: StateCommitment;
}
which would be implemented by the DatabaseProvider
.
That way we can just enforce this bound on historical providers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion! This should make things much cleaner. I will implement this pattern now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
f0f7fa1
to
52426db
Compare
really sorry about the slow progress, |
No problem I understand, thanks for keeping this in mind and pushing it forward 🙏 |
Replacement for #11867