Search in sources :

Example 1 with Waiter.waitFor

use of tech.pegasys.teku.infrastructure.async.Waiter.waitFor in project teku by ConsenSys.

the class GossipMessageHandlerIntegrationTest method shouldNotGossipAttestationsWhenPeerDeregistersFromTopic.

@Test
public void shouldNotGossipAttestationsWhenPeerDeregistersFromTopic() throws Exception {
    final GossipEncoding gossipEncoding = GossipEncoding.SSZ_SNAPPY;
    List<ValidateableAttestation> node2attestations = new ArrayList<>();
    Subscribers<ProcessedAttestationListener> processedAttestationSubscribers = Subscribers.create(false);
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder1 = b -> {
        b.gossipEncoding(gossipEncoding);
        b.gossipedAttestationProcessor((__) -> SafeFuture.completedFuture(InternalValidationResult.ACCEPT));
        b.processedAttestationSubscriptionProvider(processedAttestationSubscribers::subscribe);
    };
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder2 = b -> {
        b.gossipEncoding(gossipEncoding);
        b.gossipedAttestationProcessor((attestation) -> {
            node2attestations.add(attestation);
            return SafeFuture.completedFuture(InternalValidationResult.ACCEPT);
        });
    };
    // Setup network 1
    final NodeManager node1 = createNodeManager(networkBuilder1);
    final Eth2P2PNetwork network1 = node1.network();
    // Setup network 2
    final NodeManager node2 = createNodeManager(networkBuilder2);
    final Eth2P2PNetwork network2 = node2.network();
    // Connect networks 1 -> 2
    waitFor(node1.connect(node2));
    // Wait for connections to get set up
    Waiter.waitFor(() -> {
        assertThat(network1.getPeerCount()).isEqualTo(1);
        assertThat(network2.getPeerCount()).isEqualTo(1);
    });
    // Propagate attestation from network 1
    AttestationGenerator attestationGenerator = new AttestationGenerator(spec, validatorKeys);
    final StateAndBlockSummary bestBlockAndState = getChainHead(node1);
    Attestation attestation = attestationGenerator.validAttestation(bestBlockAndState);
    final int subnetId = spec.computeSubnetForAttestation(bestBlockAndState.getState(), attestation);
    ValidateableAttestation validAttestation = ValidateableAttestation.fromNetwork(spec, attestation, subnetId);
    node1.network().subscribeToAttestationSubnetId(subnetId);
    node2.network().subscribeToAttestationSubnetId(subnetId);
    waitForTopicRegistration();
    processedAttestationSubscribers.forEach(s -> s.accept(validAttestation));
    waitForMessageToBeDelivered();
    assertThat(node2attestations.size()).isEqualTo(1);
    assertThat(node2attestations.get(0)).isEqualTo(validAttestation);
    node1.network().unsubscribeFromAttestationSubnetId(subnetId);
    node2.network().unsubscribeFromAttestationSubnetId(subnetId);
    waitForTopicDeregistration();
    processedAttestationSubscribers.forEach(s -> s.accept(validAttestation));
    ensureConditionRemainsMet(() -> {
        assertThat(node2attestations.size()).isEqualTo(1);
        assertThat(node2attestations.get(0)).isEqualTo(validAttestation);
    });
}
Also used : Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) BLSKeyPair(tech.pegasys.teku.bls.BLSKeyPair) Subscribers(tech.pegasys.teku.infrastructure.subscribers.Subscribers) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StateAndBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.StateAndBlockSummary) ProcessedAttestationListener(tech.pegasys.teku.spec.datastructures.attestation.ProcessedAttestationListener) AttestationGenerator(tech.pegasys.teku.core.AttestationGenerator) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Spec(tech.pegasys.teku.spec.Spec) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) Waiter.ensureConditionRemainsMet(tech.pegasys.teku.infrastructure.async.Waiter.ensureConditionRemainsMet) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) Set(java.util.Set) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) Waiter.waitFor(tech.pegasys.teku.infrastructure.async.Waiter.waitFor) Waiter(tech.pegasys.teku.infrastructure.async.Waiter) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) BLSKeyGenerator(tech.pegasys.teku.bls.BLSKeyGenerator) InternalValidationResult(tech.pegasys.teku.statetransition.validation.InternalValidationResult) SafeFutureAssert.safeJoin(tech.pegasys.teku.infrastructure.async.SafeFutureAssert.safeJoin) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) StateAndBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.StateAndBlockSummary) AttestationGenerator(tech.pegasys.teku.core.AttestationGenerator) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) ArrayList(java.util.ArrayList) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) ProcessedAttestationListener(tech.pegasys.teku.spec.datastructures.attestation.ProcessedAttestationListener) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) Test(org.junit.jupiter.api.Test)

