Skip to content

Commit ca746d0

Browse files
authored
chore: change error to debug when no batch to process (#1893)
Fixes #1892 1892 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced logging for the block creation and publishing process, improving visibility into transaction handling. - **Bug Fixes** - Refined error handling in the block publishing method to provide clearer context during transaction retrieval. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 41cdd7a commit ca746d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

block/manager.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,20 +1068,21 @@ func (m *Manager) publishBlock(ctx context.Context) error {
10681068
header = pendingHeader
10691069
data = pendingData
10701070
} else {
1071-
m.logger.Info("Creating and publishing block", "height", newHeight)
10721071
extendedCommit, err := m.getExtendedCommit(ctx, height)
10731072
if err != nil {
10741073
return fmt.Errorf("failed to load extended commit for height %d: %w", height, err)
10751074
}
10761075

10771076
txs, timestamp, err := m.getTxsFromBatch()
10781077
if err != nil {
1079-
return fmt.Errorf("failed to get transactions from batch: %w", err)
1078+
m.logger.Debug("waiting for transactions to include in block or empty batch", "height", newHeight, "details", err)
1079+
return nil
10801080
}
10811081
// sanity check timestamp for monotonically increasing
10821082
if timestamp.Before(lastHeaderTime) {
10831083
return fmt.Errorf("timestamp is not monotonically increasing: %s < %s", timestamp, m.getLastBlockTime())
10841084
}
1085+
m.logger.Info("Creating and publishing block", "height", newHeight)
10851086
header, data, err = m.createBlock(newHeight, lastSignature, lastHeaderHash, extendedCommit, txs, *timestamp)
10861087
if err != nil {
10871088
return err

0 commit comments

Comments
 (0)