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

Add P2P gossip_bp_peer message #1245

Open
heifner opened this issue Mar 7, 2025 · 0 comments · May be fixed by #1265
Open

Add P2P gossip_bp_peer message #1245

heifner opened this issue Mar 7, 2025 · 0 comments · May be fixed by #1265
Assignees
Labels
👍 lgtm OCI Work exclusive to OCI team

Comments

@heifner
Copy link
Member

heifner commented Mar 7, 2025

Add new gossip_bp_peer message for sending bp peer connection information.

P2P: Auto-management of Private BP connections

The current p2p-auto-bp-peer feature is not useful for Savanna consensus as it only maintains connections to immediate BPs in the schedule. With Savanna consensus, connection to all finalizers (currently BPs) is required. See #1227, fixed by #1244.

  • Update p2p-auto-bp-peer to maintain connections to the top 21 BPs.

    • Continues to tracks proposer schedule to know which peer keys are currently active.
    • If at least one configured p2p-auto-bp-peer then the feature is activated. The p2p-auto-bp-peer list is used to bootstrap the process. p2p-peer-address entries will also be included if they are bp peers; established by the gossip_bp_peer handshake.
  • Add gossip of connections to verifiable BP peers.

  • New P2P gossip message

    • struct gossip_bp_peers {
         struct bp_peer {
            eosio::name producer_name;
            std::string server_address;
            // sig over [producer_name, server_address]
            signature sig;
         };
         std::vector<bp_peer> peers;
      };
      
    • Configured p2p-signature-provider will verify received gossip_bp_peers and send out gossip_bp_peers if any new peers received.
    • gossip_bp_peers message only sent to verified gossip bp peers.
    • Any bp_peer entry where all peers can't be connected to and verified as a bp peer is dropped from tracked state. This is how no longer valid bp_peer entries are removed.
    • The server_address allows for one BP to have a number of peers and backup peers. A limit of 4 bp_peer entries is allowed per producer_name. The server_address acts to distinguish between them.
  • p2p-peer-address peers will also be used for bootstrapping as long as one p2p-auto-bp-peer is configured and will always be connected; subject to the p2p-peer-limit. The p2p-peer-limit only applies to p2p-peer-address, not to gossip bp peers.

    • Connection flow:
      • If configured with p2p-signature-provider and p2p-auto-bp-peer then send a signed empty gossip_bp_peer.
        • If peer receives a gossip_bp_peers with new information it will send the new merged gossip_bp_peers to all of its previously verified bp gossip peers.
  • Gossip peers will remain connected when the associated proposer/finalizer is in the top 21.

  • When a p2p-auto-bp-peer rotates into the the top 21 then it will connect to its p2p-auto-bp-peers and send an empty gossip_bp_peers to have current gossip_bp_peers sent back to it.

  • When a node rotates out of the top 21 then peers will disconnect from it unless they explicitly connected via p2p-peer-address. Also the bp peer that rotated out will itself disconnect from any bp peers and wait to be rotated back in before participating in the bp peer gossip.

  • The on-chain peer list can be queried every block. If a version can be quickly queried this is likely the easiest and quickest method. Only bp peer nodes need to make this state query. See Retrieval of peers public keys from chainbase db. #1228.

@heifner heifner self-assigned this Mar 7, 2025
@heifner heifner added OCI Work exclusive to OCI team and removed triage labels Mar 7, 2025
@enf-ci-bot enf-ci-bot moved this to Todo in Team Backlog Mar 7, 2025
@heifner heifner moved this from Todo to In Progress in Team Backlog Mar 12, 2025
@heifner heifner added this to the Spring v1.2.0-rc1 milestone Mar 12, 2025
heifner added a commit that referenced this issue Mar 12, 2025
heifner added a commit that referenced this issue Mar 12, 2025
heifner added a commit that referenced this issue Mar 12, 2025
heifner added a commit that referenced this issue Mar 17, 2025
…er than anything in net_plugin. Empty p2p-server-address should not be allowed.
heifner added a commit that referenced this issue Mar 19, 2025
heifner added a commit that referenced this issue Mar 19, 2025
heifner added a commit that referenced this issue Mar 21, 2025
heifner added a commit that referenced this issue Mar 21, 2025
heifner added a commit that referenced this issue Mar 21, 2025
heifner added a commit that referenced this issue Mar 21, 2025
heifner added a commit that referenced this issue Mar 21, 2025
…peers

Update to latest system contract changes.
heifner added a commit that referenced this issue Mar 21, 2025
@heifner heifner linked a pull request Mar 21, 2025 that will close this issue
@heifner heifner linked a pull request Mar 21, 2025 that will close this issue
heifner added a commit that referenced this issue Mar 25, 2025
heifner added a commit that referenced this issue Mar 25, 2025
heifner added a commit that referenced this issue Mar 26, 2025
heifner added a commit that referenced this issue Mar 26, 2025
heifner added a commit that referenced this issue Mar 26, 2025
greg7mdp added a commit that referenced this issue Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 lgtm OCI Work exclusive to OCI team
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants