[Libp2p] Use native Libp2p multiaddresses #3714
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
Changes Libp2p to use native multiaddressing. This allows us to use DNS and IPv6 entries directly instead of (for DNS) resolving it at runtime and using the resolved address.
This prevents the node from failing to start if the DNS entry does not yet exist, and also prevents the local resolution of a cloud address causing issues (e.g.
espresso.node
resolving to some AWS-local IP). It also allows for node addresses to be automatically updated through just changing the DNS entry.To do this, we introduce the function
derive_libp2p_multiaddress
which derives the proper Multiaddress from a string. It supports IPv4, IPv6, and FQDNs. In the event that the configured FQDN does not exist, it will warn the user but still allow the node to start. It also includes testing for expected functionality.Also does some cleanup, like removing the need for an orchestrator client to be created from
ValidatorArgs
This PR does not:
Make any protocol-breaking changes
Key places to review:
derive_libp2p_multiaddress
How to test this PR:
I have already tested this in the sequencer and it works as expected