helium/blockchain-core

Allow configuration of sync peers

Vagabond opened this issue · 3 comments

When syncing the whole chain, most nodes do not have the older blocks, so it would be useful when doing a full sync to have a set of "sync peers" the node would use to sync against that are known to have a complete chain.

I started something here that's meant to accomplish a similar goal, #1261

My work on using a configured list is on branch https://github.com/helium/blockchain-core/tree/jc/sync-peer-configuration-option, it looks like #1261 is about finding an appropriate oldest sync source height for the local node, which is definitely useful information. My work is on limiting sync to the selected group of peers. If we had a way to request/send the information gathered by your changes, we could combine these into an automated peer selection facility that would be significantly better than random.

My original intentions that I never did get around to implementing was to gossip the height around to the other nodes. It'd be collected in the peerbook kind of like the current_height is. It would then allow nodes to filter their peerbook to the peers with heights within range of their current sync. I can see where yours uses a pre configured list of peers to sync from. I'd agree if both got implemented syncing would be significantly better