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

Node/P2P: Add protected peers list #4292

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bruce-riley
Copy link
Contributor

@bruce-riley bruce-riley commented Mar 4, 2025

This PR adds the ability to specify a set of P2P peer IDs that should be added to the protected list.

Guardian

This is done for the guardian with something like this:

--protectedPeers 12D3KooWE4dmZwxhfjCKHLUqSaww96Cf7kmq1ZuKmzPz3MrJgZxp,12D3KooWMkxuNh1abxCRjsfNZ9D2C8ZgcsQ4xxbXBuuqdxVRbasu \
--protectedPeers 12D3KooWCW3LGUtkCVkHZmVSZHzL3C4WRKWfqAiJPz1NR7dT9Bxh,12D3KooWJXA6goBCiWM8ucjzc4jVUBSqL9Rri6UpjHbkMPErz5zK \
--ccqProtectedPeers 12D3KooWE4dmZwxhfjCKHLUqSaww96Cf7kmq1ZuKmzPz3MrJgZxp,12D3KooWMkxuNh1abxCRjsfNZ9D2C8ZgcsQ4xxbXBuuqdxVRbasu \
--ccqProtectedPeers  12D3KooWCW3LGUtkCVkHZmVSZHzL3C4WRKWfqAiJPz1NR7dT9Bxh,12D3KooWJXA6goBCiWM8ucjzc4jVUBSqL9Rri6UpjHbkMPErz5zK \

Note that there can be multiple instances of the same parameter, and each instance may contain either a single peer ID or a comma separated list of them.

Spy and CCQ proxy Server

The Spy and the CCQ proxy Server also support the --protectedPeers parameter.

evan-gray
evan-gray previously approved these changes Mar 4, 2025
Copy link
Contributor

@evan-gray evan-gray left a comment

Choose a reason for hiding this comment

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

Concur this parameter follows the pattern of something like https://docs.anza.xyz/operations/setup-an-rpc-node. My understanding is that this would optionally inform the connection manager to maintain connections to these peer IDs should the number of connections grow past the high watermark. It is akin to the automatic code that does this based on guardian heartbeats here.

@bruce-riley bruce-riley requested a review from lrogana March 4, 2025 19:36
@bruce-riley bruce-riley marked this pull request as ready for review March 4, 2025 19:36
@evan-gray evan-gray force-pushed the node/p2p_add_protected_peers_list branch from 5231728 to d7b1e54 Compare March 4, 2025 20:06
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.

4 participants