Skip to content

chore: downgrade dup msg log#6884

Merged
LesnyRumcajs merged 2 commits intomainfrom
downgrade-dup-msg-logs
Apr 9, 2026
Merged

chore: downgrade dup msg log#6884
LesnyRumcajs merged 2 commits intomainfrom
downgrade-dup-msg-logs

Conversation

@LesnyRumcajs
Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs commented Apr 9, 2026

Summary of changes

Duplicates are not really errors. We republish messages on new tipsets, but if they are already there it shouldn't trigger an error log.

See https://github.com/libp2p/go-libp2p-pubsub/blob/ed53c170f9a784c45f81d88dd6051218fbd5ece7/topic.go#L240-L242

Changes introduced in this pull request:

  • downgrade duplicate message error log to debug

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Chores
    • Reduced log noise by lowering duplicate network-publish messages to debug level.
    • Improved wording and detail for other publish error logs so remaining warnings are clearer and more informative.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner April 9, 2026 08:56
@LesnyRumcajs LesnyRumcajs requested review from akaladarshi and hanabi1224 and removed request for a team April 9, 2026 08:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 506fed9b-d3e9-4690-bf83-e1528843250c

📥 Commits

Reviewing files that changed from the base of the PR and between bd0d757 and 2cf4a77.

📒 Files selected for processing (1)
  • src/libp2p/service.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/libp2p/service.rs

Walkthrough

Replace a single if let Err(e) logging branch for gossipsub publish failures with a match that logs PublishError::Duplicate at debug! and other publish errors at warn! using {e:#}; successful publishes are ignored.

Changes

Cohort / File(s) Summary
Gossipsub publish handling
src/libp2p/service.rs
Replaced if let Err(e) publish error branch with match publish(...): explicitly debug!-logs PublishError::Duplicate with a “duplicate” message; other errors are warn!-logged using {e:#}; successful publishes have no log.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • hanabi1224
  • sudo-shashank
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: downgrade dup msg log' directly and clearly describes the main change: downgrading the log level for duplicate messages from warn to debug.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch downgrade-dup-msg-logs
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch downgrade-dup-msg-logs

Comment @coderabbitai help to get the list of available commands and usage tips.

hanabi1224
hanabi1224 previously approved these changes Apr 9, 2026
@LesnyRumcajs LesnyRumcajs enabled auto-merge April 9, 2026 08:58
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libp2p/service.rs`:
- Around line 446-447: The current publish error is always logged at debug
level; instead match the gossipsub::PublishError returned by
swarm.behaviour_mut().publish(...) and only treat PublishError::Duplicate as
debug, while logging all other variants (SigningError, MessageTooLarge,
TransformFailed, AllQueuesFull, etc.) at warn! (or higher). Update the code
around swarm.behaviour_mut().publish(topic, message) to pattern-match the Err(e)
into gossipsub::PublishError and call debug! for Duplicate but warn! for any
other variant so real networking/configuration issues remain visible.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c161ae80-82e7-4b19-8c96-605f51dd4520

📥 Commits

Reviewing files that changed from the base of the PR and between cb7a74a and bd0d757.

📒 Files selected for processing (1)
  • src/libp2p/service.rs

Comment thread src/libp2p/service.rs Outdated
sudo-shashank
sudo-shashank previously approved these changes Apr 9, 2026
@LesnyRumcajs LesnyRumcajs disabled auto-merge April 9, 2026 09:03
@LesnyRumcajs LesnyRumcajs dismissed stale reviews from sudo-shashank and hanabi1224 via 2cf4a77 April 9, 2026 09:12
@LesnyRumcajs LesnyRumcajs enabled auto-merge April 9, 2026 09:12
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.59%. Comparing base (7f70997) to head (2cf4a77).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/libp2p/service.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/libp2p/service.rs 12.26% <0.00%> (-0.05%) ⬇️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb7a74a...2cf4a77. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit 160617b Apr 9, 2026
46 checks passed
@LesnyRumcajs LesnyRumcajs deleted the downgrade-dup-msg-logs branch April 9, 2026 09:58
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.

3 participants