-
Notifications
You must be signed in to change notification settings - Fork 245
fix: Modify Evolve node logging to remove noise #2496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @Manav-Aggarwal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on refining the logging output of the Evolve node to improve clarity and reduce unnecessary verbosity. My primary goal was to make the node's operational status more transparent to users by adjusting log levels and formatting, while suppressing verbose internal library logs that were cluttering the console.
Highlights
- Log Noise Reduction: I've suppressed excessive logging from the
go-headerlibrary'sheader/store,header/sync, andheader/p2pmodules by setting their log level toFATAL. This significantly reduces the amount of noise in the Evolve node's console output. - Improved Block Production Visibility: I've elevated the 'creating empty block' log message from
DEBUGtoINFOlevel. This allows users to easily track block production and the current block height, even when there's no user activity on the node. - Enhanced DA Submission Logging: I've corrected the formatting of the 'successfully submitted to DA layer' log message. It now presents
gasPriceandcountmore clearly within a single, formatted log string, improving readability.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively reduces log noise by suppressing logs from external components and improves visibility by adjusting log levels. The changes are well-targeted. I've provided a few suggestions to further improve logging practices for consistency and to make the log level setup more robust and maintainable. Overall, this is a solid improvement.
pkg/cmd/run_node.go
Outdated
| _ = logging.SetLogLevel("header/store", "FATAL") | ||
| _ = logging.SetLogLevel("header/sync", "FATAL") | ||
| _ = logging.SetLogLevel("header/p2p", "FATAL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 nil | ||
| } | ||
| m.logger.Debug("creating empty block, height: ", newHeight) | ||
| m.logger.Info("creating empty block, height: ", newHeight) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| m.logger.Info("creating empty block, height: ", newHeight) | |
| m.logger.Info("creating empty block", "height", newHeight) |
| 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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) |
pkg/cmd/run_node.go
Outdated
| logging.SetupLogging(logCfg) | ||
|
|
||
| // Suppress noisy external component logs by setting them to FATAL level | ||
| _ = logging.SetLogLevel("header/store", "FATAL") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2496 +/- ##
==========================================
+ Coverage 73.18% 73.23% +0.04%
==========================================
Files 69 69
Lines 6564 6568 +4
==========================================
+ Hits 4804 4810 +6
+ Misses 1363 1361 -2
Partials 397 397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Claude finished @Manav-Aggarwal's task —— View job Code Review for PR #2496I'll review this pull request for code quality, potential issues, performance, security, and test coverage. Todo List:
Analysis Summary:
Review Findings✅ Code Quality & Best PracticesGood Changes:
Areas for Improvement:
Specific Recommendations:
✅ Potential Bugs & IssuesNo Critical Issues Found, but minor concerns:
✅ Performance ConsiderationsNo Performance Impact:
✅ Security ConcernsNo Security Issues:
✅ Test CoverageNo Test Changes Needed:
Summary & RecommendationOverall Assessment: ✅ APPROVE with minor suggestions The PR successfully addresses the noise problem described in the issue. The conditional debug handling is particularly well thought out and addresses reviewer concerns about hiding important debug information. Key Strengths:
Suggested Improvements (non-blocking):
The changes align well with the project's logging architecture and don't introduce any functional risks. |
Overview
After #2416 was merged, the logging in evolve node included logs from the headerSyncService's p2p module, store module, and sync module via the go-header library. This caused a lot of noise in evolve node logs and shouldn't be enabled by default.
Also, made the
creating empty blocklog back to INFO level so a user can see that evolve node is producing blocks when during no user activity and see what block height the node is at.Also, fixes formatting issues with DA submission log.
https://www.loom.com/share/42b4be68bee74608b62cfdf07324a829?sid=4f889192-639b-477e-b5c6-fe941d6c7f70
Previously logging looked like this:
Logging now looks like this: