* impl. old validator removal from sender queue peer list
* provided current validators for sender queue peer removal
* renamed validators as nodes in the sender queue
* Revert "renamed validators as nodes in the sender queue"
This reverts commit 78e1e1569d5f624c469bf752a5bf874b434a61d2.
* cleaned up the SQ builder and moved removal of old validators to triggers
* computing participant transitions from batches in the sender queue
* added a missing comment
* removing old validators as soon as all messages are delivered up to the last epoch
* review comments
* rejoined Node 0 in the old DHB test
* DHB test uses the first step of the DHB algorithm on the restarted node
* changed test batch verification to account for node 0 removal
* updated net_dynamic_hb test to cope with the removal of node 0
* relaxed verification of batches to only check inclusion of node 0 transactions
* corrected test state transitions in DHB and QHB tests
* added a builder function for a joining QHB
* rejoin the pivot node instead of node 0
* changed VirtualNet::verify_batches to take a full node as an argument
* corrected a variable name
* correction: use the pivot node ID instead of indices
* corrected the pivot node ID
* simplified a find
* simplified a conditional statement
* corrected the inference of expected output in verify_batches
* WIP on DHB and QHB tests; VirtualNet::verify_batches made more general
* readded node 0 in the DHB test when InProgress change is output
* allowed node 0 to miss a few batches while it is removed in the QHB test
* edition and rebase fixes
* refactored the use of process_step
* added VirtualNet functionality of node insertion and removal
* restarting the pivot node after all validators add it as peer
* clippy lints in net_dynamic_hb
* added observer in the QHB test; removed the DHB TestNetwork test
* fixed rng usage in the QHB test
* check output length when verifying batches; comment correction
* Use `OsRng` in place of `thread_rng`.
This changes the defaults of any builder by instantiating an `OsRng` instead of
a `thread_rng`, the former being much more secure than the latter.
Additionally, all the unit tests that still instantiate RNGs manually used `OsRng`s
as well; while there is no actual need for this level of security in tests, the performance overhead is very small and random number generation complexity has such a small impact on these tests that the convenience of being able to ban `thread_rng` from the codebase altogether, setting a good example and avoid issues when refactoring later greatly outweigh the negatives.
* Instead of storing random number generators in the various consensus algorithm instances, pass them in from the outside whenever they are needed.
This changes a large amount of interfaces (and in this commit is only partially done, since `DistAlgorithm` needs to be fundamentally altered as well.
It also obsoletes parts of the `util` module.
* Added an `R: Rng` type parameter to both methods of `DistAlgorithm`, forcing callers to pass in their own Rngs.
* Fixed documentation grammar and spelling in some of the altered interfaces due to RNG refactoring.
* Move `rng` argument to the end of the argument for most functions.
Also includes a reformatting due to Rust 1.30.
* Updated tests, accomodate `rng`-API changes.
* Fixed remaining compilation issues with new RNG code.
* Fix illegal `self` import outside curly braces.
* Cleaned up comments and fixed broken definition of `broadcast_input`.
* Updated existing test cases to properly work with static dispatch randomness.
* Do not use boxed `Rng`s for key generation in test networks.
* Use the passed-in `Rng` in `ReorderingAdversary`, instead of storing a boxed one.
* Fixed clippy lints after refactoring.
* Removed some no-longer necessary manual `fmt::Debug` implementations in test framework.
* Use `OsRng` even in tests in `binary_agreement_mitm`.
* Use a proper deterministic RNG in tests `binary_agreement_mitm`.
* Refactor `examples/simulation.rs` by not using `ThreadRng`, passing generic `Rng` parameters throughout and using a type alias instead of a newtype as the `Transaction`.
* Remove `thread_rng` use from `examples/node.rs`.
* Explicitly construct `InternalContrib` in `DynamicHoneyBadger::propose`.
* Fixed typo in description of `DistAlgorithm` trait.
* added fault checking in the net framework
* check that the node in the fault report is not faulty
* simplified a condition
* made error on fault a parameter of VirtualNet
* updated the BA test to error on fault
* explained errors and refactored an assignment
* typo fix
* test expected participants when receiving a batch from a correct node
* restrict the batch participant check to correct participants
* check only for the absence of unexpected batch participants
* check the minimum number of contributors for each batch
* corrected the minimum number of batch contributions
* removed an irrelevant FIXME
* added an equivalence check for batches output in the same epoch
* comment correction
* Allow arbitrary validator set changes in DHB.
This replaces `NodeChange` with a full list of IDs and public keys,
instead of just a single to-be-added or to-be-removed node, to allow
completely replacing the set of validators by any arbitrary new set in a
single key generation step.
* Address review comments: added_nodes, comments.
* Fix MessageScheduler::First.
Make sure every node eventually gets to handle its messages.
Instead of just the public key, the batches returned from
`DynamicHoneyBadger` and `QueueingHoneyBadger` now contain the full
`NetworkInfo`, so the user can use the validators' keys for signing and
encryption.
* Use inverse of `is_bft` function for checking in `average_higher`.
* Inline in `NetworkDimension`.
* Check more invariants when averaging network sizes.
* Added test that finds shrinking regression of `NetworkDimension`.
* Use bijection for shrinking of network dimensions.
* Fix types on dimensions.
* Hide `size` and `faulty` behind accessor methods.
* Make limits dependant on input size.
* Fixed clippy lints.
* Simplify averaging.
* Add support for RNG instantiation in proptests.
* Use `proptest` module strategy to create the rng for `net_dynamic_honey_badger`.
* Use seed generation instead of RNG instantiation in tests.
* Remove fixed RNG in `generate_map`.
* `VirtualNet` now supports setting the random generator through the builder.
* Add missing `time_limit` field to `::std::fmt::Debug` trait implementation on `NetBuilder`.
* Pass an instantiated random number generator through `NewNodeInfo` as a convenience.
* Make the random number generator of `DynamicHoneyBadgerBuilder` configurable, at the cost of now requiring mutability to call `build_first_node()`.
* Ensure RNGs are derive from passed in seed in `net_dynamic_hb` tests.
* Correct inappropriate use of `random::Random` instead of `Rng::gen` to generate dependent values in `binary_agreement`.
The original implementation used `rand::random()`, which will always use the `thread_rng`, ignoring the fact that an RNG has actually been passed in.
* Do not use `OsRng` but passed in RNG instead.
* Use reference/non-reference passing of rngs more in line with the `rand` crates conventions.
* Document `rng` field on `DynamicHoneyBadger`.
* Make `SyncKeyGen` work with the extend (`encrypt_with_rng`) API of `threshold_crypto`.
* Use passed-in random number generator in `HoneyBadger`.
* Create `SubRng` crate in new `util` module to replace `create_rng()`.
* Use an RNG seeded from the configure RNG when reinitializing `DynamicHoneyBadger`.
* Use the correct branch of `threshold_crypto` with support for passing RNGs.
* Outputing subset messages as received
This outputs subset messages as they are received. All tests pass.
* Fix test suite, while still outputing results early
This fixes the test suite, while still outputting results early.
* Actually do the optimization
There is a testsuite failure in the `dynamic_honey_badger` tests. Is
this a testsuite bug?
* Respond to code review
* Document the meaning of `None` in Subset::broadcast_results
* Fix adding Contributions and fault check
* Fix clippy
* Keep track of nodes that have sent us valid messages
Otherwise, we reject all nodes as faulty.
* Remove excessive debug logging
There is no need to log a quadratic amount of data.
* Re-add check that the observer’s values match
the rest of the nodes. Also `panic!` if `Done` is ever not the last
value in a series of `SubsetOutput`s.
* Respond to review
* Rename field
* Disable beta, use `stable` channel.
* Pin to Rust 1.29 stable.
* Streamline clippy operation.
* Fix or disable remaining failing clippy lints.
* Use `$TRAVIS_RUST_VERSION` instead of `stable` to name toolchain.
* Added missing debug implementations for various test networking parts.
* Initial proptest parts added, including network dimensions.
* Use a test configuration for proptests.
* Tweaks and documentation.
* Improved documentation for `net_dynamic_hb` test.
* Added two missing `;`.
* Allow insane topology creation.
* Renamed `is_sane()` to `is_bft`, `halfway` to `average_higher` and improved comments per suggestions.
* Rename `NetworkTopology` -> `NetworkDimension`.
* Silence newly added clippy warning.
* Smoothed `README.md`.
* Remove workaround for beta/nightly again.
* Caved in to clippy and changed the bft condition.
* spam protection part 1: remote epoch tracking in HoneyBadger
* moved handling of EpochStarted out of EpochState
* allowed EpochStarted from observers
* removed an unnecessary function call
* updated formatting to beta
* removed an unnecessary variable
Added new virtual network implementation for tests.
Added `net::VirtualNet` as an upcoming replacement for the current networking implementation in the test, along with auxiliary functions. The new system allows easier manipulation through implemented adversaries, better reporting and should offer a more friendly API.
Documentation for the functionality can be found in `tests/README.md`.