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

Refactor the Quint specification after #144 #146

Merged
merged 20 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
- name: Install node
uses: actions/setup-node@v4
with:
node-version: ">= 18"
node-version: 20
check-latest: true

- name: Install quint
run: npm i @informalsystems/quint -g
run: npm i @informalsystems/quint@0.21.0 -g

- name: Run test
run: cd spec && make test
3 changes: 2 additions & 1 deletion spec/protocol-spec/experiments/n6f1b0.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// -*- mode: Bluespec; -*-
// A specification instance for n=6, f=1, and no Byzantine faults
module n6f1b0 {
import replica(
Expand All @@ -11,4 +12,4 @@ module n6f1b0 {
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
).* from "../replica"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// -*- mode: Bluespec; -*-
// A specification instance for n=6, f=1, and 1 Byzantine fault
//
// Due to import/export limitations of Quint, use the definitions starting with g_:
Expand Down Expand Up @@ -38,4 +39,4 @@ module n6f1b1_two_blocks {

]
).* from "../guided_replica"
}
}
3 changes: 2 additions & 1 deletion spec/protocol-spec/experiments/n6f1b1.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// -*- mode: Bluespec; -*-
// A specification instance for n=6, f=1, and 1 Byzantine fault
module n6f1b1 {
import replica(
Expand All @@ -11,4 +12,4 @@ module n6f1b1 {
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
).* from "../replica"
}
}
4 changes: 3 additions & 1 deletion spec/protocol-spec/experiments/n6f1b1_guided_dead_lock.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and 1 Byzantine fault
//
/// Test a liveness issue where some validators have the HighQC but don't have the block payload and have to wait for it,
Expand Down Expand Up @@ -42,4 +44,4 @@ module n6f1b1_two_blocks {
OnProposalStep("n1"), OnProposalStep("n2"), OnProposalStep("n3"), OnProposalStep("n4"), OnProposalStep("n5"),
]
).* from "../guided_replica"
}
}
4 changes: 3 additions & 1 deletion spec/protocol-spec/experiments/n6f1b1_guided_two_blocks.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and 1 Byzantine fault
//
// Due to import/export limitations of Quint, use the definitions starting with g_:
Expand Down Expand Up @@ -29,4 +31,4 @@ module n6f1b1_two_blocks {
OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"),
]
).* from "../guided_replica"
}
}
4 changes: 3 additions & 1 deletion spec/protocol-spec/experiments/n6f1b2.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and 2 Byzantine faults
module n6f1b2 {
import replica(
Expand All @@ -11,4 +13,4 @@ module n6f1b2 {
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
).* from "../replica"
}
}
4 changes: 3 additions & 1 deletion spec/protocol-spec/experiments/n6f1b2_boxed.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and 2 Byzantine faults.
// We box the number of different steps.
module n6f1b2_boxed {
Expand Down Expand Up @@ -137,4 +139,4 @@ module n6f1b2_boxed {
}
}
}
}
}
4 changes: 3 additions & 1 deletion spec/protocol-spec/experiments/n6f1b2_guided_agreement.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and 2 Byzantine faults
//
// Due to import/export limitations of Quint, use the definitions starting with g_:
Expand Down Expand Up @@ -32,4 +34,4 @@ module n6f1b2_agreement {
OnCommitStep("n3"), OnCommitStep("n3"), OnCommitStep("n3"), OnCommitStep("n3"), OnCommitStep("n3"),
]
).* from "../guided_replica"
}
}
4 changes: 3 additions & 1 deletion spec/protocol-spec/experiments/n6f1b3.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and 3 Byzantine faults
module n6f1b0 {
import replica(
Expand All @@ -11,4 +13,4 @@ module n6f1b0 {
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
).* from "../replica"
}
}
6 changes: 4 additions & 2 deletions spec/protocol-spec/experiments/n7f1b0.qnt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and no Byzantine faults
module n7f1b0 {
import replica(
CORRECT = Set("n0", "n1", "n2", "n3", "n4", "n5", "n5"),
CORRECT = Set("n0", "n1", "n2", "n3", "n4", "n5", "n6"),
FAULTY = Set(),
WEIGHTS = Map("n0"->1, "n1"->1, "n2"->1, "n3"->1, "n4"->1, "n5"->1, "n6"->1),
REPLICA_KEYS = Map("n0"->"n0", "n1"->"n1", "n2"->"n2", "n3"->"n3", "n4"->"n4", "n5"->"n5", "n6"->"n6"),
Expand All @@ -11,4 +13,4 @@ module n7f1b0 {
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
).* from "../replica"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=7, f=1, and 0 byzantine nodes.
//
// Due to import/export limitations of Quint, use the definitions starting with g_:
Expand Down Expand Up @@ -63,4 +65,4 @@ module n6f1b1_two_blocks {
OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"), OnCommitStep("n0"),
]
).* from "../guided_replica"
}
}
16 changes: 16 additions & 0 deletions spec/protocol-spec/experiments/n7f1b1.qnt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// -*- mode: Bluespec; -*-
//
// A specification instance for n=6, f=1, and no Byzantine faults
module n7f1b1 {
import replica(
CORRECT = Set("n0", "n1", "n2", "n3", "n4", "n5"),
FAULTY = Set("n6"),
WEIGHTS = Map("n0"->1, "n1"->1, "n2"->1, "n3"->1, "n4"->1, "n5"->1, "n6"->1),
REPLICA_KEYS = Map("n0"->"n0", "n1"->"n1", "n2"->"n2", "n3"->"n3", "n4"->"n4", "n5"->"n5", "n6"->"n6"),
N = 7,
F = 1,
VIEWS = 0.to(3),
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
).* from "../replica"
}
3 changes: 2 additions & 1 deletion spec/protocol-spec/guided_replica.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// -*- mode: Bluespec; -*-
// A restriction of replica.qnt to guide the model checker's search
module guided_replica {
import types.* from "./types"
Expand Down Expand Up @@ -139,4 +140,4 @@ module guided_replica {
}
}
}
}
}
3 changes: 2 additions & 1 deletion spec/protocol-spec/main.qnt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// -*- mode: Bluespec; -*-
/// A few handy small models that are good for debugging and inspection
module main {
// A specification instance for n=6, f=1, and 1 Byzantine fault
Expand All @@ -12,4 +13,4 @@ module main {
VALID_BLOCKS = Set("val_b0", "val_b1"),
INVALID_BLOCKS = Set("inv_b3")
) .* from "./replica"
}
}
5 changes: 3 additions & 2 deletions spec/protocol-spec/option.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ module option {
}
}

// if is Some(e), test whether `pred(e)` holds true
// If is Some(e), test whether `pred(e)` holds true.
// If None, return false.
def option_has(opt: Option[a], pred: a => bool): bool = {
match (opt) {
| None => true
| None => false
| Some(e) => pred(e)
}
}
Expand Down
Loading
Loading