Skip to content

Commit

Permalink
go/worker/compute: Emit empty blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko authored and peternose committed Oct 5, 2023
1 parent 70c2b1c commit 8352d10
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions go/worker/compute/executor/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,17 @@ func (n *Node) scheduleBatch(ctx context.Context, round uint64, force bool) {
batch := n.commonNode.TxPool.GetSchedulingSuggestion(rtInfo.Features.ScheduleControl.InitialBatchSize)
defer n.commonNode.TxPool.FinishScheduling()
switch {
case force:
// Batch flush timeout expired, schedule empty batch.
case len(batch) > 0:
// We have some transactions, schedule batch.
case force && len(n.roundResults.Messages) > 0:
case len(n.roundResults.Messages) > 0:
// We have runtime message results (and batch timeout expired), schedule batch.
case force && inMsgMeta.Size > 0:
case inMsgMeta.Size > 0:
// We have queued incoming runtime messages (and batch timeout expired), schedule batch.
case n.rtState.LastNormalRound == n.rtState.GenesisBlock.Header.Round:
// This is the runtime genesis, schedule batch.
case force && n.rtState.LastNormalHeight < n.epoch.GetEpochHeight():
case n.rtState.LastNormalHeight < n.epoch.GetEpochHeight():
// No block in this epoch processed by runtime yet, schedule batch.
default:
// No need to schedule a batch.
Expand Down

0 comments on commit 8352d10

Please sign in to comment.