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

Inductive invariant validation. #6

Merged
merged 24 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
48316b6
Inductive invariant validation with Apalache.
lemmy Aug 19, 2024
decd45d
Build main/HEAD of Apalache until new official Apalache builds are av…
lemmy Aug 19, 2024
b2108a4
Remove bogus `www.` from url that causes a https cert error.
lemmy Aug 19, 2024
01486bb
Consume newest Apalache release.
lemmy Aug 19, 2024
b2bba8f
Install TLC nightly build to consume https://github.com/tlaplus/tlapl…
lemmy Aug 19, 2024
b295f93
Switch to TLC's `generate` mode to prevent it from generating an acti…
lemmy Aug 19, 2024
a916aa4
Leave note why Tstamp and Views have to be redefined to be finite sets.
lemmy Sep 2, 2024
6d6ca6e
Remove unused ConstInit.
lemmy Sep 2, 2024
fda5046
TLAPM does not (yet) support bound tuples (https://github.com/tlaplus…
lemmy Sep 2, 2024
a323287
Ignore TLAPS fingerprint cache.
lemmy Sep 3, 2024
61e7b5e
Rewrite TypeOK into monstrous universal quantification that avoids co…
lemmy Sep 3, 2024
9a16ecb
Decrease number of generates values to prevent Apalache from exceedin…
lemmy Sep 3, 2024
f3f979e
mlogs is defined for all replicas (outside of TLA+, one would call it…
lemmy Sep 3, 2024
b7b4f4e
Remove incomplete leftover.
lemmy Sep 3, 2024
da5a4d5
Partial inductive invariant checking with Apalache.
lemmy Sep 3, 2024
779347b
Push Apalache!Gen into dedicated .tla file to prevent TLC from failin…
lemmy Sep 3, 2024
1c244a0
No surprise that SafetyInv is violated if *all* nodes are Byzantine.
lemmy Sep 3, 2024
cefe95f
Assume that the number of byzantine replicas is less than what the pr…
lemmy Sep 4, 2024
eb1d4f3
Generate, simulate, validate, and verify with TLC and Apalache.
lemmy Sep 4, 2024
1c1c3a0
Mitigate state-space explosion of two byzantine actions to prevent TL…
lemmy Sep 4, 2024
3f99960
Do not parse *all* specs because Apalache module is not there.
lemmy Sep 4, 2024
bfe1c8a
Finish in reasonable time of approx 10 minutes.
lemmy Sep 4, 2024
9477c9f
Bug: Range over constant SeqNums instead of Views.
lemmy Sep 5, 2024
a6c7b96
Simulation starting at GenInit predicate with Apalache.
lemmy Sep 5, 2024
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
13 changes: 13 additions & 0 deletions APApbft.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SPECIFICATION SpecByz

CONSTANTS
R <- MC_R
ByzR <- MC_ByzR
Tstamps <- MC_Tstamps
Views <- MC_Views
Checkpoints <- MC_Checkpoints

INVARIANTS
TypeOK
SafetyInv
CommittedInv
2 changes: 1 addition & 1 deletion APApbft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MC_R == 0..3

\* Set of requests which are byzantine
\* @type: Set(Int);
MC_ByzR == {}
MC_ByzR == MC_R

MC_Tstamps == 1..3

Expand Down
1 change: 1 addition & 0 deletions MCpbft.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SPECIFICATION SpecByz
CONSTANT
\* Init <- MCInit
ViewChange <- MCViewChange
GenerateO <- MC_GenerateO

CONSTANTS
R <- MC_R
Expand Down
15 changes: 15 additions & 0 deletions MCpbft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,19 @@ MCInit ==
\/ RInit
/\ Inv

-------

\* This is Heidi's definition of GenerateO moved out of pbft. However, Apalache
\* does not support (mins+1)..maxs when mins and maxs are non-constant.
\* Moreover, Apalache does not support re-defining this non-zero arity operator,
\* which is why the more complex definition is now in pbft and the simpler one
\* below.
\* @type: (Set ($viewchangeMsgs), Int, Int) => Set ($preprepareMsgs);
MC_GenerateO(V,i,v) ==
LET mins == Max0(UNION {{cp.n: cp \in vcm.c}: vcm \in V})
ppms == UNION {{pp.preprepare: pp \in vcm.p}: vcm \in V}
maxs == Max0({ppm.n: ppm \in ppms}) IN
{[v |-> v, p |-> i, n |-> sn, d |-> GetDigest(ppms,sn)] : sn \in (mins+1)..maxs}


=====
7 changes: 5 additions & 2 deletions pbft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,11 @@ GetDigest(ppms, sn) ==
GenerateO(V,i,v) ==
LET mins == Max0(UNION {{cp.n: cp \in vcm.c}: vcm \in V})
ppms == UNION {{pp.preprepare: pp \in vcm.p}: vcm \in V}
maxs == Max0({ppm.n: ppm \in ppms}) IN
{[v |-> v, p |-> i, n |-> sn, d |-> GetDigest(ppms,sn)] : sn \in (mins+1)..maxs}
maxs == Max0({ppm.n: ppm \in ppms})
\* Apalache does not yet support integer ranges with non-constant bounds:
\* https://github.com/apalache-mc/apalache/blob/main/docs/src/apalache/known-issues.md#integer-ranges-with-non-constant-bounds
apa == { j \in Views : mins+1 <= j /\ j <= maxs} IN
lemmy marked this conversation as resolved.
Show resolved Hide resolved
{[v |-> v, p |-> i, n |-> sn, d |-> GetDigest(ppms,sn)] : sn \in apa }

\* Castro & Liskov S4.4:
\* When the primary p of view v+1 receives 2f valid view-change messages for view v+1 from other replicas, it multicasts a (NEW-VIEW,v+1,V,O) message to all other replicas, where V is a set containing the valid view-change messages received by the primary plus the view-change message for v+1 the primary sent (or would have sent), and is a set of pre-prepare messages (without the piggybacked request).
Expand Down
Loading