Skip to content

Commit

Permalink
waiting for batch submission fix
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Nov 8, 2024
1 parent a48066b commit 58adc23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion block/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (e *Executor) ExecuteBlock(block *types.Block) (*tmstate.ABCIResponses, err
Votes: nil,
},
ByzantineValidators: nil,
//ConsensusMessages: block.Data.ConsensusMessages,
ConsensusMessages: block.Data.ConsensusMessages,
})
if err != nil {
return nil, err
Expand Down
15 changes: 7 additions & 8 deletions block/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ func SubmitLoopInner(
// 'trigger': this thread is responsible for waking up the submitter when a new block arrives, and back-pressures the block production loop
// if it gets too far ahead.
for {
select {
case <-ctx.Done():
return ctx.Err()
case n := <-bytesProduced:
pendingBytes.Add(uint64(n))
logger.Debug("Added bytes produced to bytes pending submission counter.", "bytes added", n, "pending", pendingBytes.Load())
}
if maxBatchSkew < skewTime() {
// too much stuff is pending submission
// we block here until we get a progress nudge from the submitter thread
Expand All @@ -70,14 +77,6 @@ func SubmitLoopInner(
return ctx.Err()
case <-trigger.C:
}
} else {
select {
case <-ctx.Done():
return ctx.Err()
case n := <-bytesProduced:
pendingBytes.Add(uint64(n))
logger.Debug("Added bytes produced to bytes pending submission counter.", "bytes added", n, "pending", pendingBytes.Load())
}
}

types.RollappPendingSubmissionsSkewBytes.Set(float64(pendingBytes.Load()))
Expand Down

0 comments on commit 58adc23

Please sign in to comment.