Skip to content

Conversation

@qj0r9j0vc2
Copy link
Member

Summary

  • Fix consensus liveness bug where height 3 gets stuck
  • Add get_validators_with_queued_cars() method to check ALL validators with queued CARs
  • Update consensus decision handler to process queued CARs from all validators, not just those in the decided cut

Test plan

  • Added test_get_validators_with_queued_cars test
  • Added test_queued_cars_from_validators_not_in_cut test
  • All 107 data-chain tests pass
  • Rustfmt and clippy clean

The previous fix only checked validators that were included in the
decided cut. This missed validators that had queued CARs but were
not part of the cut.

Changes:
- Add get_validators_with_queued_cars() method to PrimaryState
- Update consensus decision handler to check ALL validators with
  queued CARs, not just those in the decided cut
- Add comprehensive tests for the new behavior

This ensures that no CARs are left stranded in the queue when a
consensus decision is processed.
@qj0r9j0vc2 qj0r9j0vc2 self-assigned this Jan 25, 2026
The previous fix only processed CARs at exactly the expected position
in a single pass. This missed chains of queued CARs where processing
position N should make position N+1 ready, then N+2, etc.

Changes:
- Wrap queued CAR processing in a loop that continues until no more
  CARs become ready
- Add test_queued_car_chain_processing test to verify chain handling

This ensures that after a consensus decision syncs positions, ALL
queued CARs in a chain are processed, not just the first one.
When consensus decision is processed, queued CARs are processed which
may reach attestation threshold. At that point, try_form_cut() is called
but returns early because pipeline_stage is still Proposing.

After finalize_height() switches to Collecting stage, we need to call
try_form_cut() again to form cuts from any CARs that were attested
during the queued CAR processing loop.

This fixes the consensus liveness bug where height 3 gets stuck with
all validators voting NIL because no cuts were being produced.
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.

2 participants