-
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.
- Loading branch information
1 parent
b71b527
commit d16f046
Showing
5 changed files
with
69 additions
and
264 deletions.
There are no files selected for viewing
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,45 @@ | ||
// -*- 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 | ||
}) | ||
} | ||
|
||
} | ||
|
||
|
||
} |
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,20 @@ | ||
// -*- mode: Bluespec; -*- | ||
|
||
module disagreementTest { | ||
|
||
import disagreementRun( | ||
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) | ||
groupA = Set("v3") | ||
) as N4F2 from "./disagreementRun" | ||
|
||
run disagreementTest = { | ||
N4F2::DisagreementRun | ||
} | ||
|
||
|
||
} |
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 |
---|---|---|
|
@@ -102,4 +102,6 @@ run RoundswitchRun = { | |
} | ||
|
||
|
||
|
||
|
||
} |
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 |
---|---|---|
|
@@ -28,4 +28,6 @@ run RoundswitchTest = { | |
N4F0::RoundswitchRun | ||
} | ||
|
||
|
||
|
||
} |