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

[HOTFIX] fix boot node instability issue, refactor p2p host configurations and add new features #4674

Merged
merged 6 commits into from
May 24, 2024

Conversation

GheisMohammadi
Copy link
Contributor

@GheisMohammadi GheisMohammadi commented May 21, 2024

Issue

After upgrading the boot nodes to the latest version of the main branch, which includes several changes compared to the previous boot node code, the boot node service process began restarting repeatedly. This was accompanied by numerous error messages related to the QUIC protocol, noise, sessions, muxers, and various other lower layer P2P issues.

This PR addresses these issues by making the following changes:

  • Removes QUIC, an unnecessary feature, and switches to TCP transport.
  • Makes TLS/Noise, relays, and NAT optional features that can be disabled via configuration.
  • Adds a dial timeout for the connection manager.
  • Allows the use of the MPlex muxer in addition to Yamux.

Additionally, this PR introduces several new configurations and flags, detailed below:
NoTransportSecurity: to disable p2p security (tls and noise)
NAT: enable p2p NAT. NAT Manager takes care of setting NAT port mappings, and discovering external addresses
UserAgent: custom user agent; explicitly set the user-agent, so we can differentiate from other Go libp2p users
DialTimeout: p2p dial timeout
MuxerType: P2P multiplexer type (default:Mplex, 0:Mplex, 1:Yamux)
NoRelay: No relay services, direct connections between peers only

@GheisMohammadi GheisMohammadi added the libp2p Peer to Peer networking label May 21, 2024
@GheisMohammadi GheisMohammadi self-assigned this May 21, 2024
@GheisMohammadi GheisMohammadi changed the title [HOTFIX] fix boot node issue, refactor p2p host configurations and add new features [HOTFIX] fix boot node instability issue, refactor p2p host configurations and add new features May 21, 2024
@sophoah
Copy link
Contributor

sophoah commented May 22, 2024

hey @GheisMohammadi those new settings are advanced p2p configuration, can you please hide them in the config file ?

@sophoah sophoah changed the base branch from main to bootnode_fix May 22, 2024 09:07
@GheisMohammadi
Copy link
Contributor Author

hey @GheisMohammadi those new settings are advanced p2p configuration, can you please hide them in the config file ?

I believe they are needed to be customized by user. They can be adjusted based on the environment
NoTransportSecurity: User can decide to have TLS/Noise security. Sometimes that make instability, so user can disable it
NAT: This is useful to differentiate between boot node and normal validator node. Also for those servers running behind router
UserAgent: A custom agent name which each user can set to differentiate from other libp2p users
DialTimeout: A simple timeout, depends on how long make sense to wait for timeout
MuxerType: useful for boot node and the debugging and instability issues.
NoRelay: useful for boot node host and nodes can only talk directly to each other not tthrough the relays

@GheisMohammadi GheisMohammadi requested a review from mur-me May 23, 2024 14:34
@sophoah sophoah merged commit 05e696b into bootnode_fix May 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libp2p Peer to Peer networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants