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

Enhanced IPv6 support (discovery) #8410

Merged
merged 7 commits into from
Jul 1, 2024

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Jun 26, 2024

PR Description

  • Add --Xp2p-udp-port-ipv6 and --Xp2p-advertised-udp-port-ipv6
  • Upgrade discovery to 24.6.0
  • return Optional<List<String>> in DiscV5Service.getDiscoveryAddress

This PR doesn't break any current functionality and everything else is hidden.

Fixed Issue(s)

related to #8069

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@@ -36,8 +36,10 @@ public class NodeRecordConverter {

public Optional<DiscoveryPeer> convertToDiscoveryPeer(
final NodeRecord nodeRecord, final SchemaDefinitions schemaDefinitions) {
// TODO: https://github.com/Consensys/teku/issues/8069
Copy link
Contributor

Choose a reason for hiding this comment

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

Not clear why it's needed here
We get tcp6 in or here, isn't it not enough? We need list here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be fair, probably or is enough. It's just that in this case, if we are dual-stack, we would always try to connect to IPv4 when ideally we would prefer IPv6

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will tackle in future PR

Copy link
Contributor

Choose a reason for hiding this comment

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

So my message was in case if someone other will take it in future, I want it to be clear for anyone else, what do we want there ideally

final boolean userExplicitlySetAdvertisedIpOrPort, final int advertisedTcpPort) {
if (userExplicitlySetAdvertisedIpOrPort) {
private NewAddressHandler maybeUpdateNodeRecord(final NetworkConfig p2pConfig) {
if (p2pConfig.hasUserExplicitlySetAdvertisedIps()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this, shouldn't it be inversed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same behaviour as before. If user explicitly sets advertised IPs, they are added in the ENR. Otherwise, NewAddressHandler is communicated between nodes who don't have explicit advertised ips, in that case, we want to have a handler configured in discovery

Copy link
Contributor

Choose a reason for hiding this comment

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

Needed to look into discovery to understand. So it fires when user address is changed and when advertised is configured it means that we should prefer advertised over anything changed, clear now

Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

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

LGTM

@StefanBratanov StefanBratanov enabled auto-merge (squash) July 1, 2024 18:20
@StefanBratanov StefanBratanov merged commit 69bf93f into Consensys:master Jul 1, 2024
15 of 16 checks passed
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.

2 participants