Repository navigation
Check applied entries and snapshots against the consensus trace - #8925
Draft
cjen1-msft wants to merge 2 commits into
Draft
cjen1-msft wants to merge 2 commits into
cjen1-msft wants to merge 2 commits into
Conversation
…s trace execute_append_entries_sync records the view, seqno and signature flag of its entry, and so is traced once the entry has applied. init_as_backup records the snapshot's term history. The model driver emits the same. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replay requires a delivered AppendEntries to carry the entries its receiver traced applying, and the model to apply exactly those. A joiner initializes from a committed prefix which agrees with its snapshot's term history and hooks. Transactions are named by seqno, so that every node names an entry alike. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two
ccf.cfttrace events record more of what a node did, and the consensus trace replayer uses them to constrain what a node receives and how it starts.execute_append_entries_syncgains the view (vw), seqno (sn) and signature flag (gc) of its entry. Replay requires the delivered AppendEntries to carry the entries its receiver traced applying, with the configuration and retirements of their ledger hooks, and the model to apply exactly those.init_as_backupgains the snapshot's term history (th, the first seqno of each view). Replay requires the committed prefix a joiner starts from to agree with it, and with the snapshot's hooks.Before, a packet's entries were delivered unchecked, as a packet header omits them, and a joiner copied any committed prefix with a signature at the snapshot's seqno and view.
The model driver (
tests/cft_model/ModelDriver.lean) emits the same fields, as its trace must be that of the implementation. This is the bottom of a stack: per-node validation (#8916) builds on it.For reviewers
missing key 'th').execute_append_entries_syncmoves belowapply, because the signature flag is only known once the entry has applied. It is still traced beforestate->last_idx = iand the hooks. An entry which fails to apply no longer traces it.add_configurationat its seqno with the nodes in force, and the retirements still in the nodes table. So the check is on the latest configuration of the prefix, and that the traced retirements are among those of the prefix, not on each entry's metadata. Terms are compared entry by entry.execute_append_entries_syncof their entry, as a leader's followreplicate_entry.Testing
e2e_logging,governance_test,code_update_test,reconfiguration_test_suite) are accepted bytests/cft_trace_validation.py, each with watermark 1. They include 21 joins from real snapshots, in views 2 and 3.valid/replication.ndjsononly in fields the replayer did not read before: a follower applying another signature flag or configuration than was sent, and a joiner whose term history or hook configuration disagrees with its donor, or whose term history starts a view after the snapshot.ReplayDelivery.leancovers selection by applied entry, an entry which was not sent, and an entry the model applies which the node did not trace.retired_committed_txhook, so the retirement check ran only with none traced.Commands
Fixtures: 5 valid accepted, 20 invalid rejected with exit 1, each for its documented reason.