Skip to content

[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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

akichidis
Copy link
Contributor

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.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@akichidis akichidis requested a review from a team as a code owner May 16, 2025 12:19
Copy link

vercel bot commented May 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:13pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:13pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:13pm

@akichidis akichidis temporarily deployed to sui-typescript-aws-kms-test-env May 16, 2025 12:19 — with GitHub Actions Inactive
Copy link
Contributor

@mwtian mwtian left a 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();
Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -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
Copy link
Contributor

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?

/// 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.
Copy link
Contributor

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 ?


self.add_blocks(blocks)
return Ok(missing_block_refs);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return Ok(missing_block_refs);
Ok(missing_block_refs)

Comment on lines 181 to 182
for (i, _round) in last_committed_rounds.into_iter().enumerate() {
let authority_index = state.context.committee.to_authority_index(i).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

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?

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.

3 participants