Skip to content

Commit

Permalink
Fix for BlsToExecutionChangeGossipIntegrationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha committed Jul 23, 2024
1 parent 0ed3a79 commit ee95ed2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -91,8 +94,14 @@ public void shouldGossipBlsToExecutionChangesToPeers() throws Exception {
.containsExactly(signedBlsToExecutionChange));
}

@SuppressWarnings("deprecation")
private NodeManager createNodeManager(final Consumer<Eth2P2PNetworkBuilder> 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,22 @@ public static NodeManager create(
final List<BLSKeyPair> validatorKeys,
final Consumer<Eth2P2PNetworkBuilder> 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<Eth2P2PNetworkBuilder> configureNetwork,
final RecentChainData storageClient,
final BeaconChainUtil chainUtil)
throws Exception {
final EventChannels eventChannels =
EventChannels.createSyncChannels(
ChannelExceptionHandler.THROWING_HANDLER, new NoOpMetricsSystem());

final Eth2P2PNetworkBuilder networkBuilder =
networkFactory
Expand Down

0 comments on commit ee95ed2

Please sign in to comment.