Commit Graph

94 Commits

Author SHA1 Message Date
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
Andreas Fackler c1b4381753 Separate queue from Honey Badger.
This makes Honey Badger a bit more complicated but a lot more flexible:
It is now unaware of transactions and basically just runs one Subset
instance per epoch.

That way, users can use any kind of external queue, control throttling
and prioritization.
2018-07-10 17:29:58 +02:00
Peter van Nostrand 6783ece9b0 Added faulty node logging to algorithms. 2018-07-09 13:45:11 -04:00
Andreas Fackler 6f7245f123 Prefer HB::builder over HBBuilder::new. 2018-07-05 11:47:19 +02:00
Andreas Fackler 1a3016d94d Add Honey Badger builder. 2018-07-05 11:47:19 +02:00
Andreas Fackler 0f92010fe4 Add a max_future_epochs option to Honey Badger.
This delays handling of messages from epochs that are too far ahead.
2018-07-05 11:47:19 +02:00
Andreas Fackler e11f183db2 Remove generic E: Engine from crypto. 2018-06-22 10:08:23 +02:00
Andreas Fackler c84c60d826 Rename crypto::keygen to crypto::poly. 2018-06-20 10:05:03 +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 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
Vladimir Komendantskiy b82ac64148 note in the broadcast example about the use of keys 2018-06-13 18:24:35 +01:00
Vladimir Komendantskiy 04b7365ed9 updated the examples with the keys 2018-06-13 15:18:27 +01:00
Andreas Fackler 015381c88c Print messages and total message size per node in simulation. 2018-05-31 17:22:30 +02:00
Andreas Fackler b090dfaf22 Specify CPU speed in simulation, not the inverse. 2018-05-31 15:47:32 +02:00
Andreas Fackler 57533e17c2 Simplify example exit condition. 2018-05-31 14:49:16 +02:00
Andreas Fackler fc599232aa Add logging to simulation example. 2018-05-31 14:28:10 +02:00
Andreas Fackler f970272d3e Add bandwidth and CPU to the simulation. 2018-05-31 14:28:10 +02:00
Andreas Fackler 0017a2a7c0 Make public keys and signatures serializable. 2018-05-30 10:08:43 +02:00
Vladimir Komendantskiy 98f5304d4c top-level interface now requires providing a NetworkInfo parameter 2018-05-29 14:53:01 +01:00
Andreas Fackler 4b143828dd Add message counting to the simulation. 2018-05-29 15:11:32 +02:00
Andreas Fackler 9a0622f3f2 Update Rust, re-enable rustfmt. 2018-05-21 11:26:42 +02:00
Peter van Nostrand 1930ea8b7d Fixed a typo commst.rs. 2018-05-20 19:52:18 -04:00
Peter van Nostrand 465f17d9a5 Bumped reed-solomon-erasure crate version, fixed Protobuf error in example. 2018-05-20 19:39:47 -04:00
Peter van Nostrand 19b982284b Added error-chain error handling. 2018-05-20 07:51:33 -04:00
Andreas Fackler 500ec81b2f Add a network simulation example. 2018-05-17 12:52:07 +02:00
Andreas Fackler 5528fc2de8 Define a common DistAlgorithm trait.
This will allow us to deduplicate network simulations in tests for the
different algorithms. More generally, it facilitates writing general
tools and applying them to all distributed algorithms.
2018-05-15 15:48:43 +02:00
Andreas Fackler e8838f1491 Make protobuf support optional.
Protobuf support is now only built if the feature
"serialization-protobuf" is enabled.

Close #19
2018-05-14 17:29:04 +02:00
Andreas Fackler 71fa32c18f Remove interior mutability.
The `RwLock` is not needed anymore, since the broadcast implementation
doesn't handle any threading internally.
2018-05-14 09:35:34 +02:00
Andreas Fackler 0d005ebdc9 Fix build with protobuf 1.6.0.
Protobuf made backwards-incompatible changes but didn't increment the
major version, thus breaking the build.
2018-05-12 16:33:54 +02:00
Andreas Fackler 38cdd596a2 Start implementing the top-level Honey Badger algorithm.
This also contains a few fixes for the `common_subset` module:
* Rename `common_subset::Output` to `Message` to avoid confusing it
  with the value that the algorithm outputs as a result.
* Implement dispatch of messages to the right instance within
  `CommonSubset`, in a way that is transparent to the user.
2018-05-12 16:09:07 +02:00
Andreas Fackler 36183b1e27 Simplify the message types. 2018-05-10 17:52:12 +02:00
Andreas Fackler 43ada2dcc4 Add a fifth node to the example script. 2018-05-09 14:42:29 +02:00
Andreas Fackler c790a1feba Improve example logging, add BinaryPath. 2018-05-09 13:38:49 +02:00
Andreas Fackler b98bbe9dcd Fix broadcast and example, enable more tests.
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.
2018-05-08 17:04:38 +02:00
Andreas Fackler eec3102cbf Move node to examples, deduplicate code. 2018-05-05 17:54:29 +02:00
Andreas Fackler 6117e11a9e applied rustfmt 2018-04-30 18:55:51 +03:00
Andreas Fackler f399ed2c07 fixed Clippy lint warnings 2018-04-30 18:50:24 +03:00
Vladimir Komendantskiy b776087b26 removed redundant type constraint 2018-04-11 15:44:59 +01:00
Vladimir Komendantskiy ef2ec016e4 node indexing fixes and more logging to debug messaging issues 2018-04-04 12:18:57 +01:00
Vladimir Komendantskiy e01a80dfa7 introduced a Connection struct and a procedure to start the network 2018-04-01 22:29:12 +01:00
Vladimir Komendantskiy 264b72011c added example of intended use of Node and a draft of value encryption 2018-03-27 21:59:38 +01:00
Vladimir Komendantskiy 5301123872 initial commit: elements of profobuf interface 2018-03-15 00:03:21 +00:00