Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip PrepareNextSlot scheduler for forkchoice spec tests #4327

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/beacon-node/src/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ export class BeaconChain implements IBeaconChain {
this.lightClientServer = lightClientServer;

this.archiver = new Archiver(db, this, logger, signal, opts);
new PrepareNextSlotScheduler(this, this.config, metrics, this.logger, signal);
// always run PrepareNextSlotScheduler except for fork_choice spec tests
if (!opts?.disablePrepareNextSlot) {
new PrepareNextSlotScheduler(this, this.config, metrics, this.logger, signal);
}

metrics?.opPool.aggregatedAttestationPoolSize.addCollect(() => this.onScrapeMetrics());

Expand Down
2 changes: 2 additions & 0 deletions packages/beacon-node/src/chain/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export type BlockProcessOpts = {
assertCorrectProgressiveBalances?: boolean;
/** Used for fork_choice spec tests */
disableOnBlockError?: boolean;
/** Used for fork_choice spec tests */
disablePrepareNextSlot?: boolean;
};

export const defaultChainOptions: IChainOptions = {
Expand Down
3 changes: 3 additions & 0 deletions packages/beacon-node/test/spec/presets/fork_choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export const forkChoiceTest: TestRunnerFn<ForkChoiceTestCase, void> = (fork) =>
// No need to log BlockErrors, the spec test runner will only log them if not not expected
// Otherwise spec tests logs get cluttered with expected errors
disableOnBlockError: true,
// PrepareNextSlot scheduler is used to precompute epoch transition and prepare for the next payload
// we don't use these in fork choice spec tests
disablePrepareNextSlot: true,
assertCorrectProgressiveBalances,
},
{
Expand Down