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

Introduce StateCommitment in StateProviders #12602

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

frisitano
Copy link
Contributor

Replacement for #11867

@@ -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> {
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

@frisitano frisitano requested a review from gakonst as a code owner November 20, 2024 04:57
@frisitano frisitano force-pushed the feat/provider-state-commitment branch from f0f7fa1 to 52426db Compare November 20, 2024 05:04
@frisitano frisitano requested a review from klkvr November 20, 2024 05:39
@mattsse
Copy link
Collaborator

mattsse commented Nov 26, 2024

really sorry about the slow progress,
lots of movement in this codesection, but this is now gradually stabilizing

@mattsse mattsse enabled auto-merge November 26, 2024 16:48
@mattsse mattsse added this pull request to the merge queue Nov 26, 2024
Merged via the queue into paradigmxyz:main with commit 83af493 Nov 26, 2024
41 checks passed
@frisitano
Copy link
Contributor Author

really sorry about the slow progress, lots of movement in this codesection, but this is now gradually stabilizing

No problem I understand, thanks for keeping this in mind and pushing it forward 🙏

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.

3 participants