Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions simplex/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,15 @@ func (e *Epoch) processFinalizedBlock(block common.Block, finalization *common.F

// Create a task that will verify the block in the future, after its predecessors have also been verified.
task := e.createFinalizedBlockVerificationTask(e.oneTimeVerifier.Wrap(block), finalization)
return e.blockVerificationScheduler.ScheduleTaskWithDependencies(task, block.BlockHeader().Seq, blockDependency, []uint64{})
err := e.blockVerificationScheduler.ScheduleTaskWithDependencies(task, block.BlockHeader().Seq, blockDependency, []uint64{})
if errors.Is(err, common.ErrTooManyPendingVerifications) {
// A full scheduler shouldn't fatal
e.Logger.Debug("Dropping finalized block, too many pending verifications",
zap.Uint64("seq", block.BlockHeader().Seq), zap.Error(err))
return nil
}

return err
}

// processNotarizedBlock processes a block that has a notarization.
Expand Down Expand Up @@ -2181,7 +2189,15 @@ func (e *Epoch) processNotarizedBlock(block common.Block, notarization *common.N

e.replicationState.CreateDependencyTasks(blockDependency, md.Seq-1, missingRounds)

return e.blockVerificationScheduler.ScheduleTaskWithDependencies(task, md.Seq, blockDependency, missingRounds)
err := e.blockVerificationScheduler.ScheduleTaskWithDependencies(task, md.Seq, blockDependency, missingRounds)
if errors.Is(err, common.ErrTooManyPendingVerifications) {
// A full scheduler shouldn't fatal
e.Logger.Debug("Dropping notarized block, too many pending verifications",
zap.Uint64("round", md.Round), zap.Uint64("seq", md.Seq), zap.Error(err))
return nil
}

return err
}

func (e *Epoch) createBlockVerificationTask(block common.Block, from common.NodeID, vote common.Vote) func() common.Digest {
Expand Down
Loading