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
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
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
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
d5794cb5fe
extended the common coin nonce with a global UID and the top-level epoch
2018-06-13 15:18:27 +01:00
Vladimir Komendantskiy
cf45a4e3cb
common coin implementation
2018-06-13 15:15:41 +01: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
1fd7155e31
Remove unused CommonSubset error variants.
2018-05-31 09:37:00 +02:00
Andreas Fackler
f700ae82d0
Remove unused code from CommonSubset.
2018-05-30 15:50:16 +02:00
Vladimir Komendantskiy
d09f3e26b4
introduced common shared network information
2018-05-29 14:53:01 +01:00
Andreas Fackler
9a0622f3f2
Update Rust, re-enable rustfmt.
2018-05-21 11:26:42 +02:00
Peter van Nostrand
19b982284b
Added error-chain error handling.
2018-05-20 07:51:33 -04:00
Andreas Fackler
ca65a014d6
Use an unambiguous name for proposer ID.
2018-05-19 17:17:02 +02: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
962a618ffd
ported Common Subset tests to TestNetwork
2018-05-18 22:04:09 +01:00
Vladimir Komendantskiy
a0627b2550
review comments taken
2018-05-17 11:36:09 +01:00
Vladimir Komendantskiy
c8c8e1bb1f
added a latch for the decided value in Agreement to remember the output value
2018-05-17 10:43:56 +01:00
Vladimir Komendantskiy
0c386276b1
defined a DistAlgorithm instance of Agreement
2018-05-16 22:50:23 +01:00
Andreas Fackler
4164af1702
Generalize TestNetwork and test HoneyBadger.
2018-05-16 16:21:30 +02:00
Vladimir Komendantskiy
5f916c4d08
formatting and lint check
2018-05-15 22:25:41 +01:00
Vladimir Komendantskiy
c8034da332
corrected the CommonSubset module and test to decide on a map of values insetead of a set
2018-05-15 18:18:05 +01:00
Vladimir Komendantskiy
eadd233fe4
added the Common Subset test module
2018-05-15 15:44:47 +01: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
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
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
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
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
259d5369b0
corrected the count of 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
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
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
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
dda1570bfc
Merge branch 'afck--examples' of github.com:poanetwork/hbbft
2018-05-06 22:49:41 +01:00
Andreas Fackler
eec3102cbf
Move node to examples, deduplicate code.
2018-05-05 17:54:29 +02:00
Andreas Fackler
7826987af1
added a Travis configuration file, fixed Clippy lints
2018-05-05 09:53:29 +02:00
Andreas Fackler
8bced81438
removed some unnecessary cloning
...
This also adds a few TODOs to the broadcast implementation: Some of
these issues need a regression test. (Oh, and a fix!)
2018-05-04 09:58:21 +02:00
Vladimir Komendantskiy
cde3a879e5
modified Agreement::set_input to output a BVAL message
2018-05-03 10:13:41 +01:00
Andreas Fackler
babbd2f36a
fixed broadcast failure with malicious value proposal
2018-05-03 11:07:37 +03:00
Vladimir Komendantskiy
98e3cf76a3
implementation of the last clause in Figure 4
2018-05-02 15:47:30 +01:00
Vladimir Komendantskiy
7b04d5e084
created broadcast and agreement instances in Common Subset
2018-05-02 14:10:26 +01:00