For PoW, light clients etc we need to change block propagation from push-based to pull-based. This change will simplify logic of gossip since we don't need to trace whether node has block or not. It however necessitate creating new subsystem for tracking requests
We need to track which block we need to fetch. That information could be obtained from appTMState TVar
We need to track which nodes likely to have block we need and we need some way to choose such nodes
We need to track requests in flight so we won't flood nodes with duplicate requests
Most straightforward implementation is to create yet another thread which will do exactly that. It will need access to following APIs:
State of consensus engine. This one is already availalble
State of each of existing peers & ability to send message to each individually
For PoW, light clients etc we need to change block propagation from push-based to pull-based. This change will simplify logic of gossip since we don't need to trace whether node has block or not. It however necessitate creating new subsystem for tracking requests
appTMState
TVarMost straightforward implementation is to create yet another thread which will do exactly that. It will need access to following APIs: