Skip to content

Commit

Permalink
[Consensus 2.0] fix potential liveness issue (MystenLabs#16722)
Browse files Browse the repository at this point in the history
## Description 

This PR is fixing the issue of not emitting a new round signal when a
new quorum is reached after proposing for a round. This could
potentially create a liveness issue under network faults and marginal
quorum availability as the leader timeout component would never get
signalled about the new round to trigger a new round advancement.

The PR is re-using the `add_accepted_blocks` method to handle this

## Test Plan 

CI

---
If your changes are not user-facing and do not break anything, you can
skip the following section. Otherwise, please briefly describe what has
changed under the Release Notes section.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
akichidis authored Mar 19, 2024
1 parent 2d13f08 commit f8e7e02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions consensus/core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,16 @@ impl Core {
// Unnecessary to verify own blocks.
let verified_block = VerifiedBlock::new_verified(signed_block, serialized);

// Add to the threshold clock and pending ancestors
self.threshold_clock.add_block(verified_block.reference());

// Accept the block into BlockManager and DagState.
let (accepted_blocks, missing) = self
.block_manager
.try_accept_blocks(vec![verified_block.clone()]);
assert_eq!(accepted_blocks.len(), 1);
assert!(missing.is_empty());

// Internally accept the block to move the threshold clock etc
self.add_accepted_blocks(vec![verified_block.clone()]);

// Ensure the new block and its ancestors are persisted, before broadcasting it.
self.dag_state.write().flush();

Expand Down

0 comments on commit f8e7e02

Please sign in to comment.