`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`.
* Extract test framework into hbbft_testing crate.
Also update Rust and some dependencies.
* Rename DHB tests.
They are only called `net_dynamic_hb` because we used to have two test
frameworks and two DHB test modules.
Binary agreement erroneously kept handling queued incoming messages for
an epoch `n`, even if during the handling, the epoch was incremented to
`n + 1`. This caused `DuplicateAux` faults in the tests, but it could
potentially break consensus.
* Ported threshold_sign test to the new framework
* Ported the first three broadcast tests to the new framework
* Extracted messages storting and random swapping to reusable functions
Used to compose ProposeAdversary's behavior without having to duplicate code
* Implemented ProposeAdversary for the new integration testing framework
Added "id()" function to the "NodeMutHandle", required for sending messages to all nodes
ProposeAdversary needs access to all faulty node's netinfo. We follow the example of the binary_agreement_mitm integration test of using an reference counted Mutex to make netinfo available on both Consensus Protocol construction and in the Adversary implementation.
Unlike binary_agreement_mitm every faulty node needs to use its own netinfo for the broadcast algorithm, so we store all nodeinfo structures in a Map instead of just the nodeinfo of the first node.
Ideallly the new network simulation library should provide netinfo similar to the old library to avoid these hideous workarounds.
* Migrated test_broadcast_random_delivery_adv_propose to the new network simulator
Refactored the implementation of ProposeAdversary to closely resemble the behavior in the old network simulator library.
Implemented a pick_random_node function to sort messages for a random node id. Switched from using "inject_message" to joining messages generated by adversaries' temporary Broadcast Consensus Protocols with the Step generated by regular operation.
* Ported RandomAdversary to the new network simulator library
Ported all broadcast integration tests and replaced the old tests with the new.
* Eliminated the old broadcast integration test, replaced with the new
* Ported subset test to the new framework
Adjusted message queue size as suggested by Andreas
* Ported the first three honey_badger tests to the new framework
* Re-implemented FaultyShareAdversary for the new framework
Eliminated the old honey_badger integration tests, replaced with implementations using the new net simulator framework
* Fixed issues reported by clippy
* Fixed issues reported on code review
* Fixed issues reported by clippy
* Implemented a broadcast test dropping messages similar to the tests written in the old framework
* Picking the proposer id at random, verifying all possible output cases
If the proposer is faulty the message queue may starve, but the outputs of all correct nodes need to be empty, if the broadcast protocol produces output nonetheless all correct nodes need to have the same output.
If the proposer was correct all correct nodes need to output its proposed value.
* Eliminated duplicated semicolon
* Consistently using TestRng and proptest in all newly ported tests
* Increased the drop_and_re_add test message limit to 20k per node
* Removed unnecessary closure
* Increased the tolerance for deviations from the expected value range to eliminate random test failures
`SyncKeyGen` should tolerate duplicate `Part` messages as long as they
are identical.
The `drop_and_re_add` test had an arithmetic overflow, because it tried
to remove more faulty nodes than nodes in total.
* Choose pivot node at random
* Choose random number of nodes for removing in net_dynamic_hb test
* Docs and code small fixes
* clippy fix
* Cargo fmt for stable toolchain and add rust-toolchain file as well
* Remove rust-toolchain file
* Fix grammar and improve selecting nodes for removing
* Simplify selecting nodes for remove
* Fix tests
* Remove net_dynamic_hb.proptest-regressions file
Implementing an epoch setter for the `DynamicHoneyBadgerBuilder` enables the creation of a `DynamicHoneyBadger` that will join the consensus at a given epoch.
* started waiting for a full epoch after node removal in net_dynamic_hb
* clarified the use of the stored join plan
* go back to rejoining the node in the same epoch it was removed
* cleanup of debug prints
* clippy lints and more cleanup
* cleaned up unused methods
* review comments; cleaned up net_dynamic_hb
* relaxed the condition on the readd input epoch
* updated the fault error in tests