-
Notifications
You must be signed in to change notification settings - Fork 689
XDC Discovery #11527
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
Open
batrr
wants to merge
9
commits into
master
Choose a base branch
from
feat/xdc-discovery
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+316
−138
Open
XDC Discovery #11527
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
659c481
feat: implement XDC discovery application and related handlers
batrr b349f84
feat: update message serialization and discovery handlers for XDC com…
batrr 59c8028
fix: revert newline at end of packages.lock.json
batrr 79f90cb
feat: update copyright year to 2026 and add XDC discovery tests
batrr 3adf017
Merge branch 'master' into feat/xdc-discovery
ak88 d333ab2
remove removed capabilities
ak88 e2f5ace
remove ENR from XDC
ak88 f79c9e0
feat: enhance XDC discovery configuration and update mainnet bootnodes
batrr 8ce1e95
Merge branch 'master' into feat/xdc-discovery
batrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/Nethermind/Nethermind.Xdc/Discovery/XdcDiscoveryApp.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| using Autofac.Features.AttributeFilters; | ||
| using DotNetty.Transport.Channels; | ||
| using Nethermind.Config; | ||
| using Nethermind.Core; | ||
| using Nethermind.Crypto; | ||
| using Nethermind.Db; | ||
| using Nethermind.Logging; | ||
| using Nethermind.Network; | ||
| using Nethermind.Network.Config; | ||
| using Nethermind.Network.Discovery; | ||
| using Nethermind.Network.Discovery.RoutingTable; | ||
|
|
||
| namespace Nethermind.Xdc.Discovery; | ||
|
|
||
| public class XdcDiscoveryApp( | ||
|
batrr marked this conversation as resolved.
|
||
| [KeyFilter(IProtectedPrivateKey.NodeKey)] IProtectedPrivateKey nodeKey, | ||
| INodesLocator nodesLocator, | ||
| IDiscoveryManager? discoveryManager, | ||
| INodeTable? nodeTable, | ||
| IMessageSerializationService? msgSerializationService, | ||
| ICryptoRandom? cryptoRandom, | ||
| [KeyFilter(DbNames.DiscoveryNodes)] INetworkStorage? discoveryStorage, | ||
| DiscoveryPersistenceManager discoveryPersistenceManager, | ||
| IProcessExitSource processExitSource, | ||
| INetworkConfig? networkConfig, | ||
| IDiscoveryConfig? discoveryConfig, | ||
| ITimestamper? timestamper, | ||
| ILogManager? logManager, | ||
| NodeFilter? inboundMessageFilter = null) | ||
| : DiscoveryApp(nodeKey, nodesLocator, discoveryManager, nodeTable, msgSerializationService, cryptoRandom, | ||
| discoveryStorage, discoveryPersistenceManager, processExitSource, networkConfig, discoveryConfig, | ||
| timestamper, logManager, inboundMessageFilter) | ||
| { | ||
| protected override NettyDiscoveryHandler CreateDiscoveryHandler(IChannel channel) => | ||
| new XdcNettyDiscoveryHandler(_discoveryManager, channel, _messageSerializationService, _timestamper, _logManager, _inboundMessageFilter); | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
src/Nethermind/Nethermind.Xdc/Discovery/XdcNettyDiscoveryHandler.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| using DotNetty.Transport.Channels; | ||
| using Nethermind.Core; | ||
| using Nethermind.Logging; | ||
| using Nethermind.Network; | ||
| using Nethermind.Network.Discovery; | ||
| using Nethermind.Network.Discovery.Messages; | ||
|
|
||
| namespace Nethermind.Xdc.Discovery; | ||
|
|
||
| public class XdcNettyDiscoveryHandler( | ||
| IDiscoveryMsgListener? discoveryManager, | ||
| IChannel? channel, | ||
| IMessageSerializationService? msgSerializationService, | ||
| ITimestamper? timestamper, | ||
| ILogManager? logManager, | ||
| NodeFilter? inboundMessageFilter = null) | ||
| : NettyDiscoveryHandler(discoveryManager, channel, msgSerializationService, timestamper, logManager, inboundMessageFilter) | ||
| { | ||
| protected override MsgType? FromMsgTypeByte(byte b) => b switch | ||
|
batrr marked this conversation as resolved.
|
||
| { | ||
| 2 => MsgType.Pong, | ||
| 3 => MsgType.FindNode, | ||
| 4 => MsgType.Neighbors, | ||
| 5 => MsgType.Ping, | ||
| _ => null | ||
| }; | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
src/Nethermind/Nethermind.Xdc/Discovery/XdcPingMsgSerializer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| using Autofac.Features.AttributeFilters; | ||
| using Nethermind.Crypto; | ||
| using Nethermind.Network.Discovery.Messages; | ||
| using Nethermind.Network.Discovery.Serializers; | ||
|
|
||
| namespace Nethermind.Xdc.Discovery; | ||
|
|
||
| public class XdcPingMsgSerializer : PingMsgSerializer | ||
| { | ||
| public XdcPingMsgSerializer(IEcdsa ecdsa, [KeyFilter(IProtectedPrivateKey.NodeKey)] IPrivateKeyGenerator nodeKey, INodeIdResolver nodeIdResolver) | ||
| : base(ecdsa, nodeKey, nodeIdResolver) => MsgTypeByte = 5; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.