The Dynamic Honey Badger tests would currently fail _without_ faulty
nodes, because with "first" delivery, all but the first _N - f_ nodes
are lagging indefinitely.
This change makes sure we give lagging nodes a chance to finish the first
phase of the test and arrive at the batch containing the completed
`Remove` event.
* Remove unnecessary recursive method calls.
* Add `handle_message` (without the trait).
* Fix a bug where `handle_message_content` would create an `EpochState`
with the wrong number.
* Move `CoinState` and `Agreement` definitions from `agreement/mod.rs`
to `.../agreement.rs`.
* Move `DynamicHoneyBadger` definition from `dynamic_honey_badger/mod.rs`
to `.../dynamic_honey_badger.rs`.
Reorganize `dynamic_honey_badger` and `agreement` modules slightly.
* Some additional rustfmt-ing crept in due to me accidentally using a newer version.
* Move `CoinState` and `Agreement` definitions from `agreement/mod.rs`
to `.../agreement.rs`.
* Move `DynamicHoneyBadger` definition from `dynamic_honey_badger/mod.rs`
to `.../dynamic_honey_badger.rs`.
`QueueingHoneyBadger` now waits after an output, and only makes its
proposal for the next epoch when:
* there are pending transactions in the queue,
* there are pending key generation or vote messages, or
* _f + 1_ other validators have already made their proposal.
This rule should work well for small networks: With 1 - 3 nodes, it will
produce a new batch whenever at least one of them has transactions to
contribute. In larger networks, it prevents an adversary controlling _f_
nodes from producing lots of empty epochs.
An exception is made for a currently joining validator: We will commit
up to _(N + 1)² + 1_ key generation messages for them, which is the
maximum number a correct node will send.
* Don't drop `Term` messages from previous epochs. They are still
relevant for all future epochs.
* Restructure some fields to avoid unnecessary iteration and counting.
* Simplify the fields related to the common coin.
* Reorder the methods, so that the message handlers are all in one
place.
* Handle the case where the coin value arrives before the required
number of `Conf` messages.