koinos / koinos-p2p

The p2p microservice orchestrates the distribution of blocks and transactions between peers.
MIT License
6 stars 4 forks source link

Checkpoint enforcement during peer handshake #146

Closed mvandeberg closed 3 years ago

mvandeberg commented 3 years ago

As a node operator, I want to specify a checkpoint to guarantee my node syncs to a specific fork.

The checkpoint needs to consist of a block height and a block id.

Upon connecting to a new peer for sync, we ask the peer what their block id is at the checkpoint height. If they respond with the expected ID, we sync to them. If they respond with a different ID, we disconnect to them from sync and add them to the local blacklist.

theoreticalbts commented 3 years ago

Some notes:

theoreticalbts commented 3 years ago

The ticket and implementation only describes applying checkpoints as part of the handshake. So I'm going to edit the ticket title to better represent its actual scope.

sgerbino commented 3 years ago

We'll have to reimplement this after the P2P rearchitecture.