Search in sources :

Example 1 with ValidatorApiChannel

use of tech.pegasys.teku.validator.api.ValidatorApiChannel in project teku by ConsenSys.

the class AttestationProductionDutyTest method shouldReportFailureWhenAttestationIsInvalid.

@Test
void shouldReportFailureWhenAttestationIsInvalid() {
    final int committeeIndex = 3;
    final int committeePosition = 6;
    final int committeeSize = 22;
    final Validator validator = createValidator();
    final AttestationData attestationData = expectCreateAttestationData(committeeIndex);
    final Attestation expectedAttestation = expectSignAttestation(validator, committeePosition, committeeSize, attestationData);
    when(validatorApiChannel.sendSignedAttestations(List.of(expectedAttestation))).thenReturn(SafeFuture.completedFuture(List.of(new SubmitDataError(UInt64.ZERO, "Naughty attestation"))));
    final SafeFuture<Optional<AttestationData>> attestationResult = duty.addValidator(validator, committeeIndex, committeePosition, 10, committeeSize);
    performAndReportDuty();
    assertThat(attestationResult).isCompletedWithValue(Optional.of(attestationData));
    verify(validatorApiChannel).sendSignedAttestations(List.of(expectedAttestation));
    verify(validatorLogger).dutyFailed(eq(TYPE), eq(SLOT), eq(Set.of(validator.getPublicKey().toAbbreviatedString())), argThat(error -> error instanceof RestApiReportedException && error.getMessage().equals("Naughty attestation")));
    verifyNoMoreInteractions(validatorLogger);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) AttestationSchema(tech.pegasys.teku.spec.datastructures.operations.Attestation.AttestationSchema) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SszBitlist(tech.pegasys.teku.infrastructure.ssz.collections.SszBitlist) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) SafeFuture.completedFuture(tech.pegasys.teku.infrastructure.async.SafeFuture.completedFuture) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) Signer(tech.pegasys.teku.core.signatures.Signer) ArgumentCaptor(org.mockito.ArgumentCaptor) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) ForkProvider(tech.pegasys.teku.validator.client.ForkProvider) BatchAttestationSendingStrategy(tech.pegasys.teku.validator.client.duties.attestations.BatchAttestationSendingStrategy) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) ForkInfo(tech.pegasys.teku.spec.datastructures.state.ForkInfo) SafeFuture.failedFuture(tech.pegasys.teku.infrastructure.async.SafeFuture.failedFuture) Spec(tech.pegasys.teku.spec.Spec) FileBackedGraffitiProvider(tech.pegasys.teku.validator.api.FileBackedGraffitiProvider) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) ValidatorLogger(tech.pegasys.teku.infrastructure.logging.ValidatorLogger) BLSSignature(tech.pegasys.teku.bls.BLSSignature) Set(java.util.Set) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) AttestationProductionDuty(tech.pegasys.teku.validator.client.duties.attestations.AttestationProductionDuty) List(java.util.List) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) ValidatorApiChannel(tech.pegasys.teku.validator.api.ValidatorApiChannel) DataStructureUtil(tech.pegasys.teku.spec.util.DataStructureUtil) Optional(java.util.Optional) Collections(java.util.Collections) SubmitDataError(tech.pegasys.teku.validator.api.SubmitDataError) Mockito.mock(org.mockito.Mockito.mock) Validator(tech.pegasys.teku.validator.client.Validator) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) Optional(java.util.Optional) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) SubmitDataError(tech.pegasys.teku.validator.api.SubmitDataError) Validator(tech.pegasys.teku.validator.client.Validator) Test(org.junit.jupiter.api.Test)

Example 2 with ValidatorApiChannel

use of tech.pegasys.teku.validator.api.ValidatorApiChannel in project teku by ConsenSys.

the class ValidatorClientService method initializeValidators.

private void initializeValidators(ValidatorClientConfiguration config, ValidatorApiChannel validatorApiChannel, AsyncRunner asyncRunner) {
    validatorLoader.loadValidators();
    final OwnedValidators validators = validatorLoader.getOwnedValidators();
    this.validatorIndexProvider = new ValidatorIndexProvider(validators, validatorApiChannel, asyncRunner);
    final BlockDutyFactory blockDutyFactory = new BlockDutyFactory(forkProvider, validatorApiChannel, spec);
    final AttestationDutyFactory attestationDutyFactory = new AttestationDutyFactory(spec, forkProvider, validatorApiChannel);
    final BeaconCommitteeSubscriptions beaconCommitteeSubscriptions = new BeaconCommitteeSubscriptions(validatorApiChannel);
    final DutyLoader<?> attestationDutyLoader = new RetryingDutyLoader<>(asyncRunner, new AttestationDutyLoader(validatorApiChannel, forkProvider, dependentRoot -> new SlotBasedScheduledDuties<>(attestationDutyFactory, dependentRoot), validators, validatorIndexProvider, beaconCommitteeSubscriptions, spec));
    final DutyLoader<?> blockDutyLoader = new RetryingDutyLoader<>(asyncRunner, new BlockProductionDutyLoader(validatorApiChannel, dependentRoot -> new SlotBasedScheduledDuties<>(blockDutyFactory, dependentRoot), validators, validatorIndexProvider));
    validatorTimingChannels.add(new BlockDutyScheduler(metricsSystem, blockDutyLoader, spec));
    validatorTimingChannels.add(new AttestationDutyScheduler(metricsSystem, attestationDutyLoader, spec));
    validatorTimingChannels.add(validatorLoader.getSlashingProtectionLogger());
    if (spec.isMilestoneSupported(SpecMilestone.ALTAIR)) {
        final ChainHeadTracker chainHeadTracker = new ChainHeadTracker();
        validatorTimingChannels.add(chainHeadTracker);
        final DutyLoader<SyncCommitteeScheduledDuties> syncCommitteeDutyLoader = new RetryingDutyLoader<>(asyncRunner, new SyncCommitteeDutyLoader(validators, validatorIndexProvider, spec, validatorApiChannel, chainHeadTracker, forkProvider));
        validatorTimingChannels.add(new SyncCommitteeScheduler(metricsSystem, spec, syncCommitteeDutyLoader, new Random()::nextInt));
    }
    if (spec.isMilestoneSupported(SpecMilestone.BELLATRIX)) {
        proposerConfigProvider = Optional.of(ProposerConfigProvider.create(asyncRunner, config.getValidatorConfig().getRefreshProposerConfigFromSource(), new ProposerConfigLoader(new JsonProvider().getObjectMapper()), config.getValidatorConfig().getProposerConfigSource()));
        validatorTimingChannels.add(new BeaconProposerPreparer(validatorApiChannel, validatorIndexProvider, proposerConfigProvider.get(), config.getValidatorConfig().getProposerDefaultFeeRecipient(), spec));
    } else {
        proposerConfigProvider = Optional.empty();
    }
    addValidatorCountMetric(metricsSystem, validators);
    this.validatorStatusLogger = new DefaultValidatorStatusLogger(metricsSystem, validators, validatorApiChannel, asyncRunner);
}
Also used : AttestationDutyFactory(tech.pegasys.teku.validator.client.duties.attestations.AttestationDutyFactory) BlockDutyFactory(tech.pegasys.teku.validator.client.duties.BlockDutyFactory) ValidatorLoader(tech.pegasys.teku.validator.client.loader.ValidatorLoader) DataDirLayout(tech.pegasys.teku.service.serviceutils.layout.DataDirLayout) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) ValidatorRestApiConfig(tech.pegasys.teku.validator.client.restapi.ValidatorRestApiConfig) Random(java.util.Random) LocalSlashingProtector(tech.pegasys.teku.core.signatures.LocalSlashingProtector) ArrayList(java.util.ArrayList) EventChannels(tech.pegasys.teku.infrastructure.events.EventChannels) ValidatorRestApi(tech.pegasys.teku.validator.client.restapi.ValidatorRestApi) PublicKeyLoader(tech.pegasys.teku.validator.client.loader.PublicKeyLoader) SlotBasedScheduledDuties(tech.pegasys.teku.validator.client.duties.SlotBasedScheduledDuties) JsonProvider(tech.pegasys.teku.provider.JsonProvider) ChainHeadTracker(tech.pegasys.teku.validator.client.duties.synccommittee.ChainHeadTracker) BeaconCommitteeSubscriptions(tech.pegasys.teku.validator.client.duties.BeaconCommitteeSubscriptions) Spec(tech.pegasys.teku.spec.Spec) Path(java.nio.file.Path) Service(tech.pegasys.teku.service.serviceutils.Service) ProposerConfigProvider(tech.pegasys.teku.validator.client.proposerconfig.ProposerConfigProvider) AsyncRunner(tech.pegasys.teku.infrastructure.async.AsyncRunner) ValidatorLogger(tech.pegasys.teku.infrastructure.logging.ValidatorLogger) SyncDataAccessor(tech.pegasys.teku.infrastructure.io.SyncDataAccessor) RestApi(tech.pegasys.teku.infrastructure.restapi.RestApi) ServiceConfig(tech.pegasys.teku.service.serviceutils.ServiceConfig) BeaconNodeApi(tech.pegasys.teku.validator.beaconnode.BeaconNodeApi) SyncCommitteeScheduledDuties(tech.pegasys.teku.validator.client.duties.synccommittee.SyncCommitteeScheduledDuties) List(java.util.List) Logger(org.apache.logging.log4j.Logger) TekuMetricCategory(tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory) ValidatorApiChannel(tech.pegasys.teku.validator.api.ValidatorApiChannel) InProcessBeaconNodeApi(tech.pegasys.teku.validator.eventadapter.InProcessBeaconNodeApi) OwnedValidators(tech.pegasys.teku.validator.client.loader.OwnedValidators) SlashingProtector(tech.pegasys.teku.core.signatures.SlashingProtector) SystemSignalListener(tech.pegasys.teku.infrastructure.io.SystemSignalListener) GenesisDataProvider(tech.pegasys.teku.validator.beaconnode.GenesisDataProvider) ProposerConfigLoader(tech.pegasys.teku.validator.client.proposerconfig.loader.ProposerConfigLoader) SlashingProtectionLogger(tech.pegasys.teku.validator.client.loader.SlashingProtectionLogger) Optional(java.util.Optional) RemoteBeaconNodeApi(tech.pegasys.teku.validator.remote.RemoteBeaconNodeApi) MetricsSystem(org.hyperledger.besu.plugin.services.MetricsSystem) LogManager(org.apache.logging.log4j.LogManager) SpecMilestone(tech.pegasys.teku.spec.SpecMilestone) ValidatorTimingChannel(tech.pegasys.teku.validator.api.ValidatorTimingChannel) AttestationDutyFactory(tech.pegasys.teku.validator.client.duties.attestations.AttestationDutyFactory) BlockDutyFactory(tech.pegasys.teku.validator.client.duties.BlockDutyFactory) ChainHeadTracker(tech.pegasys.teku.validator.client.duties.synccommittee.ChainHeadTracker) OwnedValidators(tech.pegasys.teku.validator.client.loader.OwnedValidators) BeaconCommitteeSubscriptions(tech.pegasys.teku.validator.client.duties.BeaconCommitteeSubscriptions) SyncCommitteeScheduledDuties(tech.pegasys.teku.validator.client.duties.synccommittee.SyncCommitteeScheduledDuties) ProposerConfigLoader(tech.pegasys.teku.validator.client.proposerconfig.loader.ProposerConfigLoader) JsonProvider(tech.pegasys.teku.provider.JsonProvider) SlotBasedScheduledDuties(tech.pegasys.teku.validator.client.duties.SlotBasedScheduledDuties) Random(java.util.Random)

