Skip to content
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

Reduce Log Level For Leader Behind Follower Case #1066

Closed
wants to merge 1 commit into from

Conversation

gabriel-aranha-cw
Copy link
Contributor

@gabriel-aranha-cw gabriel-aranha-cw commented Jun 11, 2024

Reducing the Log Level from ERROR to WARN for the Leader is Behind follower message. As it is now, the current implementation makes the follower nodes pull the blocks from Substrate instead of the Leader node. This will log the message very frequently and will only be reduced in a future enhancement when the follower nodes start receiving the entries from the leader node directly.

@gabriel-aranha-cw gabriel-aranha-cw requested a review from a team as a code owner June 11, 2024 17:50
Copy link

PR Reviewer Guide 🔍

⏱️ Estimated effort to review [1-5]

1

🧪 Relevant tests

No

🔒 Security concerns

No

⚡ Key issues to review

None

Copy link

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Best practice
Convert the log message to use structured logging

Consider using structured logging for better traceability and filtering. Instead of
formatting the log message directly, use key-value pairs to log the data.

src/eth/consensus/mod.rs [778-781]

 tracing::warn!(
-    "leader is behind follower: arrived_block: {}, header_block: {}",
-    last_last_arrived_block_number,
-    header.number
+    "leader is behind follower",
+    arrived_block = last_last_arrived_block_number,
+    header_block = header.number
+);
 
Suggestion importance[1-10]: 9

Why: The suggestion to use structured logging improves traceability and filtering, which is a best practice for logging. This change enhances the maintainability and readability of the log messages.

9

@gabriel-aranha-cw gabriel-aranha-cw deleted the reduce-log-level branch June 11, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant