`Target` now only has a `Nodes` and an `AllExcept` variant, to specify
a message's target via a whitelist or blacklist. This avoids cloning
the message content and simplifies the code in several places.
* Added extra message types
* Add send functions for new message types
* Store original value message received from proposer
* Modify handle_value for optimized broadcast
* Modify handle_echo for optimized broadcast
* Add handle_echo_hash function for optimized broadcast
* Add handle_can_decode function for optimized broadcast
* Fixes handle_ready and send_echo functions:
1) Modify handle_ready function for optimized broadcast
2) Modify send_echo function to send `Echo` messages to different subset of nodes from
handle_value and handle_ready functions
* Remove value_message and fix typos
* Add functions for filtering all_ids
* Separate send_echo to send_echo_left and send_echo_remaining
* Rename pessimism_factor to fault_estimate
* Remove redundant bools from Broadcast struct
* Fix multiple counting of nodes who sent both `Echo` and `EchoHash` by changing
`echos` map structure
* Allow conflicting `CanDecode`s from same node
* Fix left and right iterators for `Echo` and `EchoHash` messages
* Fixes bugs in left and right iterators and adds additional checks in handle
functions
* Change can_decodes to BTreeMap<Digest, BTreeSet<N>> and fix send_can_decode
* Minor fixes
* Modify send_echo_remaining to take a hash parameter
* Fix bug in left and right iterators.
* Excluding proposer in iterator led to infinite loop when our_id == proposer_id
* Fix bug in handle_echo and compute_output
* send_can_decode call in handle_echo returned early
* compute_output needed `N - f` full `Echo`s to decode
* Refactor `echos` map to take an EchoContent Enum for `Echo` and `EchoHash` messages
* Run rustfmt
* Refactor to avoid index access and multiple map lookups
* Fix comments and minor refactorings.
* Add an`AllExcept(BTreeSet<N>)` type to `Target` enum to enable sending messages
to non-validators from Broadcast.
* Use `Target::AllExcept` in Broadcast to send `Echo` messages to all non-validator nodes.
* Add `AllExcept(_)` match arms for `Target` match expressions.
* Rename `AllExcept` parameter from `known` to `exclude`.
* Modify send_can_decode to send to all nodes who haven't sent an `Echo`.
* Update docs for broadcast
* Improve formatting and add comments for broadcast docs.
* Fix formatting.
* Allow for sending multiple `CanDecode` messages with different hashes.
* Fix comments.
* Fix bug in sending `Echo`s when node has not received `CanDecode`.
This fixes several issues with the broadcast algorithm and enables the
previously ignored tests that now pass:
* Don't decide on a root hash based on anyone's `Echo` message.
* Work around the `merkle` crate's inability to produce the proof of the
`i`-th leaf for a given index `i`.
* Ignore messages from unknown nodes.
* Avoid decoding multiple times.
* Document the full algorithm.
* Don't count multiple `Echo` or `Ready` messages coming from the same
node.
* Fix index computation for a given proof.
* Move `BroadcastMessage` into `broadcast` to make the module more
self-contained.
The example now only executes a single broadcast instance, expecting the
first node (the one with the lexicographically lowest address) to
propose a value. A shell script is added that runs for example nodes.
Use env_logger instead of simple_logger, so the log level can be controlled
with an environment variable. You can e.g. log all output from the broadcast
test and the crate itself in debug mode with:
RUST_LOG=hbbft=debug,broadcast=debug
Some debugging messages are more concise now and use hexadecimal
notation instead of printing arrays of decimal values.
An indentation error in the Travis script is also fixed.