@@ -183,6 +183,9 @@ type DBFT struct {
183183 // various chain/mempool events and subscription management:
184184 chainHeadSub event.Subscription
185185 chainHeadEvents chan core.ChainHeadEvent
186+ // minerInterrupted is the callback indicating whether miner is temporary interrupted
187+ // due to the node sync.
188+ minerInterrupted func () bool
186189
187190 config * params.DBFTConfig // Consensus engine configuration parameters
188191
@@ -686,6 +689,12 @@ func (c *DBFT) WithRequestTxs(f func(hashed []common.Hash)) {
686689 c .requestTxs = f
687690}
688691
692+ // WithMinerInterrupted sets callback to indicate whether miner is interrupted due
693+ // to the ongoing node sync process.
694+ func (c * DBFT ) WithMinerInterrupted (f func () bool ) {
695+ c .minerInterrupted = f
696+ }
697+
689698// WithTxPool initializes transaction pool API for DBFT interactions with memory pool
690699// (fetching unknown transactions).
691700func (c * DBFT ) WithTxPool (pool txPool ) {
@@ -1412,6 +1421,13 @@ func (c *DBFT) newPayload(ctx *dbft.Context, t payload.MessageType, msg any) pay
14121421}
14131422
14141423func (c * DBFT ) handleChainBlock (b * types.Block ) error {
1424+ // A short path if miner is not active and the node is in the process of block
1425+ // sync. In this case dBFT can't react properly on the newcoming blocks since no
1426+ // sealing task is expected from miner.
1427+ if c .minerInterrupted () {
1428+ return nil
1429+ }
1430+
14151431 // We can get our own block here, so check for index.
14161432 if uint32 (b .Number ().Uint64 ()) >= c .dbft .BlockIndex {
14171433 log .Info ("New block in the chain" ,
0 commit comments