Commit Graph

70 Commits

Author SHA1 Message Date
Andreas Fackler 6bcf365cf8 Rename CommonCoin to Coin. 2018-08-22 16:20:09 -07:00
Andreas Fackler 5cc7b54c06 Split up the broadcast module.
Also, rename broadcast and agreement messages to just `Message`.
2018-08-08 15:46:43 +02:00
c0gent 697ba6f0a8
Add common supertraits and rename related type parameters.
* Add the `Contribution`, `NodeUidT`, and `Message` supertraits.
* Rename type parameters:
  * `Tx` -> `T` or `C`
  * `NodeUid` -> `N`
2018-08-02 14:52:12 -07:00
c0gent f66dbdf3a1
Reorganize `dynamic_honey_badger` and `agreement` modules slightly.
* 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`.
2018-08-02 13:01:57 -07:00
Andreas Fackler dd31758bdf Extract SBV broadcast from agreement. 2018-08-02 12:55:17 +02:00
Andreas Fackler c448e057f8 Rename BinValues to BoolSet. 2018-07-31 09:42:30 +02:00
Andreas Fackler 4159acf8cd Represent BinValues as a u8. 2018-07-31 09:39:51 +02:00
c0gent 847a79793e
Replace `chain_error` with `failure`
Changes:

* Remove `error_chain` and convert errors to `failure` types.
* Add variants for each possible error generation point.
2018-07-30 15:14:19 -07:00
Andreas Fackler 78ab9742a9 Avoid heap allocation in BinValues::into_iter. 2018-07-30 13:08:17 +02:00
Andreas Fackler 8beab3d2b4 Log duplicate agreement messages as faults. 2018-07-30 12:04:28 +02:00
Andreas Fackler 3b65f0cead Fix agreement bugs, and refactor a few fields.
* 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.
2018-07-30 11:44:55 +02:00
Vladimir Komendantskiy 6efe6037f2 removed duplicated insertion 2018-07-27 08:24:19 +01:00
Vladimir Komendantskiy 638cde3d71 avoid cloning of Agreement::received_term 2018-07-26 17:55:21 +01:00
Andreas Fackler 08d6abf6b4 Make sure Term messages are handled as BVal, Aux, Conf. 2018-07-26 14:19:01 +02:00
Andreas Fackler 4bff2849f9 Fix bin_values change handling in agreement.
* Call `on_bin_values_changed` even if there is only one value.
* Handle the case _f = 0_ correctly: `count_bval` can be equal to both
  _f + 1_ and _2 f + 1_.
2018-07-26 09:34:34 +02:00
Andreas Fackler 9d0f1b3d15 Remove output and message queue from CommonSubset. 2018-07-24 13:12:06 +02:00
Andreas Fackler 102fa0e01d Remove output and message queue from Agreement. 2018-07-24 11:43:35 +02:00
Vladimir Komendantskiy bc245f2e67 added a Step for each module 2018-07-20 12:51:06 +01:00
Vladimir Komendantskiy 099fbc999e made Step depend on DistAlgorithm instead of base types 2018-07-20 12:47:19 +01:00
Vladimir Komendantskiy ccd1a98c42 optimized function arguments and added a typedef for Simulation Step 2018-07-20 12:44:41 +01:00
Vladimir Komendantskiy 65b3097238 message queue refactoring WIP 2018-07-20 12:43:15 +01:00
Andreas Fackler 15cc6ffddd Separate keys and key shares. 2018-07-18 14:44:35 +02:00
Vladimir Komendantskiy 4b88759844 review comments 2018-07-17 18:27:28 +01:00
Vladimir Komendantskiy c6a0090859 removed cloning of FaultLog 2018-07-16 12:33:00 +01:00
Vladimir Komendantskiy db9191768b review comments 2018-07-13 22:53:44 +01:00
Vladimir Komendantskiy d7a2808774
Merge branch 'master' into vk-api-refactor66 2018-07-13 13:53:21 +01:00
Marc Brinkmann 5336fbe707 Added `RandomAdversary` and the necessary auxiliary functions.
Random adversaries are created for `broadcast` and `honey_badger`.  Random value generation was added for all type-dependencies of these algorithms, causing the `Rand` trait to be implement for a large portion of the codebase.

Additionally, `MessageWithSender` turned into an actual struct, making it much easier to handle. Tuple-like construction is still available through `MessageWithSender::new()`.
2018-07-13 13:27:49 +02:00
Vladimir Komendantskiy 7fb1017bb1 changed Step::output to Vec but that didn't fix the dynamic HB test 2018-07-12 21:23:52 +01:00
Vladimir Komendantskiy 1254d40147 fixed a starvation issue in Agreement when num_faulty=0 2018-07-12 15:12:06 +01:00
Vladimir Komendantskiy 0ba06fdb76 added step output in DistAlgorithm 2018-07-12 14:54:05 +01:00
c0gent f0ed2e6e12 Make `*HoneyBadger` types thread safe.
Replaces `Rc` with `Arc`. This allows usage from different threads
which will be necessary for use with Parity.
2018-07-11 16:28:41 -07:00
Peter van Nostrand 6783ece9b0 Added faulty node logging to algorithms. 2018-07-09 13:45:11 -04:00
Andreas Fackler 6248e4079f Fix Subset for a single validator. 2018-07-09 11:38:56 +02:00
Andreas Fackler c42f606644 Fix module docs. (Review comments.) 2018-07-05 17:51:55 +02:00
Andreas Fackler 2a30860bb0 Add agreement module-level docs. 2018-07-05 11:45:30 +02:00
Andreas Fackler bbc27e8a66 Update terminology: "observers" and "validators" 2018-07-02 14:14:19 +02:00
Andreas Fackler 7a0b397233 Add node transaction messages to Dynamic HB. 2018-07-02 14:14:19 +02:00
Andreas Fackler 2db67df325 Rename is_full_node to is_peer. 2018-06-26 10:57:44 +02:00
Andreas Fackler 2a5f9f1bfe Allow observer nodes in all algorithms.
This allows nodes to join the network without sending any messages
themselves. They can't give any input and just observe the outcome.

Closes #81
2018-06-26 09:17:12 +02:00
Vladimir Komendantskiy 7be2510e36 swapped False and True coins 2018-06-22 17:39:55 +01:00
Vladimir Komendantskiy 7a4fc37628 implemented an optimistic random common coin schedule 2018-06-22 10:39:55 +01:00
Andreas Fackler 83f8d61402 Support serde by default.
This removes the `serialization-serde` feature, since serde is already
used internally and therefore a dependency anyway.
2018-06-20 10:21:52 +02:00
Andreas Fackler 66f396e01c Remove more NodeUid trait bounds.
Use a `BTreeMap` instead of `HashMap` in `NetworkInfo`. The number of
nodes can't grow very large anyway.
2018-06-18 16:37:07 +02:00
Andreas Fackler 3f707a8e12 Return proposer info from HoneyBadger.
Also, consistently name generic arguments, and remove some unused trait
bounds.
2018-06-18 16:19:54 +02:00
Vladimir Komendantskiy 3ed63a1507 formatting 2018-06-14 14:10:05 +01:00
Vladimir Komendantskiy 82b4250f0d added the broadcast proposer ID in the common coin nonce 2018-06-14 13:36:48 +01:00
Vladimir Komendantskiy 994600bcf6 renamed a fn argument for readability 2018-06-14 12:43:18 +01:00
Vladimir Komendantskiy 3393052b4b review comment coverage 2018-06-14 12:28:38 +01:00
Vladimir Komendantskiy 5008d11ada Revert "the set of node indices of common coin shares is now computed only once"
This reverts commit e9808efc61.
2018-06-14 10:05:05 +01:00
Vladimir Komendantskiy e9808efc61 the set of node indices of common coin shares is now computed only once 2018-06-13 22:05:11 +01:00