Skip to content

Commit

Permalink
run state transition async
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Nov 5, 2024
1 parent 255d51d commit 656a86c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import tech.pegasys.teku.benchmarks.util.CustomRunner;
import tech.pegasys.teku.bls.BLSKeyPair;
import tech.pegasys.teku.bls.BLSSignatureVerifier;
import tech.pegasys.teku.infrastructure.async.AsyncRunner;
import tech.pegasys.teku.infrastructure.async.DelayedExecutorAsyncRunner;
import tech.pegasys.teku.infrastructure.async.eventthread.InlineEventThread;
import tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem;
import tech.pegasys.teku.infrastructure.ssz.collections.SszMutableUInt64List;
Expand Down Expand Up @@ -72,6 +74,7 @@
@Threads(1)
@Fork(1)
public class EpochTransitionBenchmark {
AsyncRunner asyncRunner;
Spec spec;
WeakSubjectivityValidator wsValidator;
RecentChainData recentChainData;
Expand Down Expand Up @@ -100,6 +103,7 @@ public void init() throws Exception {
AbstractBlockProcessor.depositSignatureVerifier = BLSSignatureVerifier.NO_OP;

spec = TestSpecFactory.createMainnetAltair();
asyncRunner = DelayedExecutorAsyncRunner.create();
String blocksFile =
"/blocks/blocks_epoch_"
+ spec.getSlotsPerEpoch(UInt64.ZERO)
Expand Down Expand Up @@ -131,6 +135,7 @@ public void init() throws Exception {

blockImporter =
new BlockImporter(
asyncRunner,
spec,
receivedBlockEventsChannelPublisher,
recentChainData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import tech.pegasys.teku.bls.BLSPublicKey;
import tech.pegasys.teku.bls.BLSSignatureVerifier;
import tech.pegasys.teku.bls.BLSTestUtil;
import tech.pegasys.teku.infrastructure.async.AsyncRunner;
import tech.pegasys.teku.infrastructure.async.DelayedExecutorAsyncRunner;
import tech.pegasys.teku.infrastructure.async.eventthread.InlineEventThread;
import tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
Expand Down Expand Up @@ -63,6 +65,7 @@ public class ProfilingRun {
private Spec spec = TestSpecFactory.createMainnetPhase0();

private final MetricsSystem metricsSystem = new StubMetricsSystem();
private final AsyncRunner asyncRunner = DelayedExecutorAsyncRunner.create();

@Disabled
@Test
Expand Down Expand Up @@ -111,6 +114,7 @@ public void importBlocks() throws Exception {
BeaconChainUtil.create(spec, recentChainData, validatorKeys, false);
BlockImporter blockImporter =
new BlockImporter(
asyncRunner,
spec,
receivedBlockEventsChannelPublisher,
recentChainData,
Expand Down Expand Up @@ -203,6 +207,7 @@ public void importBlocksMemProfiling() throws Exception {
metricsSystem);
BlockImporter blockImporter =
new BlockImporter(
asyncRunner,
spec,
receivedBlockEventsChannelPublisher,
recentChainData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import tech.pegasys.teku.benchmarks.gen.KeyFileGenerator;
import tech.pegasys.teku.bls.BLSKeyPair;
import tech.pegasys.teku.bls.BLSSignatureVerifier;
import tech.pegasys.teku.infrastructure.async.AsyncRunner;
import tech.pegasys.teku.infrastructure.async.DelayedExecutorAsyncRunner;
import tech.pegasys.teku.infrastructure.async.eventthread.InlineEventThread;
import tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
Expand Down Expand Up @@ -79,6 +81,7 @@ public abstract class TransitionBenchmark {
public void init() throws Exception {
spec = TestSpecFactory.createMainnetAltair();
AbstractBlockProcessor.depositSignatureVerifier = BLSSignatureVerifier.NO_OP;
AsyncRunner asyncRunner = DelayedExecutorAsyncRunner.create();

String blocksFile =
"/blocks/blocks_epoch_"
Expand Down Expand Up @@ -109,6 +112,7 @@ public void init() throws Exception {

blockImporter =
new BlockImporter(
asyncRunner,
spec,
receivedBlockEventsChannelPublisher,
recentChainData,
Expand Down

0 comments on commit 656a86c

Please sign in to comment.