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-02] Introduce committee lookback #2336

Merged
merged 5 commits into from
Feb 10, 2024
Merged

Conversation

raychu86
Copy link
Contributor

@raychu86 raychu86 commented Feb 7, 2024

Motivation

This PR introduces a committee round lag of 100 rounds to match the MAX_GC_ROUNDS. This committee round lag is used in consensus to ensure that the committee being used to validate the subdags is the committee at round.saturating_sub(N::COMMITTEE_ROUND_LAG).

Audit Finding: [zksecurity 02] Dynamic Committee Feature is Not Safe

@@ -82,11 +82,24 @@ impl<N: Network, C: ConsensusStorage<N>> Ledger<N, C> {
let ratified_finalize_operations =
self.vm.check_speculate(state, block.ratifications(), block.solutions(), block.transactions())?;

// Get the round number for the previous committee. Note, we subtract 2 from odd rounds,
// because committees are updated in even rounds.
let previous_round = match block.round() % 2 == 0 {
Copy link
Contributor Author

@raychu86 raychu86 Feb 10, 2024

Choose a reason for hiding this comment

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

Technically, we can just subtract 1, because block rounds are always even.

@howardwu howardwu merged commit 2d062ce into mainnet Feb 10, 2024
17 of 77 checks passed
@howardwu howardwu deleted the feat/committee-round-lag branch February 10, 2024 01:26
@raychu86 raychu86 changed the title Introduce committee round lag [zksecurity 02] Introduce committee lookback Feb 12, 2024
@raychu86 raychu86 changed the title [zksecurity 02] Introduce committee lookback [ZKS-02] Introduce committee lookback Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants