Commit Graph

73 Commits

Author SHA1 Message Date
Peter van Nostrand 19b982284b Added error-chain error handling. 2018-05-20 07:51:33 -04:00
Andreas Fackler b8a2463d1c Extend tests and fix CommonSubset.
Verify termination and more outputs.

`CommonSubset` now instantiates `Agreement` with the correct ID.
2018-05-19 15:56:49 +02:00
Vladimir Komendantskiy fced73459e upgraded the protobuf dependency to fix a compile error 2018-05-18 22:45:18 +01:00
Andreas Fackler 50d007b954 Remove protoc dep, use new MerkleTree methods. 2018-05-17 16:50:47 +02:00
Andreas Fackler 500ec81b2f Add a network simulation example. 2018-05-17 12:52:07 +02:00
Andreas Fackler 4164af1702 Generalize TestNetwork and test HoneyBadger. 2018-05-16 16:21:30 +02:00
Andreas Fackler e2c66e9a0a Add optional serde support.
If the feature "serialization-serde" is specified, protocol messages
implement serde's `Serialize` and `Deserialize` traits.

Close #18
2018-05-14 18:32:59 +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 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
Vladimir Komendantskiy 49c33d2357 added a dev dependency on rand for CI 2018-05-10 12:10:42 +01:00
Vladimir Komendantskiy 51ef11b55c fixed the count of matching AUX messages 2018-05-10 10:07:22 +01:00
Vladimir Komendantskiy e0005a672b removed the separate field in Agreement and corrected computation of estimated values 2018-05-10 10:07:22 +01:00
Vladimir Komendantskiy 394462c88b changed code according to review comments 2018-05-10 10:07:22 +01: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
Vladimir Komendantskiy e9b0add188 removed redundant dependency on error_chain; corrected vector indices 2018-04-06 13:57:48 +01:00
Vladimir Komendantskiy 186a855d2f replaced lockable scoped channel variables with lock-free ones 2018-04-02 21:26:40 +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 1cdec3c39b broadcast algorithm drafted up to tree interpolation 2018-03-22 22:47:44 +00:00
Vladimir Komendantskiy fc475004f0 lifted the static requirement for messages by using scoped threads 2018-03-20 16:32:19 +00:00
Vladimir Komendantskiy c38aad2c0a Refactored the comms from the consensus node module
I reduced the socket IO tasks to mere message forwarders. The algorithm
complexity lies in stage modules. Example: broadcast/mod.rs. Communication is
set up and modules are run from the node module.

There is a problem with this commit. std:🧵:spawn imposes a static
lifetime guarantee on type T in Message<T>.
2018-03-19 17:12:20 +00:00
Vladimir Komendantskiy 5301123872 initial commit: elements of profobuf interface 2018-03-15 00:03:21 +00:00