Skip to content

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Nov 27, 2025

Summary of changes

Changes introduced in this pull request:

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.

Summary by CodeRabbit

  • Chores
    • Expanded default network listening interfaces to include both TCP and QUIC v1 UDP protocols for improved connectivity options.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

The default listening addresses for Libp2pConfig have been expanded to include both TCP and QUIC v1 UDP interfaces instead of only TCP. A corresponding test module verifies the updated default configuration.

Changes

Cohort / File(s) Summary
Configuration defaults and test
src/libp2p/config.rs
Expanded default listening_multiaddrs from single TCP address to include both TCP and QUIC v1 UDP addresses; added test module under #[cfg(test)] to validate Libp2pConfig::default().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Single file with straightforward configuration value expansion
  • Added test is a simple verification of defaults
  • No complex logic or control flow changes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately describes the main change: expanding default Libp2pConfig listening addresses to include QUIC protocol alongside TCP.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/p2p-listen-quic

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

@hanabi1224 hanabi1224 marked this pull request as ready for review November 27, 2025 12:35
@hanabi1224 hanabi1224 requested a review from a team as a code owner November 27, 2025 12:35
Copy link
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: 0

🧹 Nitpick comments (2)
src/libp2p/config.rs (2)

41-44: QUIC v1 default listen address looks good; consider updating the field doc

The added "/ip4/0.0.0.0/udp/0/quic-v1" entry cleanly achieves “listen on QUIC by default” while preserving the existing TCP default. One minor follow‑up: the listening_multiaddrs doc comment above still says “TCP and WebSocket with DNS are supported”, which is now slightly misleading—might be worth mentioning QUIC there to keep code docs in sync with behavior.


53-60: Strengthen config_default test to assert the actual defaults

Right now the test only checks that Libp2pConfig::default() doesn’t panic. It would be more useful to assert that the default actually exposes both TCP and QUIC listen addrs (and possibly other key defaults), so future changes don’t silently regress the behavior this PR is introducing.

For example:

 #[test]
 fn config_default() {
-    let _ = Libp2pConfig::default();
+    let cfg = Libp2pConfig::default();
+
+    assert_eq!(
+        cfg.listening_multiaddrs,
+        vec![
+            "/ip4/0.0.0.0/tcp/0".parse().expect("Infallible"),
+            "/ip4/0.0.0.0/udp/0/quic-v1".parse().expect("Infallible"),
+        ]
+    );
 }

This keeps the test small but makes it actually guard the new default. Based on learnings, this matches your preference for fail‑fast, explicit defaults.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9796a6e and 0e8d0bb.

📒 Files selected for processing (1)
  • src/libp2p/config.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6057
File: src/cli/subcommands/f3_cmd.rs:0-0
Timestamp: 2025-09-09T10:37:17.947Z
Learning: hanabi1224 prefers having default timeouts (like 10m for --no-progress-timeout) to prevent commands from hanging indefinitely, even when the timeout flag isn't explicitly provided by users. This fail-fast approach is preferred over requiring explicit flag usage.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Calibnet eth mapping check
  • GitHub Check: Diff snapshot export checks
  • GitHub Check: Calibnet check
  • GitHub Check: Forest CLI checks
  • GitHub Check: V2 snapshot export checks
  • GitHub Check: Bootstrap checks - Forest
  • GitHub Check: tests-release
  • GitHub Check: Build forest binaries on Linux AMD64

@hanabi1224 hanabi1224 added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit e373a21 Nov 28, 2025
46 checks passed
@hanabi1224 hanabi1224 deleted the hm/p2p-listen-quic branch November 28, 2025 12:19
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