Add Support for Trusted Nodes in P2P Host #4777
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.
Description
This PR implements support for trusted nodes for the P2P Host, allowing the nodes to maintain more reliable and secure connections. By introducing the concept of trusted nodes, we can now designate certain peers as trusted, which ensures that they are prioritized during connection management. These trusted nodes are handled separately from the general peer pool, improving both the performance and stability of crucial network functions by maintaining consistent connectivity with key, verified peers. This reduces the risk of interacting with potentially malicious peers, thereby bolstering the overall security of the network. Trusted nodes are added via a configurable list, which can be defined through configuration files.
The PR is tested with unit tests, but it has to be validated in dev-net with a combination of trusted and regular peers to ensure correct behavior.