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

Make ExternalAddressSelector pluggable #141

Conversation

Nashatyrev
Copy link
Contributor

PR Description

Currently there is no mean to set a fixed external advertised address if doesn't match the address seen by other discv5 nodes: the local node record is overridden due to Ping responses.

This PR makes ExternalAddressSelector pluggable so the client code could replace the default selector with NOOP or any other custom implementation

@ajsutton
Copy link
Contributor

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

I don't think we specifically need this to have a fixed IP, but it seems useful to make the logic for selecting the new address pluggable anyway, so LGTM.

@Nashatyrev
Copy link
Contributor Author

In Teku we enable/disable the automatic update of the ENR via the newAddressHandler https://github.com/ConsenSys/teku/blob/6b5d530cf7cb00527aeaef5a472eab64f2011c78/ne[…]pegasys/teku/networking/p2p/discovery/discv5/DiscV5Service.java

Oh, right! That could indeed do the trick.
Yep, let's anyway make this pluggable. Could be potentially of use later

@Nashatyrev Nashatyrev merged commit 3ebc4e9 into Consensys:master Feb 10, 2022
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