Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func (m *Manager) publishBlockInternal(ctx context.Context) error {
m.logger.Info("no batch retrieved from sequencer, skipping block production")
return nil
}
m.logger.Debug("creating empty block, height: ", newHeight)
m.logger.Info("creating empty block, height: ", newHeight)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other log statements in this file and for better machine-readability, it's best to use structured logging with key-value pairs instead of concatenating values into the message string.

Suggested change
m.logger.Info("creating empty block, height: ", newHeight)
m.logger.Info("creating empty block", "height", newHeight)

} else {
m.logger.Warn("failed to get transactions from batch", "error", err)
return nil
Expand All @@ -665,8 +665,7 @@ func (m *Manager) publishBlockInternal(ctx context.Context) error {
if batchData.Before(lastHeaderTime) {
return fmt.Errorf("timestamp is not monotonically increasing: %s < %s", batchData.Time, m.getLastBlockTime())
}
m.logger.Info("creating and publishing block", "height", newHeight)
m.logger.Debug("block info", "num_tx", len(batchData.Transactions))
m.logger.Info("creating and publishing block", "height", newHeight, "num_tx", len(batchData.Transactions))
}

header, data, err = m.createBlock(ctx, newHeight, lastSignature, lastHeaderHash, batchData)
Expand Down
2 changes: 1 addition & 1 deletion block/submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func submitToDA[T any](
// Record successful DA submission
m.recordDAMetrics("submission", DAModeSuccess)

m.logger.Info(fmt.Sprintf("successfully submitted %s to DA layer", itemType), "gasPrice", gasPrice, "count", res.SubmittedCount)
m.logger.Info(fmt.Sprintf("successfully submitted %s to DA layer with gasPrice %v and count %d", itemType, gasPrice, res.SubmittedCount))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change moves away from structured logging by formatting all values into the message string. Structured logging with key-value pairs is generally preferred as it makes logs easier to parse, query, and analyze automatically. The previous implementation was better in this regard.

To maintain structured logging and improve consistency, consider using a static message and passing all dynamic values as key-value pairs.

Suggested change
m.logger.Info(fmt.Sprintf("successfully submitted %s to DA layer with gasPrice %v and count %d", itemType, gasPrice, res.SubmittedCount))
m.logger.Info("successfully submitted to DA layer", "itemType", itemType, "gasPrice", gasPrice, "count", res.SubmittedCount)

if res.SubmittedCount == uint64(remLen) {
submittedAll = true
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/run_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func SetupLogger(config rollconf.LogConfig) logging.EventLogger {

logging.SetupLogging(logCfg)

// Suppress noisy external component logs by setting them to FATAL level
_ = logging.SetLogLevel("header/store", "FATAL")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do something to force debug mode on all in order to help with debugging. Something could be hidden in the logs and this would hide it

@Manav-Aggarwal Manav-Aggarwal Jul 25, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified it to only supress this by default and enable them if debug logging is enabled in 3243175

_ = logging.SetLogLevel("header/sync", "FATAL")
_ = logging.SetLogLevel("header/p2p", "FATAL")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The repeated calls to logging.SetLogLevel can be made more maintainable and robust by using a loop. Also, the errors are currently ignored. While an error is unlikely with hardcoded values, it's safer to handle it. A panic is appropriate here since this is part of the initial setup, and a failure to set log levels should be considered a critical startup failure.

noisyComponents := []string{"header/store", "header/sync", "header/p2p"}
for _, component := range noisyComponents {
	if err := logging.SetLogLevel(component, "FATAL"); err != nil {
		// This is a developer error, so we should panic.
		panic(fmt.Sprintf("failed to set log level for %q: %s", component, err))
	}
}


// Return a logger instance for the "main" subsystem
return logging.Logger("main")
}
Expand Down