Search in sources :

Example 1 with GossipManager

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

the class GossipForkSubscriptionsPhase0 method startGossip.

@Override
public final void startGossip(final Bytes32 genesisValidatorsRoot, final boolean isOptimisticHead) {
    if (gossipManagers.isEmpty()) {
        final ForkInfo forkInfo = new ForkInfo(fork, genesisValidatorsRoot);
        addGossipManagers(forkInfo);
    }
    gossipManagers.stream().filter(manager -> manager.isEnabledDuringOptimisticSync() || !isOptimisticHead).forEach(GossipManager::subscribe);
}
Also used : ValidateableSyncCommitteeMessage(tech.pegasys.teku.spec.datastructures.operations.versions.altair.ValidateableSyncCommitteeMessage) GossipManager(tech.pegasys.teku.networking.eth2.gossip.GossipManager) GossipForkSubscriptions(tech.pegasys.teku.networking.eth2.gossip.forks.GossipForkSubscriptions) OperationProcessor(tech.pegasys.teku.networking.eth2.gossip.topics.OperationProcessor) DiscoveryNetwork(tech.pegasys.teku.networking.p2p.discovery.DiscoveryNetwork) SignedVoluntaryExit(tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit) Fork(tech.pegasys.teku.spec.datastructures.state.Fork) AggregateGossipManager(tech.pegasys.teku.networking.eth2.gossip.AggregateGossipManager) ArrayList(java.util.ArrayList) AttesterSlashing(tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing) AttesterSlashingGossipManager(tech.pegasys.teku.networking.eth2.gossip.AttesterSlashingGossipManager) BlockGossipManager(tech.pegasys.teku.networking.eth2.gossip.BlockGossipManager) ProposerSlashing(tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) AttestationSubnetSubscriptions(tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationSubnetSubscriptions) ForkInfo(tech.pegasys.teku.spec.datastructures.state.ForkInfo) Spec(tech.pegasys.teku.spec.Spec) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) Bytes32(org.apache.tuweni.bytes.Bytes32) GOSSIP_MAX_SIZE(tech.pegasys.teku.spec.config.Constants.GOSSIP_MAX_SIZE) AttestationGossipManager(tech.pegasys.teku.networking.eth2.gossip.AttestationGossipManager) AsyncRunner(tech.pegasys.teku.infrastructure.async.AsyncRunner) ProposerSlashingGossipManager(tech.pegasys.teku.networking.eth2.gossip.ProposerSlashingGossipManager) VoluntaryExitGossipManager(tech.pegasys.teku.networking.eth2.gossip.VoluntaryExitGossipManager) SignedContributionAndProof(tech.pegasys.teku.spec.datastructures.operations.versions.altair.SignedContributionAndProof) List(java.util.List) RecentChainData(tech.pegasys.teku.storage.client.RecentChainData) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) MetricsSystem(org.hyperledger.besu.plugin.services.MetricsSystem) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) GossipManager(tech.pegasys.teku.networking.eth2.gossip.GossipManager) AggregateGossipManager(tech.pegasys.teku.networking.eth2.gossip.AggregateGossipManager) AttesterSlashingGossipManager(tech.pegasys.teku.networking.eth2.gossip.AttesterSlashingGossipManager) BlockGossipManager(tech.pegasys.teku.networking.eth2.gossip.BlockGossipManager) AttestationGossipManager(tech.pegasys.teku.networking.eth2.gossip.AttestationGossipManager) ProposerSlashingGossipManager(tech.pegasys.teku.networking.eth2.gossip.ProposerSlashingGossipManager) VoluntaryExitGossipManager(tech.pegasys.teku.networking.eth2.gossip.VoluntaryExitGossipManager) ForkInfo(tech.pegasys.teku.spec.datastructures.state.ForkInfo)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Bytes32 (org.apache.tuweni.bytes.Bytes32)1 MetricsSystem (org.hyperledger.besu.plugin.services.MetricsSystem)1 AsyncRunner (tech.pegasys.teku.infrastructure.async.AsyncRunner)1 UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)1 AggregateGossipManager (tech.pegasys.teku.networking.eth2.gossip.AggregateGossipManager)1 AttestationGossipManager (tech.pegasys.teku.networking.eth2.gossip.AttestationGossipManager)1 AttesterSlashingGossipManager (tech.pegasys.teku.networking.eth2.gossip.AttesterSlashingGossipManager)1 BlockGossipManager (tech.pegasys.teku.networking.eth2.gossip.BlockGossipManager)1 GossipManager (tech.pegasys.teku.networking.eth2.gossip.GossipManager)1 ProposerSlashingGossipManager (tech.pegasys.teku.networking.eth2.gossip.ProposerSlashingGossipManager)1 VoluntaryExitGossipManager (tech.pegasys.teku.networking.eth2.gossip.VoluntaryExitGossipManager)1 GossipEncoding (tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding)1 GossipForkSubscriptions (tech.pegasys.teku.networking.eth2.gossip.forks.GossipForkSubscriptions)1 AttestationSubnetSubscriptions (tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationSubnetSubscriptions)1 OperationProcessor (tech.pegasys.teku.networking.eth2.gossip.topics.OperationProcessor)1 DiscoveryNetwork (tech.pegasys.teku.networking.p2p.discovery.DiscoveryNetwork)1 Spec (tech.pegasys.teku.spec.Spec)1 GOSSIP_MAX_SIZE (tech.pegasys.teku.spec.config.Constants.GOSSIP_MAX_SIZE)1