Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and enforce specification invariant CommittableIndicesAreKnownSignaturesInv #5764

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tla/consensus/SIMccfraft.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ INVARIANTS

CommitCommittableIndices

CommittableIndicesAreKnownSignaturesInv

\* DebugInvLeaderCannotStepDown
\* DebugInvAnyCommitted
\* DebugInvAllCommitted
Expand Down
13 changes: 12 additions & 1 deletion tla/consensus/ccfraft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,12 @@ NoConflictAppendEntriesRequest(i, j, m) ==
Max({c \in DOMAIN new_configs : c <= new_commit_index})
IN
/\ commitIndex' = [commitIndex EXCEPT ![i] = new_commit_index]
/\ committableIndices' = [ committableIndices EXCEPT ![i] = (@ \cup Len(log[i])..Len(log'[i])) \ 0..commitIndex'[i]]
\* see committable_indices.push_back(i) in raft.h:execute_append_entries_sync, guarded by case PASS_SIGNATURE
/\ committableIndices' =
[ committableIndices EXCEPT ![i] =
(@ \cup
{n \in Len(log[i])..Len(log'[i]) \ {0} : log'[i][n].contentType = TypeSignature})
\ 0..commitIndex'[i]]
/\ configurations' =
[configurations EXCEPT ![i] = RestrictDomain(new_configs, LAMBDA c : c >= new_conf_index)]
\* If we added a new configuration that we are in and were pending, we are now follower
Expand Down Expand Up @@ -1295,6 +1300,12 @@ CommitCommittableIndices ==
\A i \in Servers :
committableIndices[i] # {} => commitIndex[i] < Min(committableIndices[i])

CommittableIndicesAreKnownSignaturesInv ==
\A i \in Servers :
\A j \in committableIndices[i] :
/\ j \in DOMAIN(log[i])
/\ HasTypeSignature(log[i][j])

------------------------------------------------------------------------------
\* Properties

Expand Down
Loading