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

[ZKS-04] Perform garbage collection on subdag commit #3117

Merged
merged 2 commits into from Mar 3, 2024

Conversation

raychu86
Copy link
Contributor

Motivation

This PR performs garbage collection on subdag commits only. Previously we were performing GC on every round advancement, which was relying on the improbability of going 100 rounds without committing a subdag. Now we guarantee that we don't throw away older certificates in the case we do go more than MAX_GC_ROUNDS without a commit.

Note: We may also consider adding a manual skip of older certificates in the commit phase.

Audit Finding: [zksecurity 04] Garbage Collection Can Block Commits From Happening


/// Update the storage by performing garbage collection based on the next round.
pub(crate) fn garbage_collect_certificates(&self, next_round: u64) {
Copy link

Choose a reason for hiding this comment

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

what a clean cut!

Copy link

@mimoo mimoo left a comment

Choose a reason for hiding this comment

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

LGTM!

@howardwu howardwu merged commit c6ab661 into mainnet Mar 3, 2024
23 of 24 checks passed
@howardwu howardwu deleted the feat/gc-on-commit branch March 3, 2024 04:18
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.

None yet

3 participants