use of com.radixdlt.harness.deterministic.DeterministicTest.DeterministicManualExecutor in project radixdlt by radixdlt.
the class DifferentTimestampsCauseTimeoutTest method when_four_nodes_receive_qcs_with_different_timestamps__quorum_is_not_achieved.
@Test
public void when_four_nodes_receive_qcs_with_different_timestamps__quorum_is_not_achieved() {
final int numNodes = 4;
// TODO: this test isn't exactly right and should be updated so that
// TODO: byzantine node sends different sets of valid QCs to each node
DeterministicManualExecutor executor = DeterministicTest.builder().overrideWithIncorrectModule(new AbstractModule() {
@Override
protected void configure() {
bind(HashVerifier.class).toInstance((pubKey, hash, sig) -> true);
bind(HashSigner.class).toInstance(h -> ECDSASignature.zeroSignature());
}
}).numNodes(numNodes).messageMutator(mutateProposalsBy(1)).buildWithoutEpochs().createExecutor();
executor.start();
executeTwoViews(executor);
// Timeouts from nodes
executor.processNext(0, 0, ScheduledLocalTimeout.class);
executor.processNext(1, 1, ScheduledLocalTimeout.class);
executor.processNext(2, 2, ScheduledLocalTimeout.class);
executor.processNext(3, 3, ScheduledLocalTimeout.class);
}
use of com.radixdlt.harness.deterministic.DeterministicTest.DeterministicManualExecutor in project radixdlt by radixdlt.
the class DifferentTimestampsCauseTimeoutTest method when_four_nodes_receive_qcs_with_same_timestamps__quorum_is_achieved.
@Test
public void when_four_nodes_receive_qcs_with_same_timestamps__quorum_is_achieved() {
final int numNodes = 4;
DeterministicManualExecutor executor = DeterministicTest.builder().numNodes(numNodes).messageMutator(mutateProposalsBy(0)).buildWithoutEpochs().createExecutor();
executor.start();
executeTwoViews(executor);
executor.processNext(3, 3, ViewUpdate.class);
executor.processNext(3, 3, Proposal.class);
executor.processNext(3, 3, BFTInsertUpdate.class);
executor.processNext(3, 0, Proposal.class);
executor.processNext(0, 0, ViewUpdate.class);
executor.processNext(0, 0, BFTInsertUpdate.class);
executor.processNext(3, 1, Proposal.class);
executor.processNext(1, 1, ViewUpdate.class);
executor.processNext(1, 1, BFTInsertUpdate.class);
executor.processNext(3, 2, Proposal.class);
executor.processNext(2, 2, ViewUpdate.class);
executor.processNext(2, 2, BFTInsertUpdate.class);
}
Aggregations