HotShot
HotShot copied to clipboard
Nodes subscribe to `transactions` topic only when they need transactions
Closes #1992
This PR:
- Creates three new methods in the
ConnectedNetwork
trait: -
subscribe_transactions
which subscribes to the newTransactions
topic -
unsubscribe_transactions
which unsubscribes from theTransactions
topic -
publish_transaction
which publishes a message to theTransactions
topic - implements these three methods for networks:
Libp2pNetwork
,PushCdnNetwork
andCombinedNetworks
- subscribes the node to the topic when it is to become the leader in the next view
- unsubscribes the node from the topic when the view has been updated and the node is not the leader in the next view