-
Notifications
You must be signed in to change notification settings - Fork 53
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
Indexes Payload store by view number #2449
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.
Just a nit comment.
@@ -55,7 +55,7 @@ pub struct Consensus<TYPES: NodeType> { | |||
/// | |||
/// Contains the block payload commitment and encoded transactions for every leaf in | |||
/// `saved_leaves` if that payload is available. | |||
pub saved_payloads: PayloadStore, | |||
pub saved_payloads: BTreeMap<TYPES::Time, Vec<u8>>, |
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.
Same as the other PR. Let's update the comment.
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.
Does this branch also need the genesis special case?
Closes #2448
This PR:
Stops using our custom
PayloadStore
and just uses BTreeMap. This means we may have duplicate Payloads in the store, but the store will remain quite small so should not be an issue. We usesplit_off
for GCing the map just like the state map. This gets rid of all the payloads prior to decide, should be a straight forward way to GC.This PR does not:
This is not the PR which fixes this for the release branch. Review that one first
Key places to review:
Is garbage collection and intialization correct? Am I always indexing with the correct view number