Skip to content

consensus: Add spec harness and unit tests#4023

Open
HDauven wants to merge 5 commits intomasterfrom
consensus/spec-harness
Open

consensus: Add spec harness and unit tests#4023
HDauven wants to merge 5 commits intomasterfrom
consensus/spec-harness

Conversation

@HDauven
Copy link
Member

@HDauven HDauven commented Feb 10, 2026

This PR adds unit tests for consensus invariants (aggregator, queue, step_votes_reg) and adds a specification-level test harness that replays consensus traces through handler logic.

@HDauven HDauven requested a review from fed-franz February 10, 2026 22:59
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 225ea6ac73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +712 to +714
if let Some(q) = round_quorum {
quorum = Some(q);
break;

Choose a reason for hiding this comment

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

P2 Badge Replay all traced rounds before declaring success

replay_trace_entries exits immediately after observing the first quorum for expected_round, so replay_multi_round_trace_reaches_quorum can pass without ever validating later rounds in the trace. In practice, any corruption or omission in round-2+ entries will be silently ignored as long as round 1 still reaches quorum, which undermines the purpose of the multi-round fixture as a regression test.

Useful? React with 👍 / 👎.

@HDauven HDauven force-pushed the consensus/spec-harness branch from 225ea6a to 7857bf7 Compare February 10, 2026 23:07
@HDauven HDauven force-pushed the consensus/spec-harness branch from 7857bf7 to 79b13d0 Compare February 10, 2026 23:23
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.

1 participant