diff --git a/yarn-project/prover-node/src/prover-node.test.ts b/yarn-project/prover-node/src/prover-node.test.ts index a9f4be5f2e0..98714c2e1d0 100644 --- a/yarn-project/prover-node/src/prover-node.test.ts +++ b/yarn-project/prover-node/src/prover-node.test.ts @@ -175,6 +175,12 @@ describe('prover-node', () => { expect(coordination.addEpochProofQuote).toHaveBeenCalledWith(toExpectedQuote(10n)); }); + it('does not send a quote if there are no blocks in the epoch', async () => { + l2BlockSource.getBlocksForEpoch.mockResolvedValue([]); + await proverNode.handleEpochCompleted(10n); + expect(coordination.addEpochProofQuote).not.toHaveBeenCalled(); + }); + it('does not send a quote on a finished epoch if the provider does not return one', async () => { quoteProvider.getQuote.mockResolvedValue(undefined); await proverNode.handleEpochCompleted(10n); diff --git a/yarn-project/prover-node/src/prover-node.ts b/yarn-project/prover-node/src/prover-node.ts index 51cad0f1227..eedf2d77c55 100644 --- a/yarn-project/prover-node/src/prover-node.ts +++ b/yarn-project/prover-node/src/prover-node.ts @@ -128,9 +128,14 @@ export class ProverNode implements ClaimsMonitorHandler, EpochMonitorHandler, Pr try { // Construct a quote for the epoch const blocks = await this.l2BlockSource.getBlocksForEpoch(epochNumber); + if (blocks.length === 0) { + this.log.info(`No blocks found for epoch ${epochNumber}`); + return; + } + const partialQuote = await this.quoteProvider.getQuote(Number(epochNumber), blocks); if (!partialQuote) { - this.log.verbose(`No quote produced for epoch ${epochNumber}`); + this.log.info(`No quote produced for epoch ${epochNumber}`); return; }