Skip to content

Commit 30d6dcc

Browse files
committed
introduce bug
1 parent 73cdb16 commit 30d6dcc

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

simulator/src/main/java/byzzbench/simulator/protocols/tendermint/TendermintReplica.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,13 @@ private boolean fulfillProposalRule3(ProposalMessage proposalMessage) {
180180
boolean proposalExists = messageLog.getProposals().getOrDefault(proposalMessage.getBlock(), new ArrayList<>()).stream()
181181
.filter(proposal -> proposal.getHeight() == height)
182182
.filter(proposal -> proposal.getRound() == proposalMessage.getRound())
183-
.filter(proposal -> proposal.getRound() == this.round)
184183
.filter(proposal -> proposal.getReplicaId().equals(proposer(height, proposalMessage.getRound())))
185184
.count() >= 1;
186185

187186
// AND 2f + 1 ⟨PRECOMMIT, hp, r, id(v)⟩
188187
boolean enoughPrecommits = messageLog.getPrecommits().getOrDefault(proposalMessage.getBlock(), new ArrayList<>()).stream()
189188
.filter(precommit -> precommit.getHeight() == height)
190189
.filter(precommit -> precommit.getRound() == proposalMessage.getRound())
191-
.filter(precommit -> precommit.getRound() == this.round)
192190
.count() >= 2 * tolerance + 1;
193191

194192
// while decisionp[hp] = nil
@@ -538,13 +536,11 @@ protected void handlePrecommit(PrecommitMessage precommitMessage) {
538536
private boolean fulfillProposalPrecommitRule(PrecommitMessage precommitMessage) {
539537
boolean enoughPrecommits = messageLog.getPrecommits().getOrDefault(precommitMessage.getBlock(), new ArrayList<>()).stream()
540538
.filter(precommit -> precommit.getHeight() == this.height)
541-
.filter(precommit -> precommit.getRound() == this.round)
542539
.count() >= 2 * tolerance + 1;
543540

544541
boolean proposalExists = messageLog.getProposals().getOrDefault(precommitMessage.getBlock(), new ArrayList<>()).stream()
545542
.filter(proposal -> proposal.getHeight() == this.getHeight())
546543
.filter(proposal -> proposal.getRound() == precommitMessage.getRound())
547-
.filter(proposal -> proposal.getRound() == this.round)
548544
.filter(proposal -> proposal.getReplicaId().equals(proposer(precommitMessage.getHeight(), precommitMessage.getRound())))
549545
.count() >= 1;
550546

@@ -650,15 +646,8 @@ protected boolean validateMessage(MessagePayload message) {
650646

651647
// Check that the message height matches the current height
652648
if (message instanceof GenericMessage) {
653-
if (((GenericMessage) message).getHeight() < height || ((GenericMessage) message).getRound() < round) {
654-
log.warning("Message height or round mismatch: " + ((GenericMessage) message).getHeight());
655-
return true;
656-
}
657-
if (((GenericMessage) message).getAuthor().equals(this.getId())) {
658-
if (message instanceof ProposalMessage ) {
659-
log.warning("Can accept proposals from itself: " + ((GenericMessage) message).getRound());
660-
return false;
661-
}
649+
if (((GenericMessage) message).getHeight() < height) {
650+
log.warning("Message height mismatch: " + ((GenericMessage) message).getHeight());
662651
return true;
663652
}
664653
}

simulator/src/main/resources/application.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ byzzbench:
3333
mutateMessageWeight: 50 # The weight for scheduler to mutate a message
3434
params: # additional parameters for the scheduler
3535
# ByzzFuzz
36-
numRoundsWithProcessFaults: 3
37-
numRoundsWithNetworkFaults: 4
36+
numRoundsWithProcessFaults: 2
37+
numRoundsWithNetworkFaults: 2
3838
numRoundsWithFaults: 3
3939
# Twins
4040
numReplicas: 2

0 commit comments

Comments
 (0)