Commit Graph

144 Commits

Author SHA1 Message Date
Vladimir Komendantskiy ff3e819a4f a better check for when bin_values becomes non-empty 2018-05-15 16:00:37 +01:00
Vladimir Komendantskiy 322373a5ae started using the set of sent agreement values 2018-05-15 15:47:54 +01:00
Vladimir Komendantskiy eadd233fe4 added the Common Subset test module 2018-05-15 15:44:47 +01:00
Vladimir Komendantskiy 2dfbc2c58d
Merge pull request #21 from poanetwork/afck-algo-trait
Define a common DistAlgorithm trait.
2018-05-15 15:43:19 +01:00
Andreas Fackler 66898aee30 In agreement, set sent_bval correctly. 2018-05-15 16:15:41 +02:00
Andreas Fackler b8c534da2b Rename has_output to decided, add output iterator. 2018-05-15 16:05:55 +02:00
Andreas Fackler 3895949cf6 Fix broadcast for size < 4, and test more network sizes. 2018-05-15 15:53:37 +02:00
Andreas Fackler 10d9aa73e3 Rename UnexpectedMessage error. 2018-05-15 15:48:43 +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
Vladimir Komendantskiy 93a6ce1bb4
Merge pull request #22 from poanetwork/afck-protobuf
Make protobuf support optional, add serde support.
2018-05-15 12:27:58 +01:00
Andreas Fackler b543b771a7 Rename util to fmt. 2018-05-15 08:31:13 +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 faab03d984
Merge pull request #16 from poanetwork/vk-test-agreement
Binary Agreement test module
2018-05-14 14:05:15 +02:00
Vladimir Komendantskiy c1a03c28d1 updated comment and fn name 2018-05-14 12:36:00 +01:00
Vladimir Komendantskiy 50ba18b0dd reduced the set of proposers to 1 2018-05-14 12:36:00 +01:00
Vladimir Komendantskiy 9043b1102f formatting 2018-05-14 12:35:28 +01:00
Vladimir Komendantskiy 8091b6cc1d corrected the test message handling loop termination condition 2018-05-14 12:35:28 +01:00
Vladimir Komendantskiy a20ee74254 added a test for Binary Agreement with 4 proposers 2018-05-14 12:35:28 +01:00
Vladimir Komendantskiy 3d977c8575
Merge pull request #15 from poanetwork/afck--honey-badger
Start implementing the top-level Honey Badger algorithm.
2018-05-14 12:20:32 +01: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
Vladimir Komendantskiy a83536dc6f
Merge pull request #14 from poanetwork/afck--types
Simplify the message types.
2018-05-10 17:23:08 +01:00
Andreas Fackler 36183b1e27 Simplify the message types. 2018-05-10 17:52:12 +02:00
Andreas Fackler d9febca3c3
Merge pull request #11 from poanetwork/vk-agreement
The ACS and BA algorithms
2018-05-10 14:00:45 +02:00
Vladimir Komendantskiy 57ff64cce0 correction: Agreement outputs a value only once 2018-05-10 12:44:33 +01:00
Vladimir Komendantskiy 68e6a7ae2d added the missing agreement broadcast message on epoch change 2018-05-10 12:33:01 +01:00
Vladimir Komendantskiy 49c33d2357 added a dev dependency on rand for CI 2018-05-10 12:10:42 +01:00
Vladimir Komendantskiy fb50e38ead replaced the map of estimated values with only one optional value for the current epoch 2018-05-10 12:09:22 +01:00
Vladimir Komendantskiy cf33bac533 added the proposer ID to common_subset::handle_broadcast and mae it an interface fn 2018-05-10 11:01:25 +01:00
Vladimir Komendantskiy 51ef11b55c fixed the count of matching AUX messages 2018-05-10 10:07:22 +01:00
Vladimir Komendantskiy 259d5369b0 corrected the count of AUX messages 2018-05-10 10:07:22 +01:00
Vladimir Komendantskiy b6a6bb35ea clear the received AUX messages on every epoch update 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 3e35cc665b added element_proposer_id to the Agreement input to the Common Subset algorithm 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
Vladimir Komendantskiy 2205f9083e added a TODO file and changed indentation in the .proto file 2018-05-10 10:02:03 +01:00
Vladimir Komendantskiy 5215156ec5 defined the output from the Common Subset algorithm 2018-05-10 10:02:03 +01:00
Vladimir Komendantskiy d3b974f888 Binary Agreement implementation and its wiring into Common Subset 2018-05-10 10:02:03 +01:00
Vladimir Komendantskiy 7748c9073b
Merge pull request #13 from poanetwork/afck--remove-channels
Fix broadcast and example, enable more tests.
2018-05-09 16:47:01 +01:00
Andreas Fackler 43ada2dcc4 Add a fifth node to the example script. 2018-05-09 14:42:29 +02:00
Andreas Fackler 047307be46 Revert to earlier ProtoIo implementation.
This fixes the issue where sometimes messages were skipped.
2018-05-09 14:18:12 +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
Vladimir Komendantskiy 8af526d61f
Merge pull request #9 from DrPeterVanNostrand/master
Update readme with build instructions
2018-05-07 09:39:55 +01:00
Peter van Nostrand b489d06ddb Updated readme. 2018-05-06 20:25:41 -04:00
Peter van Nostrand e27d9b481d Updated readme with protoc install instructions for Debain 9 and Ubuntu 17. 2018-05-06 20:24:28 -04:00
Peter van Nostrand a6901b9be1 Merge remote-tracking branch 'upstream/master' 2018-05-06 19:32:15 -04:00
Vladimir Komendantskiy dda1570bfc Merge branch 'afck--examples' of github.com:poanetwork/hbbft 2018-05-06 22:49:41 +01:00