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: integrate memory overlay in canonical state #9817

Merged
merged 5 commits into from
Jul 26, 2024

Conversation

fgimenez
Copy link
Member

Closes #9614

@github-actions github-actions bot added the C-enhancement New feature or request label Jul 25, 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.

one suggestion

crates/chain-state/src/in_memory.rs Outdated Show resolved Hide resolved
@fgimenez fgimenez force-pushed the fgimenez/integrate-memory-overlay-in-canonical-state branch from 3b5f175 to e277928 Compare July 26, 2024 08:10
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.

cool, one more suggestion

Comment on lines 372 to 376
while let Some(state) = current_state {
in_memory.insert(0, state.block());

current_state = state.parent.as_ref().map(|parent| Arc::new(*parent.clone()));
}
Copy link
Collaborator

@mattsse mattsse Jul 26, 2024

Choose a reason for hiding this comment

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

I'd like to convert this to two functions for convenience of BlockState that
a) returns the parent blocks Vec<BlockState>
b) returns the entire chain: a) + insert(0, self)

I guess we also don't really need the Arc wrapper because the blockstate's data is already shared

@fgimenez fgimenez added this pull request to the merge queue Jul 26, 2024
Merged via the queue into main with commit ac28538 Jul 26, 2024
32 checks passed
@fgimenez fgimenez deleted the fgimenez/integrate-memory-overlay-in-canonical-state branch July 26, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate memory overlay in canonical state
2 participants