Commit Graph

8 Commits

Author SHA1 Message Date
C.Solovev cc0812193c Add to .gitignore .idea/ folder and fix test's readme 2019-02-25 15:05:08 +04:00
Andreas Fackler 87b1d45d97 Rename DistAlgorithm to ConsensusProtocol. 2019-01-08 14:14:34 +01:00
Marc Brinkmann ba2390191f Changed the defaults for tracing to `false`. (#277)
* Changed the defaults for tracing to `false`.

* Cleanup envvar handling.

* Update `README.md`.
2018-10-18 16:13:02 +02:00
Marc Brinkmann 6f0b53436f
Fix test-case shrinking issues (#254)
* 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.
2018-10-04 15:52:24 +02:00
Marc Brinkmann d2627272fe
Better proptest persistence through deterministic randomness. (#248)
* 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.
2018-10-02 16:24:51 +02:00
Marc Brinkmann 422d8ef55b Add a test time limit. (#232)
* Added a default time limit to `NetBuilder`.

* Added environment-variable override via `HBBFT_NO_TIME_LIMIT`.

* Check for time limit exceeded when cranking.

* Fix typos and factual errors in API docs.

* Document time limit setting in tests `README.md`.
2018-09-13 15:19:22 +01:00
Marc Brinkmann 0266a4107c Network dimension strategy for property based tests. (#225)
* 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.
2018-09-11 18:11:04 +01:00
Marc Brinkmann 85550fcf82
New test network implementation (#216)
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`.
2018-08-29 10:09:35 +02:00