Example 2 with Waiter.waitFor

use of tech.pegasys.teku.infrastructure.async.Waiter.waitFor in project teku by ConsenSys.

the class GossipMessageHandlerIntegrationTest method shouldNotGossipAttestationsAcrossPeersThatAreNotOnTheSameSubnet.

@Test
public void shouldNotGossipAttestationsAcrossPeersThatAreNotOnTheSameSubnet() throws Exception {
    final GossipEncoding gossipEncoding = GossipEncoding.SSZ_SNAPPY;
    List<ValidateableAttestation> node2attestations = new ArrayList<>();
    Subscribers<ProcessedAttestationListener> processedAttestationSubscribers = Subscribers.create(false);
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder1 = b -> {
        b.gossipEncoding(gossipEncoding);
        b.processedAttestationSubscriptionProvider(processedAttestationSubscribers::subscribe);
    };
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder2 = b -> {
        b.gossipEncoding(gossipEncoding);
        b.gossipedAttestationProcessor((attestation) -> {
            node2attestations.add(attestation);
            return SafeFuture.completedFuture(InternalValidationResult.ACCEPT);
        });
    };
    // Setup network 1
    final NodeManager node1 = createNodeManager(networkBuilder1);
    final Eth2P2PNetwork network1 = node1.network();
    // Setup network 2
    final NodeManager node2 = createNodeManager(networkBuilder2);
    final Eth2P2PNetwork network2 = node2.network();
    // Connect networks 1 -> 2
    waitFor(node1.connect(node2));
    // Wait for connections to get set up
    Waiter.waitFor(() -> {
        assertThat(network1.getPeerCount()).isEqualTo(1);
        assertThat(network2.getPeerCount()).isEqualTo(1);
    });
    // Propagate attestation from network 1
    AttestationGenerator attestationGenerator = new AttestationGenerator(spec, validatorKeys);
    final StateAndBlockSummary bestBlockAndState = getChainHead(node1);
    Attestation validAttestation = attestationGenerator.validAttestation(bestBlockAndState);
    processedAttestationSubscribers.forEach(s -> s.accept(ValidateableAttestation.from(spec, validAttestation)));
    ensureConditionRemainsMet(() -> assertThat(node2attestations).isEmpty());
}
Also used : Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) BLSKeyPair(tech.pegasys.teku.bls.BLSKeyPair) Subscribers(tech.pegasys.teku.infrastructure.subscribers.Subscribers) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StateAndBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.StateAndBlockSummary) ProcessedAttestationListener(tech.pegasys.teku.spec.datastructures.attestation.ProcessedAttestationListener) AttestationGenerator(tech.pegasys.teku.core.AttestationGenerator) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Spec(tech.pegasys.teku.spec.Spec) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) Waiter.ensureConditionRemainsMet(tech.pegasys.teku.infrastructure.async.Waiter.ensureConditionRemainsMet) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) Set(java.util.Set) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) Waiter.waitFor(tech.pegasys.teku.infrastructure.async.Waiter.waitFor) Waiter(tech.pegasys.teku.infrastructure.async.Waiter) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) BLSKeyGenerator(tech.pegasys.teku.bls.BLSKeyGenerator) InternalValidationResult(tech.pegasys.teku.statetransition.validation.InternalValidationResult) SafeFutureAssert.safeJoin(tech.pegasys.teku.infrastructure.async.SafeFutureAssert.safeJoin) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) StateAndBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.StateAndBlockSummary) AttestationGenerator(tech.pegasys.teku.core.AttestationGenerator) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) ArrayList(java.util.ArrayList) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) ProcessedAttestationListener(tech.pegasys.teku.spec.datastructures.attestation.ProcessedAttestationListener) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) Test(org.junit.jupiter.api.Test)

