koinos / koinos-p2p

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

Better LIB Handling #222

Closed mvandeberg closed 1 year ago

mvandeberg commented 1 year ago

We had a node disconnect from all peers when it's LIB was not updated properly.

This led to the sync code attempting to apply a block that was one before LIB and then disconnect from all peers. From #219 we added the case that sync code will not assign error score when attempting to apply a block before irreversibility as the scenario is almost always a problem with us.

We can expand this capability to detect LIB errors from chain as well. by having chain return a different error code when it attempts to apply a block that is prior to irreversibility.

This would have prevented this node from disconnecting because the blocks prior to LIB would have failed but not prevented syncing new blocks.