diff --git a/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlsToExecutionChangeGossipIntegrationTest.java b/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlsToExecutionChangeGossipIntegrationTest.java index 672164db7e7..eb583399f59 100644 --- a/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlsToExecutionChangeGossipIntegrationTest.java +++ b/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlsToExecutionChangeGossipIntegrationTest.java @@ -33,7 +33,10 @@ import tech.pegasys.teku.spec.TestSpecFactory; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; import tech.pegasys.teku.spec.util.DataStructureUtil; +import tech.pegasys.teku.statetransition.BeaconChainUtil; import tech.pegasys.teku.statetransition.validation.InternalValidationResult; +import tech.pegasys.teku.storage.client.MemoryOnlyRecentChainData; +import tech.pegasys.teku.storage.client.RecentChainData; public class BlsToExecutionChangeGossipIntegrationTest { @@ -91,8 +94,14 @@ public void shouldGossipBlsToExecutionChangesToPeers() throws Exception { .containsExactly(signedBlsToExecutionChange)); } + @SuppressWarnings("deprecation") private NodeManager createNodeManager(final Consumer networkBuilder) throws Exception { - return NodeManager.create(spec, networkFactory, validatorKeys, networkBuilder); + final RecentChainData storageClient = MemoryOnlyRecentChainData.create(spec); + final BeaconChainUtil chainUtil = BeaconChainUtil.create(spec, storageClient, validatorKeys); + chainUtil.initializeStorage(); + // Advancing chain to bypass "optimistic genesis" issue that prevents some gossip subscriptions + chainUtil.createAndImportBlockAtSlot(1); + return NodeManager.create(spec, networkFactory, networkBuilder, storageClient, chainUtil); } } diff --git a/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/NodeManager.java b/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/NodeManager.java index bda0f666815..44029d7e007 100644 --- a/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/NodeManager.java +++ b/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/NodeManager.java @@ -73,13 +73,22 @@ public static NodeManager create( final List validatorKeys, final Consumer configureNetwork) throws Exception { - final EventChannels eventChannels = - EventChannels.createSyncChannels( - ChannelExceptionHandler.THROWING_HANDLER, new NoOpMetricsSystem()); final RecentChainData storageClient = MemoryOnlyRecentChainData.create(spec); - final BeaconChainUtil chainUtil = BeaconChainUtil.create(spec, storageClient, validatorKeys); chainUtil.initializeStorage(); + return create(spec, networkFactory, configureNetwork, storageClient, chainUtil); + } + + public static NodeManager create( + final Spec spec, + final Eth2P2PNetworkFactory networkFactory, + final Consumer configureNetwork, + final RecentChainData storageClient, + final BeaconChainUtil chainUtil) + throws Exception { + final EventChannels eventChannels = + EventChannels.createSyncChannels( + ChannelExceptionHandler.THROWING_HANDLER, new NoOpMetricsSystem()); final Eth2P2PNetworkBuilder networkBuilder = networkFactory