-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[Consensus] Clean up non-garbage collection code paths. #22148
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
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.
Great clean up!
let dag_state = self.dag_state.read(); | ||
(dag_state.gc_enabled(), dag_state.gc_round()) | ||
}; | ||
let gc_round = self.dag_state.read().gc_round(); |
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.
consensus_median_based_commit_timestamp
has rolled out now. Is the plan to remove verify_block_timestamps()
in another PR?
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 am planning to do on an upcoming PR
consensus/core/src/block_manager.rs
Outdated
@@ -438,16 +426,12 @@ impl BlockManager { | |||
|
|||
// Keep only the ancestors that are greater than the GC round to check for their existence. Keep in mind that if GC is disabled |
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.
Remove the comment on GC disabled?
consensus/core/src/block_manager.rs
Outdated
/// When gc is enabeld we set a high gc_depth value so in practice gc_round will be 0, but we'll be able to test in the common case | ||
/// that this work exactly the same way as when gc is disabled. | ||
#[rstest] | ||
/// blocks should be uniquely suspended and no missing blocks should exist. We set a high gc_depth value so in practice gc_round will be 0. |
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.
s/in practice/in this test ?
consensus/core/src/core.rs
Outdated
|
||
self.add_blocks(blocks) | ||
return Ok(missing_block_refs); |
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.
return Ok(missing_block_refs); | |
Ok(missing_block_refs) |
consensus/core/src/dag_state.rs
Outdated
for (i, _round) in last_committed_rounds.into_iter().enumerate() { | ||
let authority_index = state.context.committee.to_authority_index(i).unwrap(); |
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.
for (i, _round) in last_committed_rounds.into_iter().enumerate() { | |
let authority_index = state.context.committee.to_authority_index(i).unwrap(); | |
for (authority_index, _authority) in state.context.committee.authorities() { |
@@ -924,35 +924,8 @@ impl<C: NetworkClient, V: BlockVerifier, D: CoreThreadDispatcher> Synchronizer<C | |||
let commands_sender = self.commands_sender.clone(); | |||
let dag_state = self.dag_state.clone(); | |||
|
|||
let (commit_lagging, last_commit_index, quorum_commit_index) = self.is_commit_lagging(); | |||
if commit_lagging { | |||
// If gc is enabled and we are commit lagging, then we don't want to enable the scheduler. As the new logic of processing the certified commits |
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.
Maybe keep the comments on why skipping periodic sync is ok?
Description
When introduced garbage collection, all the related GC features did sit behind a feature flag. This PR is removing the unused paths since GC is now enabled for considerable amount of time. Same goes for the new linearizer logic, where the earlier one is cleaned up. This is simplifying the code and ensures we don't need to deal with obsolete logic.
Test plan
CI/PT
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.