Skip to content

Commit 81fba32

Browse files
committed
Transport: assert sender is faulty when mutating message
1 parent 9ea27b7 commit 81fba32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

simulator/src/main/java/byzzbench/simulator/transport/Transport.java

+7
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ public synchronized void applyMutation(long eventId, Fault fault) {
334334
"Event %d is not a message - cannot mutate it.", eventId));
335335
}
336336

337+
// check if sender is faulty
338+
if (!this.scenario.isFaultyReplica(m.getSenderId())) {
339+
throw new IllegalArgumentException(
340+
String.format("Cannot mutate message: sender %s is not marked as faulty", m.getSenderId())
341+
);
342+
}
343+
337344
// create input for the fault
338345
FaultContext input = new FaultContext(this.scenario, e);
339346

0 commit comments

Comments
 (0)