-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: integrate memory overlay in canonical state #9817
Conversation
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.
one suggestion
3b5f175
to
e277928
Compare
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.
cool, one more suggestion
crates/chain-state/src/in_memory.rs
Outdated
while let Some(state) = current_state { | ||
in_memory.insert(0, state.block()); | ||
|
||
current_state = state.parent.as_ref().map(|parent| Arc::new(*parent.clone())); | ||
} |
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.
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
Closes #9614