-
Notifications
You must be signed in to change notification settings - Fork 12
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
First quint draft that is somewhat complete with consensus, executor, voteKeeper #40
Merged
Merged
Changes from 73 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
6731e80
executor start
josef-widder ad3f85f
PreCommit function
josef-widder 31505ee
TODOs
josef-widder f0b2915
line 28 is in the books
josef-widder e106f7d
prevote, precommit, and timeout done. proposal missing
josef-widder c7190d2
starting to put things together for state machine
josef-widder a210f05
a somewhat complete version of the executor logic
josef-widder e7427b6
state machine, but needs to be debugged
josef-widder ba7dcdb
moving statemachine. problem with chooseSome
josef-widder 8d0f6c6
it moves
josef-widder 11f50ed
more things moving
josef-widder 17e7584
some problem with bookkeeper
josef-widder 0604c38
more things move
josef-widder 369590f
I have seen a Polka
josef-widder 366324b
cleanup
josef-widder 74ab8b4
cleaning
josef-widder 7a638d3
successful test of statemachine
josef-widder 2a0afc3
before consensus return refactor
josef-widder a3cb547
first pending event added
josef-widder ae8fc80
cleaned consensus
josef-widder 4ea7f1b
commit to merge with Manuel's updated votekeeper
josef-widder ef3afa0
to merge Daniel's comment
josef-widder c06cb80
executor start
josef-widder 50a9865
PreCommit function
josef-widder 1bebf51
TODOs
josef-widder fe9f80b
line 28 is in the books
josef-widder 4fc5086
prevote, precommit, and timeout done. proposal missing
josef-widder 33254b3
starting to put things together for state machine
josef-widder bd0f9d9
a somewhat complete version of the executor logic
josef-widder 53d33ae
state machine, but needs to be debugged
josef-widder 990dbab
moving statemachine. problem with chooseSome
josef-widder af85baa
it moves
josef-widder c4eb53f
more things moving
josef-widder f4baf60
some problem with bookkeeper
josef-widder 6499b75
more things move
josef-widder ebbdcfa
I have seen a Polka
josef-widder 86303d2
cleanup
josef-widder e9d18dd
cleaning
josef-widder 074650b
successful test of statemachine
josef-widder 4a6dc1f
before consensus return refactor
josef-widder b7ce6f3
first pending event added
josef-widder 3fed023
cleaned consensus
josef-widder 9e6f28a
commit to merge with Manuel's updated votekeeper
josef-widder a1864f9
to merge Daniel's comment
josef-widder e674e2a
Merge branch 'josef/executor' of github.com:informalsystems/malachite…
josef-widder db5ee24
addressed Daniel's comments
josef-widder 57fd87a
addressed Daniel's comments and run tests
josef-widder a82a5a3
completed the timeout test
josef-widder 40564d1
clean up and comments
josef-widder 80a6de0
added checks for increasing round numbers
josef-widder 2dfc4be
added hash function checks
josef-widder 140ea02
valset error thrown in test fixed
josef-widder 56c82dd
added action and logic to get value from the outside into the system
josef-widder 183a321
comments following the discussion on where to put the reponsibility f…
josef-widder f66d6a4
transformed that executed events into list
josef-widder 77b994f
added an asynchronous execution environment
josef-widder fb1acda
added round number checks to ProposalMsg
josef-widder a7e21fd
test for disagreement in asynchronous setting
josef-widder 22507b9
Parameterization of the Asynchronous model
josef-widder e82759a
Typecheck all Quint specs on CI and run test for `consensustest.qnt`
romac 97086de
Update Specs/Quint/AsyncModels.qnt
josef-widder ead6a3c
added a type invariant
josef-widder 76218ca
Merge branch 'josef/executor' of github.com:informalsystems/malachite…
josef-widder d02f187
updated syntax to Quint 0.14.4
josef-widder f397501
Merge branch 'main' into josef/executor
josef-widder 9fad761
moved bookkeeper statemachine out for modularity
josef-widder 44278fb
Update Quint test job
romac 25133f8
commented a line that failed a test. Need to discuss with Manu
josef-widder d5456cd
Merge branch 'josef/executor' of github.com:informalsystems/malachite…
josef-widder 5009cd8
Run test on all Quint files
romac f169987
Use script to run all tests even in the presence of failures
romac 8f62980
fixed the logic and the test for Precommit,Nil
josef-widder 3bb23b5
Merge branch 'josef/executor' of github.com:informalsystems/malachite…
josef-widder 37d4edd
Update Specs/Quint/voteBookkeeperTest.qnt
josef-widder 7e4b8e8
rename files for test CI
josef-widder e26c2f9
Update .github/workflows/quint.yml
josef-widder 8d39beb
Merge branch 'josef/executor' of github.com:informalsystems/malachite…
josef-widder c7cec44
renamed one more file with a test
josef-widder 5991bba
module renamed
josef-widder 3945567
start with a test where a process enters round 1 and messages are alr…
josef-widder 15f4a26
added todos
josef-widder 31c2c1f
Merge branch 'main' into josef/executor
josef-widder 98b5c4a
Pass over the votekeeper spec (#69)
hvanz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/env bash | ||
|
||
BLUE=$(tput setaf 4) | ||
RED=$(tput setaf 1) | ||
RESET=$(tput sgr0) | ||
UNDERLINE=$(tput smul) | ||
|
||
# [INFO] message in blue | ||
info() | ||
{ | ||
echo "${BLUE}[INFO] $*${RESET}" | ||
} | ||
|
||
# [ERROR] message in red | ||
error() | ||
{ | ||
echo "${RED}[ERROR] $*${RESET} " | ||
} | ||
|
||
# Run `quint $command` on all given files. | ||
|
||
cmd="$1" | ||
files=("${@:2}") | ||
|
||
if [[ "${#files[@]}" -eq 0 ]]; then | ||
echo "${UNDERLINE}Usage:${RESET} $0 <command> <file> [<file> ...]" | ||
exit 1 | ||
fi | ||
|
||
failed=0 | ||
failed_files=() | ||
|
||
for file in "${files[@]}"; do | ||
info "Running: quint $cmd ${UNDERLINE}$file" | ||
if ! npx @informalsystems/quint "$cmd" "$file"; then | ||
failed_files+=("$file") | ||
failed=$((failed + 1)) | ||
fi | ||
echo "" | ||
done | ||
|
||
if [[ "$failed" -gt 0 ]]; then | ||
error "Failed on $failed files:" | ||
for file in "${failed_files[@]}"; do | ||
error " - ${UNDERLINE}$file" | ||
done | ||
exit 1 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// -*- mode: Bluespec; -*- | ||
|
||
module AsyncModels { | ||
josef-widder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import statemachineAsync( | ||
validators = Set("v1", "v2", "v3", "v4"), | ||
validatorSet = Set("v1", "v2", "v3", "v4").mapBy(x => 1), | ||
Faulty = Set("v1"), | ||
Values = Set("a", "b"), | ||
Rounds = Set(0, 1, 2, 3), | ||
Heights = Set(0) // , 1, 2, 3) | ||
) as N4F1 from "./statemachineAsync" | ||
|
||
// quint run --init=N4F1::init --step=N4F1::step --invariant=N4F1::AgreementInv AsyncModels.qnt | ||
// quint run --init=N4F1::init --step=N4F1::step --invariant=N4F1::ConsensusOutputInv AsyncModels.qnt | ||
|
||
import statemachineAsync( | ||
validators = Set("v1", "v2", "v3", "v4"), | ||
validatorSet = Set("v1", "v2", "v3", "v4").mapBy(x => 1), | ||
Faulty = Set("v1", "v2"), | ||
Values = Set("a", "b"), | ||
Rounds = Set(0), // , 1, 2, 3) | ||
Heights = Set(0) // , 1, 2, 3) | ||
) as N4F2 from "./statemachineAsync" | ||
|
||
// v3 and v4 are correct. v2 is a N4N4F22aulty proposal and proposes diN4N4F22N4N4F22erently to v3 and v4 | ||
// this run leads to disagreement | ||
run DisagreementTest = { | ||
N4F2::init | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v4")) | ||
.then(N4F2::deliverProposal("v3", { height: 0, proposal: "b", round: 0, src: "v2", validRound: -1 })) | ||
.then(N4F2::deliverProposal("v4", { height: 0, proposal: "a", round: 0, src: "v2", validRound: -1 })) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v4")) | ||
.then(all{ | ||
// they voted diN4F2N4F2erently | ||
assert(N4F2::voteBuffer == Map( | ||
"v3" -> Set({ height: 0, id: "a", round: 0, src: "v4", step: "Prevote" }, | ||
{ height: 0, id: "b", round: 0, src: "v3", step: "Prevote" }), | ||
"v4" -> Set({ height: 0, id: "a", round: 0, src: "v4", step: "Prevote" }, | ||
{ height: 0, id: "b", round: 0, src: "v3", step: "Prevote" }))), | ||
N4F2::deliverVote("v4", { height: 0, id: "a", round: 0, src: "v1", step: "Prevote" }) | ||
}) | ||
.then(N4F2::deliverVote("v4", { height: 0, id: "a", round: 0, src: "v2", step: "Prevote" })) | ||
.then(N4F2::deliverVote("v3", { height: 0, id: "b", round: 0, src: "v1", step: "Prevote" })) | ||
.then(N4F2::deliverVote("v3", { height: 0, id: "b", round: 0, src: "v2", step: "Prevote" })) | ||
.then(N4F2::deliverVote("v3", { height: 0, id: "b", round: 0, src: "v3", step: "Prevote" })) | ||
.then(N4F2::deliverVote("v4", { height: 0, id: "a", round: 0, src: "v4", step: "Prevote" })) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v4")) | ||
.then(N4F2::valStep("v4")) | ||
.then(N4F2::valStep("v4")) | ||
.then(all{ | ||
// they precommited diN4F2N4F2erently | ||
assert( N4F2::voteBuffer.get("v3").contains({ height: 0, id: "a", round: 0, src: "v4", step: "Precommit" }) and | ||
N4F2::voteBuffer.get("v4").contains({ height: 0, id: "b", round: 0, src: "v3", step: "Precommit" })), | ||
N4F2::deliverVote("v4", { height: 0, id: "a", round: 0, src: "v1", step: "Precommit" }) }) | ||
.then(N4F2::deliverVote("v4", { height: 0, id: "a", round: 0, src: "v2", step: "Precommit" })) | ||
.then(N4F2::deliverVote("v3", { height: 0, id: "b", round: 0, src: "v1", step: "Precommit" })) | ||
.then(N4F2::deliverVote("v3", { height: 0, id: "b", round: 0, src: "v2", step: "Precommit" })) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v4")) | ||
.then(N4F2::valStep("v4")) | ||
.then(all{ | ||
assert(N4F2::AgreementInv), | ||
N4F2::deliverVote("v4", { height: 0, id: "a", round: 0, src: "v4", step: "Precommit" }) }) | ||
.then(N4F2::deliverVote("v3", { height: 0, id: "b", round: 0, src: "v3", step: "Precommit" })) | ||
.then(N4F2::valStep("v3")) | ||
.then(N4F2::valStep("v4")) | ||
.then(all{ | ||
assert(not(N4F2::AgreementInv)), | ||
N4F2::unchangedAll}) | ||
} | ||
|
||
|
||
|
||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romac , CI is complaining about failed tests: I guess we shouldn't run "quint test" on
statemachineAsync.qnt
as it has someconst
, and quint complains about "Uninitialized const validator". Indeed,AsyncModels.qnt
importsstatemachineAsync.qnt
and gives values to theseconst
s. Not sure what is the best way to set it up here so that ignoresstatemachineAsync.qnt
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have change the line to only run test on
*Test.qnt
and renamed the files that contain tests.