Search in sources :

Example 1 with AttestationTopicSubscriber

use of tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationTopicSubscriber in project teku by ConsenSys.

the class BeaconChainController method initActiveValidatorTracker.

protected void initActiveValidatorTracker() {
    LOG.debug("BeaconChainController.initActiveValidatorTracker");
    final StableSubnetSubscriber stableSubnetSubscriber = beaconConfig.p2pConfig().isSubscribeAllSubnetsEnabled() ? AllSubnetsSubscriber.create(attestationTopicSubscriber) : new ValidatorBasedStableSubnetSubscriber(attestationTopicSubscriber, new Random(), spec);
    this.activeValidatorTracker = new ActiveValidatorTracker(stableSubnetSubscriber, spec);
}
Also used : StableSubnetSubscriber(tech.pegasys.teku.networking.eth2.gossip.subnets.StableSubnetSubscriber) ValidatorBasedStableSubnetSubscriber(tech.pegasys.teku.networking.eth2.gossip.subnets.ValidatorBasedStableSubnetSubscriber) Random(java.util.Random) ValidatorBasedStableSubnetSubscriber(tech.pegasys.teku.networking.eth2.gossip.subnets.ValidatorBasedStableSubnetSubscriber) ActiveValidatorTracker(tech.pegasys.teku.validator.coordinator.ActiveValidatorTracker)

Example 2 with AttestationTopicSubscriber

use of tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationTopicSubscriber in project teku by ConsenSys.

the class BeaconChainController method initValidatorApiHandler.

public void initValidatorApiHandler() {
    LOG.debug("BeaconChainController.initValidatorApiHandler()");
    final BlockFactory blockFactory = new BlockFactory(spec, new BlockOperationSelectorFactory(spec, attestationPool, attesterSlashingPool, proposerSlashingPool, voluntaryExitPool, syncCommitteeContributionPool, depositProvider, eth1DataCache, VersionProvider.getDefaultGraffiti(), forkChoiceNotifier, executionEngine));
    SyncCommitteeSubscriptionManager syncCommitteeSubscriptionManager = beaconConfig.p2pConfig().isSubscribeAllSubnetsEnabled() ? new AllSyncCommitteeSubscriptions(p2pNetwork, spec) : new SyncCommitteeSubscriptionManager(p2pNetwork);
    final BlockImportChannel blockImportChannel = eventChannels.getPublisher(BlockImportChannel.class, beaconAsyncRunner);
    final BlockGossipChannel blockGossipChannel = eventChannels.getPublisher(BlockGossipChannel.class);
    final ValidatorApiHandler validatorApiHandler = new ValidatorApiHandler(new ChainDataProvider(spec, recentChainData, combinedChainDataClient), combinedChainDataClient, syncService, blockFactory, blockImportChannel, blockGossipChannel, attestationPool, attestationManager, attestationTopicSubscriber, activeValidatorTracker, DutyMetrics.create(metricsSystem, timeProvider, recentChainData, spec), performanceTracker, spec, forkChoiceTrigger, forkChoiceNotifier, syncCommitteeMessagePool, syncCommitteeContributionPool, syncCommitteeSubscriptionManager);
    eventChannels.subscribe(SlotEventsChannel.class, activeValidatorTracker).subscribeMultithreaded(ValidatorApiChannel.class, validatorApiHandler, beaconConfig.beaconRestApiConfig().getValidatorThreads());
    // so don't subscribe.
    if (!beaconConfig.p2pConfig().isSubscribeAllSubnetsEnabled()) {
        eventChannels.subscribe(SlotEventsChannel.class, attestationTopicSubscriber).subscribe(SlotEventsChannel.class, syncCommitteeSubscriptionManager);
    }
}
Also used : ValidatorApiHandler(tech.pegasys.teku.validator.coordinator.ValidatorApiHandler) AllSyncCommitteeSubscriptions(tech.pegasys.teku.networking.eth2.gossip.subnets.AllSyncCommitteeSubscriptions) BlockGossipChannel(tech.pegasys.teku.networking.eth2.gossip.BlockGossipChannel) SlotEventsChannel(tech.pegasys.teku.ethereum.events.SlotEventsChannel) BlockFactory(tech.pegasys.teku.validator.coordinator.BlockFactory) BlockOperationSelectorFactory(tech.pegasys.teku.validator.coordinator.BlockOperationSelectorFactory) ChainDataProvider(tech.pegasys.teku.api.ChainDataProvider) SyncCommitteeSubscriptionManager(tech.pegasys.teku.networking.eth2.gossip.subnets.SyncCommitteeSubscriptionManager) BlockImportChannel(tech.pegasys.teku.statetransition.block.BlockImportChannel)

Example 3 with AttestationTopicSubscriber

use of tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationTopicSubscriber in project teku by ConsenSys.

the class BeaconChainController method initAttestationTopicSubscriber.

protected void initAttestationTopicSubscriber() {
    LOG.debug("BeaconChainController.initAttestationTopicSubscriber");
    this.attestationTopicSubscriber = new AttestationTopicSubscriber(spec, p2pNetwork);
}
Also used : AttestationTopicSubscriber(tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationTopicSubscriber)

Aggregations

Random (java.util.Random)1 ChainDataProvider (tech.pegasys.teku.api.ChainDataProvider)1 SlotEventsChannel (tech.pegasys.teku.ethereum.events.SlotEventsChannel)1 BlockGossipChannel (tech.pegasys.teku.networking.eth2.gossip.BlockGossipChannel)1 AllSyncCommitteeSubscriptions (tech.pegasys.teku.networking.eth2.gossip.subnets.AllSyncCommitteeSubscriptions)1 AttestationTopicSubscriber (tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationTopicSubscriber)1 StableSubnetSubscriber (tech.pegasys.teku.networking.eth2.gossip.subnets.StableSubnetSubscriber)1 SyncCommitteeSubscriptionManager (tech.pegasys.teku.networking.eth2.gossip.subnets.SyncCommitteeSubscriptionManager)1 ValidatorBasedStableSubnetSubscriber (tech.pegasys.teku.networking.eth2.gossip.subnets.ValidatorBasedStableSubnetSubscriber)1 BlockImportChannel (tech.pegasys.teku.statetransition.block.BlockImportChannel)1 ActiveValidatorTracker (tech.pegasys.teku.validator.coordinator.ActiveValidatorTracker)1 BlockFactory (tech.pegasys.teku.validator.coordinator.BlockFactory)1 BlockOperationSelectorFactory (tech.pegasys.teku.validator.coordinator.BlockOperationSelectorFactory)1 ValidatorApiHandler (tech.pegasys.teku.validator.coordinator.ValidatorApiHandler)1