Example 3 with Waiter.waitFor

use of tech.pegasys.teku.infrastructure.async.Waiter.waitFor in project teku by ConsenSys.

the class ProposerSlashingGossipIntegrationTest method shouldGossipToPeers.

@Test
public void shouldGossipToPeers() throws Exception {
    final GossipEncoding gossipEncoding = GossipEncoding.SSZ_SNAPPY;
    // Set up publishers & consumers
    Set<ProposerSlashing> receivedGossip = new HashSet<>();
    final OperationProcessor<ProposerSlashing> operationProcessor = (slashing) -> {
        receivedGossip.add(slashing);
        return SafeFuture.completedFuture(InternalValidationResult.ACCEPT);
    };
    // Setup network 1
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder = b -> b.gossipEncoding(gossipEncoding);
    NodeManager node1 = createNodeManager(networkBuilder);
    // Setup network 2
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder2 = b -> b.gossipEncoding(gossipEncoding).gossipedProposerSlashingProcessor(operationProcessor);
    NodeManager node2 = createNodeManager(networkBuilder2);
    // Connect networks 1 -> 2
    waitFor(node1.connect(node2));
    // Wait for connections to get set up
    Waiter.waitFor(() -> {
        assertThat(node1.network().getPeerCount()).isEqualTo(1);
        assertThat(node2.network().getPeerCount()).isEqualTo(1);
    });
    // Wait for subscriptions to complete (jvm-libp2p does this asynchronously)
    Thread.sleep(2000);
    // Create and publish slashing
    final ProposerSlashing slashing = dataStructureUtil.randomProposerSlashing();
    node1.network().publishProposerSlashing(slashing);
    // Verify the slashing was gossiped across the network
    Waiter.waitFor(() -> assertThat(receivedGossip).containsExactly(slashing));
}
Also used : Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) OperationProcessor(tech.pegasys.teku.networking.eth2.gossip.topics.OperationProcessor) Set(java.util.Set) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) BLSKeyPair(tech.pegasys.teku.bls.BLSKeyPair) HashSet(java.util.HashSet) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) Waiter.waitFor(tech.pegasys.teku.infrastructure.async.Waiter.waitFor) ProposerSlashing(tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing) Waiter(tech.pegasys.teku.infrastructure.async.Waiter) DataStructureUtil(tech.pegasys.teku.spec.util.DataStructureUtil) Spec(tech.pegasys.teku.spec.Spec) BLSKeyGenerator(tech.pegasys.teku.bls.BLSKeyGenerator) InternalValidationResult(tech.pegasys.teku.statetransition.validation.InternalValidationResult) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) ProposerSlashing(tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 4 with Waiter.waitFor

use of tech.pegasys.teku.infrastructure.async.Waiter.waitFor in project teku by ConsenSys.

the class GossipMessageHandlerIntegrationTest method shouldGossipBlocksAcrossToIndirectlyConnectedPeers.

@Test
public void shouldGossipBlocksAcrossToIndirectlyConnectedPeers() throws Exception {
    final GossipEncoding gossipEncoding = GossipEncoding.SSZ_SNAPPY;
    final UInt64 blockSlot = UInt64.valueOf(2L);
    // Setup network 1
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder = b -> b.gossipEncoding(gossipEncoding);
    NodeManager node1 = createNodeManager(networkBuilder);
    node1.chainUtil().setSlot(blockSlot);
    // Setup network 2
    Set<SignedBeaconBlock> node2ReceivedBlocks = new HashSet<>();
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder2 = b -> b.gossipEncoding(gossipEncoding).gossipedBlockProcessor((block) -> {
        node2ReceivedBlocks.add(block);
        return SafeFuture.completedFuture(InternalValidationResult.ACCEPT);
    });
    NodeManager node2 = createNodeManager(networkBuilder2);
    node2.chainUtil().setSlot(blockSlot);
    // Setup network 3
    Set<SignedBeaconBlock> node3ReceivedBlocks = new HashSet<>();
    final Consumer<Eth2P2PNetworkBuilder> networkBuilder3 = b -> b.gossipEncoding(gossipEncoding).gossipedBlockProcessor((block) -> {
        node3ReceivedBlocks.add(block);
        return SafeFuture.completedFuture(InternalValidationResult.ACCEPT);
    });
    NodeManager node3 = createNodeManager(networkBuilder3);
    node2.chainUtil().setSlot(blockSlot);
    // Connect networks 1 -> 2 -> 3
    waitFor(node1.connect(node2));
    waitFor(node2.connect(node3));
    // Wait for connections to get set up
    Waiter.waitFor(() -> {
        assertThat(node1.network().getPeerCount()).isEqualTo(1);
        assertThat(node2.network().getPeerCount()).isEqualTo(2);
        assertThat(node3.network().getPeerCount()).isEqualTo(1);
    });
    // Wait for subscriptions to complete (jvm-libp2p does this asynchronously)
    Thread.sleep(2000);
    // Propagate block from network 1
    final SignedBeaconBlock newBlock = node1.chainUtil().createBlockAtSlot(blockSlot);
    node1.gossipBlock(newBlock);
    // Verify the expected block was gossiped across the network
    Waiter.waitFor(() -> {
        assertThat(node2ReceivedBlocks).containsExactly(newBlock);
        assertThat(node3ReceivedBlocks).containsExactly(newBlock);
    });
}
Also used : Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) BLSKeyPair(tech.pegasys.teku.bls.BLSKeyPair) Subscribers(tech.pegasys.teku.infrastructure.subscribers.Subscribers) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StateAndBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.StateAndBlockSummary) ProcessedAttestationListener(tech.pegasys.teku.spec.datastructures.attestation.ProcessedAttestationListener) AttestationGenerator(tech.pegasys.teku.core.AttestationGenerator) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Spec(tech.pegasys.teku.spec.Spec) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) Waiter.ensureConditionRemainsMet(tech.pegasys.teku.infrastructure.async.Waiter.ensureConditionRemainsMet) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) Set(java.util.Set) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) Waiter.waitFor(tech.pegasys.teku.infrastructure.async.Waiter.waitFor) Waiter(tech.pegasys.teku.infrastructure.async.Waiter) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) BLSKeyGenerator(tech.pegasys.teku.bls.BLSKeyGenerator) InternalValidationResult(tech.pegasys.teku.statetransition.validation.InternalValidationResult) SafeFutureAssert.safeJoin(tech.pegasys.teku.infrastructure.async.SafeFutureAssert.safeJoin) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 5 with Waiter.waitFor

use of tech.pegasys.teku.infrastructure.async.Waiter.waitFor in project teku by ConsenSys.

the class GossipMessageHandlerIntegrationTest method shouldNotGossipInvalidBlocks.

@Test
public void shouldNotGossipInvalidBlocks() throws Exception {
    final GossipEncoding gossipEncoding = GossipEncoding.SSZ_SNAPPY;
    final UInt64 blockSlot = UInt64.valueOf(2L);
    final Set<SignedBeaconBlock> node3ReceivedBlocks = new HashSet<>();
    // Setup network 1
    NodeManager node1 = createNodeManager(b -> b.gossipEncoding(gossipEncoding));
    node1.chainUtil().setSlot(blockSlot);
    // Setup network 2
    NodeManager node2 = createNodeManager(b1 -> b1.gossipEncoding(gossipEncoding).gossipedBlockProcessor(block -> {
        // Report block as invalid
        return SafeFuture.completedFuture(InternalValidationResult.reject("No"));
    }));
    node2.chainUtil().setSlot(blockSlot);
    // Setup network 3
    NodeManager node3 = createNodeManager(b -> b.gossipEncoding(gossipEncoding).gossipedBlockProcessor(block -> {
        node3ReceivedBlocks.add(block);
        return SafeFuture.completedFuture(InternalValidationResult.ACCEPT);
    }));
    node3.chainUtil().setSlot(blockSlot);
    // Connect networks 1 -> 2 -> 3
    waitFor(node1.connect(node2));
    waitFor(node2.connect(node3));
    // Wait for connections to get set up
    Waiter.waitFor(() -> {
        assertThat(node1.network().getPeerCount()).isEqualTo(1);
        assertThat(node2.network().getPeerCount()).isEqualTo(2);
        assertThat(node3.network().getPeerCount()).isEqualTo(1);
    });
    // Wait for subscriptions to complete (jvm-libp2p does this asynchronously)
    Thread.sleep(2000);
    // Propagate invalid block from network 1
    final SignedBeaconBlock newBlock = node1.chainUtil().createBlockAtSlotFromInvalidProposer(blockSlot);
    node1.gossipBlock(newBlock);
    // Wait for blocks to propagate
    assertThat(node1.network().getPeerCount()).isEqualTo(1);
    // Node2 receives the block from node1 but doesn't not gossip it on to node3 as it's invalid
    ensureConditionRemainsMet(() -> assertThat(node3ReceivedBlocks).isEmpty(), 10000);
}
Also used : Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SafeFuture(tech.pegasys.teku.infrastructure.async.SafeFuture) BLSKeyPair(tech.pegasys.teku.bls.BLSKeyPair) Subscribers(tech.pegasys.teku.infrastructure.subscribers.Subscribers) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StateAndBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.StateAndBlockSummary) ProcessedAttestationListener(tech.pegasys.teku.spec.datastructures.attestation.ProcessedAttestationListener) AttestationGenerator(tech.pegasys.teku.core.AttestationGenerator) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Spec(tech.pegasys.teku.spec.Spec) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) Waiter.ensureConditionRemainsMet(tech.pegasys.teku.infrastructure.async.Waiter.ensureConditionRemainsMet) Eth2P2PNetworkBuilder(tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder) Set(java.util.Set) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TestSpecFactory(tech.pegasys.teku.spec.TestSpecFactory) Waiter.waitFor(tech.pegasys.teku.infrastructure.async.Waiter.waitFor) Waiter(tech.pegasys.teku.infrastructure.async.Waiter) ValidateableAttestation(tech.pegasys.teku.spec.datastructures.attestation.ValidateableAttestation) BLSKeyGenerator(tech.pegasys.teku.bls.BLSKeyGenerator) InternalValidationResult(tech.pegasys.teku.statetransition.validation.InternalValidationResult) SafeFutureAssert.safeJoin(tech.pegasys.teku.infrastructure.async.SafeFutureAssert.safeJoin) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) GossipEncoding(tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Aggregations

HashSet (java.util.HashSet)8 List (java.util.List)8 Set (java.util.Set)8 Consumer (java.util.function.Consumer)8 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)8 AfterEach (org.junit.jupiter.api.AfterEach)8 Test (org.junit.jupiter.api.Test)8 BLSKeyGenerator (tech.pegasys.teku.bls.BLSKeyGenerator)8 BLSKeyPair (tech.pegasys.teku.bls.BLSKeyPair)8 SafeFuture (tech.pegasys.teku.infrastructure.async.SafeFuture)8 Waiter (tech.pegasys.teku.infrastructure.async.Waiter)8 Waiter.waitFor (tech.pegasys.teku.infrastructure.async.Waiter.waitFor)8 Eth2P2PNetworkBuilder (tech.pegasys.teku.networking.eth2.Eth2P2PNetworkFactory.Eth2P2PNetworkBuilder)8 GossipEncoding (tech.pegasys.teku.networking.eth2.gossip.encoding.GossipEncoding)8 InternalValidationResult (tech.pegasys.teku.statetransition.validation.InternalValidationResult)8 Spec (tech.pegasys.teku.spec.Spec)7 TestSpecFactory (tech.pegasys.teku.spec.TestSpecFactory)7 UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)6 SignedBeaconBlock (tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock)6 ArrayList (java.util.ArrayList)5