-
Notifications
You must be signed in to change notification settings - Fork 284
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
Enable enr field in GetPeers and GetPeerById #8641
Conversation
* spotless * fix compiler warns * make tests compile
* Add DiscoveryPeer.getNodeId() * Use the correct NodeId (from Discovery) instead of wrong Libp2p PeerId when calculating DAS subnets * Add Eth2Peer.getDiscoveryNodeId() method.
@@ -139,6 +144,18 @@ public Eth2P2PNetwork build() { | |||
// Setup eth2 handlers | |||
final SubnetSubscriptionService attestationSubnetService = new SubnetSubscriptionService(); | |||
final SubnetSubscriptionService syncCommitteeSubnetService = new SubnetSubscriptionService(); | |||
|
|||
// TODO a bit hacky solution, subject to be refactored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also would prefer to not have 'hacky solution' in a comment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's draft yet, it was PoC, I wanted to check if it works first, because it's not very straightforward
LibP2PPeer libP2PPeer = (LibP2PPeer) peer; | ||
PubKey libP2PPubKey = libP2PPeer.getPubKey(); | ||
Bytes discoveryNodeIdBytes = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd also at least want finals... i'd probably just make this a private function that gives a response, or package private and we can easily test it then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice idea, thank you!
@@ -34,6 +37,16 @@ | |||
public class NodeRecordConverter { | |||
private static final Logger LOG = LogManager.getLogger(); | |||
|
|||
public Bytes convertPublicKeyToNodeId(final Bytes publicKey) { | |||
// TODO need to open an additional API in discovery instead of this hack | |||
NodeRecord tempNodeRecord = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. i haven't explicitly run it to see it working, but as long as you have im happy...
* Expose discovery NodeId to DiscoveryPeer and LibP2PPeer (Consensys#38) * Add DiscoveryPeer.getNodeId() * Add Eth2Peer.getDiscoveryNodeId() method. * Refactoring, discovery updated to 24.9.1 --------- Co-authored-by: Anton Nashatyrev <Nashatyrev@users.noreply.github.com>
* Expose discovery NodeId to DiscoveryPeer and LibP2PPeer (#38) * Add DiscoveryPeer.getNodeId() * Add Eth2Peer.getDiscoveryNodeId() method. * Refactoring, discovery updated to 24.9.1 --------- Co-authored-by: Anton Nashatyrev <Nashatyrev@users.noreply.github.com>
PR Description
Fixed Issue(s)
Fixes #7473
Documentation
doc-change-required
label to this PR if updates are required.Changelog