Skip to content

Accept real node bootstrap in consensus replay - #8733

Open
cjen1-msft wants to merge 1 commit into
mainfrom
cjen1-msft-scaling-tribble
Open

cjen1-msft wants to merge 1 commit into
mainfrom
cjen1-msft-scaling-tribble

Conversation

@cjen1-msft

@cjen1-msft cjen1-msft commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #8728.

The consensus replayer rejects every trace captured from a real CCF node at its second record; this lets it check them. A real node runs genesis asynchronously after force_become_primary, so it traces ticks between become_leader and the genesis replicate. Its genesis entry carries the constitution and exceeds append_entries_size_limit, so replicate() also traces a batch_flush. cft_driver writes a small genesis entry immediately, so driver captures never showed either.

Bootstrap now accepts only those bare ticks, unobserved because the model starts after genesis, and one optional flush that must send nothing.

Why skipping pre-genesis ticks is sound

Before genesis the leader has no peers or configurations (the traced become_leader lists none), so a tick sends nothing and its check-quorum passes trivially; the next observation still checks the state the ticks leave. replicate() holds the consensus lock across the genesis batch, from its replicate event through add_configuration and batch_flush, so no other event on that node falls between them. A send after the flush is rejected as an ungrouped event, since no rule claims it.

@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from 8916a80 to 4c03d6f Compare November 10, 2026 15:57
@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from 4c03d6f to 211a95c Compare November 10, 2026 18:47
@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from 211a95c to be90c99 Compare November 11, 2026 16:23
@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from be90c99 to 3715b5d Compare November 12, 2026 12:37
@cjen1-msft
cjen1-msft changed the base branch from cjen1-msft-didactic-guacamole to cjen1-msft-expert-dollop November 12, 2026 12:38
@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from 3715b5d to fcb0692 Compare November 12, 2026 12:44
@cjen1-msft
cjen1-msft added this pull request to stack #8730 November 12, 2026 13:22
@cjen1-msft
cjen1-msft marked this pull request as ready for review November 13, 2026 10:56
@cjen1-msft
cjen1-msft requested a review from a team as a code owner November 13, 2026 10:56
Copilot AI balanced review requested due to automatic review settings November 13, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block approval of the bootstrap trace replay changes.

No open issues 🎉

What changed in this PR

Updates the Lean consensus replayer to accept real CCF node bootstrap traces, extending replay support beyond the driver's immediate, small genesis entry.

Changes:

  • Accepts bare ticks before genesis and one optional genesis flush, while rejecting sends from that flush.
  • Adds valid and invalid fixtures covering the bootstrap sequence.
  • Documents the expanded bootstrap contract and fixture expectations.

Custom instructions used

Applied the CCF repository guidance supplied in the review context. No additional instruction files were loaded.

File Description
lean/​consensus/​replay/​README.md Documents accepted pre-genesis ticks and genesis flushing.
lean/​consensus/​replay/​fixtures/​valid/​bootstrap.ndjson Adds a valid real-node-style bootstrap trace.
lean/​consensus/​replay/​fixtures/​README.md Describes the new bootstrap fixtures.
lean/​consensus/​replay/​fixtures/​invalid/​bootstrap-flush-send.ndjson Covers rejection of sends during the genesis flush.
lean/​consensus/​replay/​fixtures/​invalid/​bootstrap-event.ndjson Covers rejection of non-tick events before genesis.
lean/​consensus/​Consensus/​Replay/​Reduction.lean Allows pre-genesis ticks and an optional bootstrap flush.

Review effort: Balanced

@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from acb7e2f to 2f29451 Compare November 13, 2026 15:48
Copilot AI balanced review requested due to automatic review settings November 13, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the bootstrap trace handling changes.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the bootstrap replay changes.

No open issues 🎉

Review effort: Balanced

Base automatically changed from cjen1-msft-expert-dollop to main November 13, 2026 18:02
Real nodes trace ticks between becoming leader and the asynchronous
genesis transaction, then flush the large genesis entry. Bootstrap now
accepts bare ticks before genesis, unobserved, and an optional flush,
which must send nothing because no bootstrap action claims a send.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cjen1-msft
cjen1-msft force-pushed the cjen1-msft-scaling-tribble branch from 34187c0 to abd4907 Compare November 13, 2026 18:02

This branch has not been deployed

No deployments
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.

3 participants