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

Indexes Payload store by view number #2449

Merged
merged 6 commits into from
Jan 24, 2024
Merged

Indexes Payload store by view number #2449

merged 6 commits into from
Jan 24, 2024

Conversation

bfish713
Copy link
Collaborator

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 use split_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

@bfish713 bfish713 marked this pull request as ready for review January 23, 2024 16:45
shenkeyao
shenkeyao previously approved these changes Jan 23, 2024
Copy link
Member

@shenkeyao shenkeyao left a 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>>,
Copy link
Member

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.

@bfish713 bfish713 requested a review from shenkeyao January 23, 2024 16:57
shenkeyao
shenkeyao previously approved these changes Jan 23, 2024
Copy link
Member

@jbearer jbearer left a 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?

jbearer
jbearer previously approved these changes Jan 24, 2024
@bfish713 bfish713 merged commit 4b0657e into main Jan 24, 2024
10 of 12 checks passed
@bfish713 bfish713 deleted the bf/payload-commit-fix branch January 24, 2024 18:56
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.

[BUG_FIX] - Index Payload Map by View number
3 participants