Skip to content

Remove libp2p multiaddress #8683

Open
jxs wants to merge 4 commits intosigp:unstablefrom
jxs:remove-libp2p-multiaddress
Open

Remove libp2p multiaddress #8683
jxs wants to merge 4 commits intosigp:unstablefrom
jxs:remove-libp2p-multiaddress

Conversation

@jxs
Copy link
Member

@jxs jxs commented Jan 20, 2026

After a user reported on Discord reported having problems starting Lighthouse with discovery disabled and providing --boot-nodes
I noticed that when a bootnode is provided as ENR lighthouse connects to it directly using libp2p, when a bootnode is a multiaddress it needs to be a UDP multiaddress so that Lighthouse uses Discovery to fetch that node's ENR.
But then later when bootstrapping libp2p, Lighthouse tries to dial those multiaddresses directly from libp2p if they are TCP, thing is, they won't be, as that was not allowed when the config was parsed.
Lighthouse also supports libp2p-nodes config flag that dials the addresses provided in the same way as when providing a valid ENR.

This PR basically removes the --libp2p-nodes flag and uniforms on boot-nodes flag allowing users to pass TCP multiaddresses with the --boot-nodes flag

@jxs jxs requested review from ackintosh and dknopik January 20, 2026 17:45
@jxs jxs force-pushed the remove-libp2p-multiaddress branch from 694abe9 to 00b8194 Compare January 20, 2026 17:47
Copy link
Member

@ackintosh ackintosh left a comment

Choose a reason for hiding this comment

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

Thanks @jxs for the cleanup! ✨ Looks good to me.

One small thought: how about having a deprecation period for the --libp2p-nodes flag to preserve CLI compatibility? We usually do this for CLI changes -- keeping the old flag as an alias, emitting a warning when used ( e.g. the --logfile deprecation in #7723).

@ackintosh ackintosh added the ready-for-review The code is ready for review label Jan 21, 2026
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

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

This looks clean. I had no idea we accepted multiaddrs in boot-nodes as well.
Agree with @ackintosh about the deprecation instead of delete. I think some existing infra might depend on the flag.

…overy

  disabled

  - Filter multiaddrs to only those with UDP and P2P protocols required for discv5
  - Add warning when discovery is disabled but discv5-eligible boot-node multiaddrs
   are provided
@ackintosh
Copy link
Member

@jxs @pawanjay176 Also, I've filed a PR to improve the UX for the case where a user specifies a UDP multiaddr with --boot-nodes together with --disable-discovery. It would be great if you could take a look when you have some time.

jxs#6

…tosh

Filter boot-node multiaddrs for discv5 eligibility
Copy link
Member Author

@jxs jxs left a comment

Choose a reason for hiding this comment

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

addressed Akihito's suggestion and re-introduced the flag with deprecation notice, PTAL

@jxs jxs requested review from ackintosh and pawanjay176 January 29, 2026 12:29
@jxs jxs force-pushed the remove-libp2p-multiaddress branch from 83fd1cd to f1b1b81 Compare January 29, 2026 12:46
Copy link
Member

@ackintosh ackintosh left a comment

Choose a reason for hiding this comment

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

Thanks @jxs!


// DEPRECATED: can be removed in v8.2.0./v9.0.0
if let Some(libp2p_addresses_str) = cli_args.get_one::<String>("libp2p-addresses") {
warn!("The --libp2p-nodes flag is deprecated and replaced by --boot-nodes");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
warn!("The --libp2p-nodes flag is deprecated and replaced by --boot-nodes");
warn!("The --libp2p-addresses flag is deprecated and replaced by --boot-nodes");

.value_name("MULTIADDR")
.help("One or more comma-delimited multiaddrs to manually connect to a libp2p peer \
without an ENR.")
without an ENR. DEPRECATED. The --libp2p-nodes flag is deprecated and replaced by --boot-nodes")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
without an ENR. DEPRECATED. The --libp2p-nodes flag is deprecated and replaced by --boot-nodes")
without an ENR. DEPRECATED. The --libp2p-addresses flag is deprecated and replaced by --boot-nodes")

--libp2p-addresses <MULTIADDR>
One or more comma-delimited multiaddrs to manually connect to a libp2p
peer without an ENR.
peer without an ENR. DEPRECATED. The --libp2p-nodes flag is deprecated
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
peer without an ENR. DEPRECATED. The --libp2p-nodes flag is deprecated
peer without an ENR. DEPRECATED. The --libp2p-addresses flag is deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants