Reintroduce viewchanges to consensus
This is what network_topology::apply_block looks like.
pub fn apply_block(&mut self, block: HashOf<VersionedCommittedBlock>) {
/*
nocheckin
*self = self
.clone()
.into_builder()
.at_block(block)
.with_view_changes(ViewChangeProofs::empty())
.build()
.expect("Given a valid Topology, it is impossible to have error here.")
*/
}
This was done in order to be able to produce many blocks without supporting view changes yet. The things to implement are view change after a commit timeout. And a view change if the leader is offline or is ignoring transactions. Transaction forwarding reciepts also need implementing. These are things that exist in the old sumeragi implentation. Use that as a guide. Start by uncommenting the above code and then get to work at unbreaking the tests by implemting the above.
I suspect the best way to implement this is to add a new "view change requested" message. Essentially build a parallel system that runs in the same event loop to coordinate view changes. If there is consensus that a view change should be initiated, reset all the state to how it was when entering the current round, but with a shuffled network topology.