AntelopeIO / leap

C++ implementation of the Antelope protocol
Other
116 stars 68 forks source link

Nodeos option to auto-peer based on BP schedule #716

Closed bhazzard closed 1 year ago

bhazzard commented 1 year ago

User Story: As a Block Producer, I want a nodeos option to auto-peer based on the BP schedule, so that I can minimize latency with the node before me in the schedule and avoid late starts.

Context: A Block Producer may get a late start in building blocks for a round, due to latency in receiving blocks from the BP that falls prior to them in the BP schedule. When a BP gets a late start, they risk being forced to miss a block or broadcast an empty block.

To optimize latency and minimize late starts, BPs want a reliable way to:

So, in addition to the manual peer configuration, there should be a configuration option to automatically peer based on the BP schedule to minimize late starts.

Requirements:

bhazzard commented 1 year ago

This issue is to implement a solution for Product-129.

bhazzard commented 1 year ago

@heifner and @huangminghuang here is the Antelope issue for the auto-peering feature we discussed last week.

greg7mdp commented 1 year ago

If all the block producers use this option, does it mean that when a block producer is added to the schedule, it will receive a volley of connection requests from all the other bp nodes? Is there a guarantee that it will even accept these peering requests (what if it has already reached its own max-peer number)?

huangminghuang commented 1 year ago

If all the block producers use this option, does it mean that when a block producer is added to the schedule, it will receive a volley of connection requests from all the other bp nodes? Is there a guarantee that it will even accept these peering requests (what if it has already reached its own max-peer number)?

No, only the immediate two upstream block producers in the schedule will try to make connections to a producer node in the scheduling list. All the BP peer connections are not subject to the max_client_count limit.

greg7mdp commented 1 year ago

Thanks @huangminghuang , this makes perfect sense.