Example 3 with ValidatorApiChannel

use of tech.pegasys.teku.validator.api.ValidatorApiChannel in project teku by ConsenSys.

the class RemoteBeaconNodeApi method create.

public static BeaconNodeApi create(final ServiceConfig serviceConfig, final AsyncRunner asyncRunner, final URI beaconNodeApiEndpoint, final Spec spec, final boolean generateEarlyAttestations) {
    final OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder().readTimeout(READ_TIMEOUT);
    HttpUrl apiEndpoint = HttpUrl.get(beaconNodeApiEndpoint);
    Preconditions.checkNotNull(apiEndpoint, String.format("Failed to convert remote api endpoint (%s) to a valid url", UrlSanitizer.sanitizePotentialUrl(beaconNodeApiEndpoint.toString())));
    OkHttpClientAuthLoggingIntercepter.addAuthenticator(apiEndpoint, httpClientBuilder);
    // Strip any authentication info from the URL to ensure it doesn't get logged.
    apiEndpoint = apiEndpoint.newBuilder().username("").password("").build();
    final OkHttpClient okHttpClient = httpClientBuilder.build();
    final OkHttpValidatorRestApiClient apiClient = new OkHttpValidatorRestApiClient(apiEndpoint, okHttpClient);
    final ValidatorApiChannel validatorApiChannel = new MetricRecordingValidatorApiChannel(serviceConfig.getMetricsSystem(), new RemoteValidatorApiHandler(spec, apiClient, asyncRunner));
    final ValidatorTimingChannel validatorTimingChannel = serviceConfig.getEventChannels().getPublisher(ValidatorTimingChannel.class);
    final BeaconChainEventAdapter beaconChainEventAdapter = new EventSourceBeaconChainEventAdapter(apiEndpoint, okHttpClient, new TimeBasedEventAdapter(new GenesisDataProvider(asyncRunner, validatorApiChannel), new RepeatingTaskScheduler(asyncRunner, serviceConfig.getTimeProvider()), serviceConfig.getTimeProvider(), validatorTimingChannel, spec), validatorTimingChannel, serviceConfig.getMetricsSystem(), generateEarlyAttestations);
    return new RemoteBeaconNodeApi(beaconChainEventAdapter, validatorApiChannel);
}
Also used : OkHttpClient(okhttp3.OkHttpClient) ValidatorTimingChannel(tech.pegasys.teku.validator.api.ValidatorTimingChannel) MetricRecordingValidatorApiChannel(tech.pegasys.teku.validator.beaconnode.metrics.MetricRecordingValidatorApiChannel) ValidatorApiChannel(tech.pegasys.teku.validator.api.ValidatorApiChannel) RepeatingTaskScheduler(tech.pegasys.teku.infrastructure.async.timed.RepeatingTaskScheduler) GenesisDataProvider(tech.pegasys.teku.validator.beaconnode.GenesisDataProvider) TimeBasedEventAdapter(tech.pegasys.teku.validator.beaconnode.TimeBasedEventAdapter) HttpUrl(okhttp3.HttpUrl) OkHttpValidatorRestApiClient(tech.pegasys.teku.validator.remote.apiclient.OkHttpValidatorRestApiClient) MetricRecordingValidatorApiChannel(tech.pegasys.teku.validator.beaconnode.metrics.MetricRecordingValidatorApiChannel) BeaconChainEventAdapter(tech.pegasys.teku.validator.beaconnode.BeaconChainEventAdapter)

Example 4 with ValidatorApiChannel

use of tech.pegasys.teku.validator.api.ValidatorApiChannel in project teku by ConsenSys.

the class InProcessBeaconNodeApi method create.

public static BeaconNodeApi create(final ServiceConfig services, final AsyncRunner asyncRunner, final boolean generateEarlyAttestations, final Spec spec) {
    final MetricsSystem metricsSystem = services.getMetricsSystem();
    final EventChannels eventChannels = services.getEventChannels();
    final ValidatorApiChannel validatorApiChannel = new MetricRecordingValidatorApiChannel(metricsSystem, eventChannels.getPublisher(ValidatorApiChannel.class, asyncRunner));
    final ValidatorTimingChannel validatorTimingChannel = eventChannels.getPublisher(ValidatorTimingChannel.class);
    final TimeBasedEventAdapter timeBasedEventAdapter = new TimeBasedEventAdapter(new GenesisDataProvider(asyncRunner, validatorApiChannel), new RepeatingTaskScheduler(asyncRunner, services.getTimeProvider()), services.getTimeProvider(), validatorTimingChannel, spec);
    final BeaconChainEventAdapter beaconChainEventAdapter = new IndependentTimerEventChannelEventAdapter(eventChannels, generateEarlyAttestations, timeBasedEventAdapter, validatorTimingChannel);
    return new InProcessBeaconNodeApi(validatorApiChannel, beaconChainEventAdapter);
}
Also used : MetricRecordingValidatorApiChannel(tech.pegasys.teku.validator.beaconnode.metrics.MetricRecordingValidatorApiChannel) BeaconChainEventAdapter(tech.pegasys.teku.validator.beaconnode.BeaconChainEventAdapter) ValidatorTimingChannel(tech.pegasys.teku.validator.api.ValidatorTimingChannel) EventChannels(tech.pegasys.teku.infrastructure.events.EventChannels) MetricRecordingValidatorApiChannel(tech.pegasys.teku.validator.beaconnode.metrics.MetricRecordingValidatorApiChannel) ValidatorApiChannel(tech.pegasys.teku.validator.api.ValidatorApiChannel) RepeatingTaskScheduler(tech.pegasys.teku.infrastructure.async.timed.RepeatingTaskScheduler) MetricsSystem(org.hyperledger.besu.plugin.services.MetricsSystem) GenesisDataProvider(tech.pegasys.teku.validator.beaconnode.GenesisDataProvider) TimeBasedEventAdapter(tech.pegasys.teku.validator.beaconnode.TimeBasedEventAdapter)

