-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spec: Add multiplexing of events on step change (#104)
* Added handling around StepChange function * started with stepchange * firest version of step propose without test * re-did structure of StepChange * finished first complete version of StepChange (TODO: tests) * typo * paramTest fixed * fixed tests and DSL * start refactor asyncmodelstest * refactored tests from asyncModelsTest except disagreement * refactored old asyncModelTests * seems to fix changes to sum types * fixed line28test * commented big test. added todo
- Loading branch information
1 parent
265d3fe
commit 3005a28
Showing
11 changed files
with
399 additions
and
303 deletions.
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 was deleted.
Oops, something went wrong.
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,42 @@ | ||
// -*- mode: Bluespec; -*- | ||
|
||
module disagreementRun { | ||
|
||
import TendermintDSL.* from "./TendermintDSL" | ||
export TendermintDSL.* | ||
|
||
const groupA : Set[Address_t] | ||
val groupB = Correct.exclude(groupA) | ||
val aList = groupA.fold(List(), (s, x) => s.append(x)) | ||
val bList = groupB.fold(List(), (s, x) => s.append(x)) | ||
|
||
// A run for too many faulty nodes | ||
|
||
// TODO: assertions about proposer being faulty | ||
run DisagreementRun = { | ||
val thisProposer = Proposer (validatorSet, 0, 0) | ||
init | ||
.then(2.reps(_ => ListTakeAStep(correctList))) | ||
.then(ListDeliverProposal(aList, { height: 0, proposal: "a", round: 0, src: thisProposer, validRound: -1 })) | ||
.then(ListDeliverProposal(bList, { height: 0, proposal: "b", round: 0, src: thisProposer, validRound: -1 })) | ||
.then(ListTakeAStep(correctList)) | ||
// they voted differently | ||
.then(ListTakeAStep(correctList)) // consume step change | ||
.then(ListDeliverAllVotes("Prevote", aList.concat(faultyList), aList, validatorSet, 0, 0, "a")) | ||
.then(ListDeliverAllVotes("Prevote", bList.concat(faultyList), bList, validatorSet, 0, 0, "b")) | ||
.then(aList.concat(faultyList).length().reps(_ => ListTakeAStep(aList))) | ||
.then(bList.concat(faultyList).length().reps(_ => ListTakeAStep(bList))) | ||
.then(ListTakeAStep(correctList)) // timeout prevote started -> extra step to consume pending | ||
// they precommited differently | ||
.then(ListTakeAStep(correctList)) // consume step change | ||
.then(ListDeliverAllVotes("Precommit", aList.concat(faultyList), aList, validatorSet, 0, 0, "a")) | ||
.then(ListDeliverAllVotes("Precommit", bList.concat(faultyList), bList, validatorSet, 0, 0, "b")) | ||
.then(aList.concat(faultyList).length().reps(_ => ListTakeAStep(aList))) | ||
.then(bList.concat(faultyList).length().reps(_ => ListTakeAStep(bList))) | ||
.then(all{ | ||
assert(not(AgreementInv)), | ||
unchangedAll | ||
}) | ||
} | ||
|
||
} |
Oops, something went wrong.