diff --git a/__tests__/unit/core-blockchain/blockchain.test.ts b/__tests__/unit/core-blockchain/blockchain.test.ts index 3dc2be1e7e..3835b99cf0 100644 --- a/__tests__/unit/core-blockchain/blockchain.test.ts +++ b/__tests__/unit/core-blockchain/blockchain.test.ts @@ -58,6 +58,7 @@ describe("Blockchain", () => { logService.warning = jest.fn(); logService.info = jest.fn(); logService.error = jest.fn(); + logService.debug = jest.fn(); stateStore.started = false; stateStore.clearWakeUpTimeout = jest.fn(); diff --git a/packages/core-blockchain/src/blockchain.ts b/packages/core-blockchain/src/blockchain.ts index 4e657957f8..1b70f5909c 100644 --- a/packages/core-blockchain/src/blockchain.ts +++ b/packages/core-blockchain/src/blockchain.ts @@ -354,6 +354,13 @@ export class Blockchain implements Contracts.Blockchain.Blockchain { * Process the given block. */ public async processBlocks(blocks: Interfaces.IBlockData[]): Promise { + if (blocks.length) { + const lastHeight = this.getLastBlock().data.height; + const fromHeight = blocks[0].height; + const toHeight = blocks[blocks.length - 1].height; + this.app.log.debug(`Processing chunk of blocks [${fromHeight}, ${toHeight}] on top of ${lastHeight}`); + } + const blockTimeLookup = await Utils.forgingInfoCalculator.getBlockTimeLookup(this.app, blocks[0].height); const acceptedBlocks: Interfaces.IBlock[] = [];