-
Notifications
You must be signed in to change notification settings - Fork 182
chore(p2p): listen on quic protocol by default #6266
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
WalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5–10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
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.
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 docThe 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: thelistening_multiaddrsdoc 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: Strengthenconfig_defaulttest to assert the actual defaultsRight 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
📒 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
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.