Example 5 with ValidatorApiChannel

use of tech.pegasys.teku.validator.api.ValidatorApiChannel in project teku by ConsenSys.

the class MetricRecordingValidatorApiChannelTest method getDataRequestArguments.

public static Stream<Arguments> getDataRequestArguments() {
    final DataStructureUtil dataStructureUtil = new DataStructureUtil(TestSpecFactory.createMinimalAltair());
    final UInt64 slot = dataStructureUtil.randomUInt64();
    final BLSSignature signature = dataStructureUtil.randomSignature();
    final AttestationData attestationData = dataStructureUtil.randomAttestationData();
    final int subcommitteeIndex = dataStructureUtil.randomPositiveInt();
    final Bytes32 beaconBlockRoot = dataStructureUtil.randomBytes32();
    return Stream.of(requestDataTest("getGenesisData", ValidatorApiChannel::getGenesisData, MetricRecordingValidatorApiChannel.GENESIS_TIME_REQUESTS_COUNTER_NAME, new GenesisData(dataStructureUtil.randomUInt64(), Bytes32.random())), requestDataTest("createUnsignedBlock", channel -> channel.createUnsignedBlock(slot, signature, Optional.empty()), MetricRecordingValidatorApiChannel.UNSIGNED_BLOCK_REQUESTS_COUNTER_NAME, dataStructureUtil.randomBeaconBlock(slot)), requestDataTest("createAttestationData", channel -> channel.createAttestationData(slot, 4), MetricRecordingValidatorApiChannel.ATTESTATION_DATA_REQUEST_COUNTER_NAME, dataStructureUtil.randomAttestationData()), requestDataTest("createAggregate", channel -> channel.createAggregate(attestationData.getSlot(), attestationData.hashTreeRoot()), MetricRecordingValidatorApiChannel.AGGREGATE_REQUESTS_COUNTER_NAME, dataStructureUtil.randomAttestation()), requestDataTest("createSyncCommitteeContribution", channel -> channel.createSyncCommitteeContribution(slot, subcommitteeIndex, beaconBlockRoot), MetricRecordingValidatorApiChannel.CREATE_SYNC_COMMITTEE_CONTRIBUTION_REQUESTS_COUNTER_NAME, dataStructureUtil.randomSyncCommitteeContribution(slot)));
}
Also used : Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StubMetricsSystem(tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) Function(java.util.function.Function) SignedAggregateAndProof(tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) Assertions(org.assertj.core.api.Assertions) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) RequestOutcome(tech.pegasys.teku.validator.beaconnode.metrics.BeaconChainRequestCounter.RequestOutcome) Bytes32(org.apache.tuweni.bytes.Bytes32) GenesisData(tech.pegasys.teku.spec.datastructures.genesis.GenesisData) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) MethodSource(org.junit.jupiter.params.provider.MethodSource) Collections.emptySet(java.util.Collections.emptySet) BLSSignature(tech.pegasys.teku.bls.BLSSignature) Collections.emptyList(java.util.Collections.emptyList) Mockito.when(org.mockito.Mockito.when) Arguments(org.junit.jupiter.params.provider.Arguments) Consumer(java.util.function.Consumer) List(java.util.List) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Stream(java.util.stream.Stream) TekuMetricCategory(tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) ValidatorApiChannel(tech.pegasys.teku.validator.api.ValidatorApiChannel) SyncCommitteeMessage(tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeMessage) DataStructureUtil(tech.pegasys.teku.spec.util.DataStructureUtil) Optional(java.util.Optional) SubmitDataError(tech.pegasys.teku.validator.api.SubmitDataError) Mockito.mock(org.mockito.Mockito.mock) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) GenesisData(tech.pegasys.teku.spec.datastructures.genesis.GenesisData) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Bytes32(org.apache.tuweni.bytes.Bytes32) BLSSignature(tech.pegasys.teku.bls.BLSSignature) DataStructureUtil(tech.pegasys.teku.spec.util.DataStructureUtil)

