-
Notifications
You must be signed in to change notification settings - Fork 34
Description
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-peerto 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-peerthen the feature is activated. Thep2p-auto-bp-peerlist is used to bootstrap the process.p2p-peer-addressentries will also be included if they are bp peers; established by thegossip_bp_peerhandshake.
-
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-providerwill verify receivedgossip_bp_peersand send outgossip_bp_peersif any new peers received. gossip_bp_peersmessage only sent to verified gossip bp peers.- Any
bp_peerentry where all peers can't be connected to and verified as a bp peer is dropped from tracked state. This is how no longer validbp_peerentries are removed. - The
server_addressallows for one BP to have a number of peers and backup peers. A limit of 4bp_peerentries is allowed per producer_name. Theserver_addressacts to distinguish between them.
-
-
p2p-peer-addresspeers will also be used for bootstrapping as long as onep2p-auto-bp-peeris configured and will always be connected; subject to thep2p-peer-limit. Thep2p-peer-limitonly applies top2p-peer-address, not to gossip bp peers.- Connection flow:
- If configured with
p2p-signature-providerandp2p-auto-bp-peerthen send a signed emptygossip_bp_peer.- If peer receives a
gossip_bp_peerswith new information it will send the new merged gossip_bp_peers to all of its previously verified bp gossip peers.
- If peer receives a
- If configured with
- Connection flow:
-
Gossip peers will remain connected when the associated proposer/finalizer is in the top 21.
-
When a
p2p-auto-bp-peerrotates into the the top 21 then it will connect to itsp2p-auto-bp-peers and send an emptygossip_bp_peersto have currentgossip_bp_peerssent 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status