Search in sources :

Example 1 with IncorrectAlwaysAcceptingAccumulatorVerifierModule

use of com.radixdlt.ledger.IncorrectAlwaysAcceptingAccumulatorVerifierModule in project radixdlt by radixdlt.

the class ByzantineSyncTest method given_a_sometimes_byzantine_sync_layer_with_incorrect_accumulator_verifier__sanity_tests_should_not_pass.

@Test
public void given_a_sometimes_byzantine_sync_layer_with_incorrect_accumulator_verifier__sanity_tests_should_not_pass() {
    SimulationTest simulationTest = bftTestBuilder.addOverrideModuleToAllInitialNodes(new IncorrectAlwaysAcceptingAccumulatorVerifierModule()).build();
    final var runningTest = simulationTest.run();
    final var checkResults = runningTest.awaitCompletion();
    LongSummaryStatistics statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> s.get(CounterType.SYNC_VALID_RESPONSES_RECEIVED)).mapToLong(l -> l).summaryStatistics();
    logger.info("{}", statistics);
    assertThat(checkResults).hasEntrySatisfying(Monitor.LEDGER_IN_ORDER, error -> assertThat(error).isPresent());
}
Also used : LongSummaryStatistics(java.util.LongSummaryStatistics) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) IncorrectAlwaysAcceptingAccumulatorVerifierModule(com.radixdlt.ledger.IncorrectAlwaysAcceptingAccumulatorVerifierModule) NetworkDroppers(com.radixdlt.harness.simulation.NetworkDroppers) ConsensusMonitors(com.radixdlt.harness.simulation.monitors.consensus.ConsensusMonitors) SometimesByzantineCommittedReader(com.radixdlt.sync.SometimesByzantineCommittedReader) LongSummaryStatistics(java.util.LongSummaryStatistics) Monitor(com.radixdlt.harness.simulation.Monitor) ProvidesIntoSet(com.google.inject.multibindings.ProvidesIntoSet) EventProcessorOnDispatch(com.radixdlt.environment.EventProcessorOnDispatch) NetworkOrdering(com.radixdlt.harness.simulation.NetworkOrdering) Test(org.junit.Test) Scopes(com.google.inject.Scopes) SimulationTest(com.radixdlt.harness.simulation.SimulationTest) LedgerUpdate(com.radixdlt.ledger.LedgerUpdate) TimeUnit(java.util.concurrent.TimeUnit) Builder(com.radixdlt.harness.simulation.SimulationTest.Builder) NetworkLatencies(com.radixdlt.harness.simulation.NetworkLatencies) Logger(org.apache.logging.log4j.Logger) CommittedReader(com.radixdlt.sync.CommittedReader) SyncConfig(com.radixdlt.sync.SyncConfig) LedgerMonitors(com.radixdlt.harness.simulation.monitors.ledger.LedgerMonitors) CounterType(com.radixdlt.counters.SystemCounters.CounterType) LogManager(org.apache.logging.log4j.LogManager) AbstractModule(com.google.inject.AbstractModule) Singleton(com.google.inject.Singleton) SimulationTest(com.radixdlt.harness.simulation.SimulationTest) IncorrectAlwaysAcceptingAccumulatorVerifierModule(com.radixdlt.ledger.IncorrectAlwaysAcceptingAccumulatorVerifierModule) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Aggregations

AbstractModule (com.google.inject.AbstractModule)1 Scopes (com.google.inject.Scopes)1 Singleton (com.google.inject.Singleton)1 ProvidesIntoSet (com.google.inject.multibindings.ProvidesIntoSet)1 CounterType (com.radixdlt.counters.SystemCounters.CounterType)1 EventProcessorOnDispatch (com.radixdlt.environment.EventProcessorOnDispatch)1 Monitor (com.radixdlt.harness.simulation.Monitor)1 NetworkDroppers (com.radixdlt.harness.simulation.NetworkDroppers)1 NetworkLatencies (com.radixdlt.harness.simulation.NetworkLatencies)1 NetworkOrdering (com.radixdlt.harness.simulation.NetworkOrdering)1 SimulationTest (com.radixdlt.harness.simulation.SimulationTest)1 Builder (com.radixdlt.harness.simulation.SimulationTest.Builder)1 ConsensusMonitors (com.radixdlt.harness.simulation.monitors.consensus.ConsensusMonitors)1 LedgerMonitors (com.radixdlt.harness.simulation.monitors.ledger.LedgerMonitors)1 IncorrectAlwaysAcceptingAccumulatorVerifierModule (com.radixdlt.ledger.IncorrectAlwaysAcceptingAccumulatorVerifierModule)1 LedgerUpdate (com.radixdlt.ledger.LedgerUpdate)1 CommittedReader (com.radixdlt.sync.CommittedReader)1 SometimesByzantineCommittedReader (com.radixdlt.sync.SometimesByzantineCommittedReader)1 SyncConfig (com.radixdlt.sync.SyncConfig)1 LongSummaryStatistics (java.util.LongSummaryStatistics)1