Aggregations

ValidatorApiChannel (tech.pegasys.teku.validator.api.ValidatorApiChannel)6 List (java.util.List)4 Optional (java.util.Optional)4 SafeFuture (tech.pegasys.teku.infrastructure.async.SafeFuture)4 MetricsSystem (org.hyperledger.besu.plugin.services.MetricsSystem)3 EventChannels (tech.pegasys.teku.infrastructure.events.EventChannels)3 ValidatorLogger (tech.pegasys.teku.infrastructure.logging.ValidatorLogger)3 ValidatorTimingChannel (tech.pegasys.teku.validator.api.ValidatorTimingChannel)3 GenesisDataProvider (tech.pegasys.teku.validator.beaconnode.GenesisDataProvider)3 Path (java.nio.file.Path)2 ArrayList (java.util.ArrayList)2 Random (java.util.Random)2 LogManager (org.apache.logging.log4j.LogManager)2 Logger (org.apache.logging.log4j.Logger)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 Assertions.assertThatThrownBy (org.assertj.core.api.Assertions.assertThatThrownBy)2 Mockito.mock (org.mockito.Mockito.mock)2 Mockito.when (org.mockito.Mockito.when)2 BLSSignature (tech.pegasys.teku.bls.BLSSignature)2 LocalSlashingProtector (tech.pegasys.teku.core.signatures.LocalSlashingProtector)2