use of tech.pegasys.teku.statetransition.validation.AggregateAttestationValidator in project teku by ConsenSys.
the class BeaconChainController method initAttestationManager.
protected void initAttestationManager() {
final PendingPool<ValidateableAttestation> pendingAttestations = PendingPool.createForAttestations(spec);
final FutureItems<ValidateableAttestation> futureAttestations = FutureItems.create(ValidateableAttestation::getEarliestSlotForForkChoiceProcessing, UInt64.valueOf(3));
AttestationValidator attestationValidator = new AttestationValidator(spec, recentChainData, signatureVerificationService);
AggregateAttestationValidator aggregateValidator = new AggregateAttestationValidator(spec, recentChainData, attestationValidator, signatureVerificationService);
blockImporter.subscribeToVerifiedBlockAttestations((slot, attestations) -> attestations.forEach(attestation -> aggregateValidator.addSeenAggregate(ValidateableAttestation.from(spec, attestation))));
attestationManager = AttestationManager.create(pendingAttestations, futureAttestations, forkChoice, attestationPool, attestationValidator, aggregateValidator, signatureVerificationService, eventChannels.getPublisher(ActiveValidatorChannel.class, beaconAsyncRunner));
eventChannels.subscribe(SlotEventsChannel.class, attestationManager).subscribe(FinalizedCheckpointChannel.class, pendingAttestations).subscribe(BlockImportNotifications.class, attestationManager);
}
Aggregations