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
Andreas Fackler
ca2dd2327e
Add back InvalidNodeTransactionSignature fault.
...
This was accidentally removed due to a merge conflict.
2018-07-10 17:29:58 +02: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
6248e4079f
Fix Subset for a single validator.
2018-07-09 11:38:56 +02: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
Marc Brinkmann
60450d2c90
Reformatted using nightly rustfmt instead of stable rustfmt.
2018-07-05 10:12:57 +02:00
Marc Brinkmann
5e8b26cfc3
Implemented `Rand` for `SecretKey`.
2018-07-04 16:43:17 +02:00
Andreas Fackler
34385746c6
Add start_epoch option and DHB builder.
2018-07-02 14:14:19 +02:00
Andreas Fackler
11149c5e66
Communicate change state in Dynamic HB, add module docs.
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
7a335c9771
Remove vote_counts field from dynamic HB.
2018-06-27 11:51:56 +02:00
Andreas Fackler
74fab61dd8
Fix Dynamic HB test.
2018-06-27 11:37:05 +02:00
Andreas Fackler
fd8e7a5900
Add DynamicHoneyBadger.
2018-06-26 15:13:04 +02:00
Andreas Fackler
78fdf63540
Merge pull request #83 from poanetwork/afck-observer
...
Allow observer nodes in all algorithms.
2018-06-26 15:12:46 +02:00
Vladimir Komendantskiy
6ce6899ca9
added output sequence verification in HoneyBadger test
2018-06-26 12:15:30 +01: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
b3b3994ec1
Merge pull request #82 from poanetwork/vk-test-decryption-shares
...
An adversary sending faulty decryption shares
2018-06-26 09:06:33 +02:00
Vladimir Komendantskiy
1c9ca201d5
corrected a comment and removed a redundant mut
2018-06-25 21:18:25 +01:00
Vladimir Komendantskiy
11ec39879b
created an adversary to test against faulty decryption shares
2018-06-25 19:22:08 +01:00
Andreas Fackler
062b35ab3a
Make SyncKeyGen NodeUid-aware.
...
This allows the caller to address nodes by ID instead of by index.
Also contains a few other minor changes that will be needed for
`DynamicHoneyBadger`.
2018-06-25 13:07:31 +02:00
Vladimir Komendantskiy
af03158e00
tries to decrypt and output a batch on epoch update from already received messages
2018-06-22 10:12:38 +01:00
Andreas Fackler
e11f183db2
Remove generic E: Engine from crypto.
2018-06-22 10:08:23 +02:00
Andreas Fackler
7eb487f329
Implement SyncKeyGen.
...
This is a _synchronous_ key generation algorithm. We will use it in
`DynamicHoneyBadger`, on top of `HoneyBadger` to satisfy the synchrony
requirements.
It can also be used independently e.g. on top of a blockchain.
2018-06-22 10:06:29 +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
f2a03f8f04
corrected the agreement test proposer ID
2018-06-14 13:45:58 +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
3393052b4b
review comment coverage
2018-06-14 12:28:38 +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
4dbef3968d
fixed early update of Agreement epoch
2018-06-13 15:18:27 +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
e116c6c171
added tests for the common coin
2018-06-13 15:17:11 +01:00
Vladimir Komendantskiy
122f1fc6f1
updated the tests with key initialisation
2018-06-13 15:15:41 +01:00
Vladimir Komendantskiy
98f5304d4c
top-level interface now requires providing a NetworkInfo parameter
2018-05-29 14:53:01 +01:00
Vladimir Komendantskiy
938d2f5c16
added a note about the use of NetworkInfo in tests
2018-05-29 14:53:01 +01: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
Andreas Fackler
ab89dabde9
Add a few explaining comments.
2018-05-19 17:10:30 +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
Andreas Fackler
d5f9c4d40d
Fix Agreement and re-enable HoneyBadger test.
2018-05-17 17:38:45 +02:00
Andreas Fackler
500ec81b2f
Add a network simulation example.
2018-05-17 12:52:07 +02:00
Vladimir Komendantskiy
ca49f4041b
fixed the outdated code in Agreement test
2018-05-17 11:27:31 +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
Andreas Fackler
4164af1702
Generalize TestNetwork and test HoneyBadger.
2018-05-16 16:21:30 +02:00
Vladimir Komendantskiy
21b898d8e0
dispatch targeted messages in the Common Subset message handling routine
2018-05-16 11:21:53 +01: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
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
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
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
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
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
e2cd4ca1b7
added (ignored) regression tests for some of the broadcast issues
2018-05-04 11:14:19 +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
Andreas Fackler
babbd2f36a
fixed broadcast failure with malicious value proposal
2018-05-03 11:07:37 +03:00
Andreas Fackler
0f3377c8e9
made broadcast handle its own echo and value messages
2018-05-03 08:47:31 +03:00
Andreas Fackler
7096251b91
extended tests, make broadcast output only once
2018-05-02 16:34:54 +03:00
Andreas Fackler
f710806b17
test broadcast in a single thread
2018-05-01 19:38:11 +03: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
1fadff0e30
added the broadcast trigger message in the broadcast test
2018-04-27 13:31:50 +01:00
Vladimir Komendantskiy
329adc3c2b
ported sharding and sending out Merkle tree proofs
2018-04-27 13:19:39 +01:00
Vladimir Komendantskiy
eef846550f
added the ACS algorithm with one clause not ready yet
2018-04-26 14:22:18 +01:00
Vladimir Komendantskiy
8cd1f4748d
broadcast ECHO message handler and mutable access solution for writeable state of broadcast
2018-04-25 20:41:46 +01:00
Vladimir Komendantskiy
c7020e7b6a
broadcast VALUE remote message handler written
2018-04-25 14:07:16 +01:00
Vladimir Komendantskiy
5428d928cc
added receiver threads for remote nodes in the broadcast test
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
93617f797d
removed unnecessary mutability requirements
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
08ff34c2a7
removed the algo error type, replacing it with type constraints and drafted adding handlers to a test node
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
92d8c0d71a
fold was not using the variable capturing the sequential data; I fixed that
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
36cb880186
introduced a message handler trait and corrected the type of message handler container
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
629c54494c
added send_remote for sending a queue of messages to remote nodes through channels
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
b5e47d9a4f
wrote essentials of the message loop and updated the message queue with required handles
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
875f3cecbe
updated the message loop state adding messages queued for sending to remote nodes
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
f801f0c1b0
test prototype of a message loop implementation
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
7b82228b57
basic types for message passing between algorithms
2018-04-25 10:59:46 +01:00
Vladimir Komendantskiy
b1cc8aee15
removed unused test module and refactored handling of Result using combinators
2018-04-16 15:17:36 +01:00
Vladimir Komendantskiy
cdd86cbd6a
added error handling in the local messaging task, so that channel errors don't cause a panic
2018-04-16 14:03:32 +01:00
Andreas Fackler
0494b4925d
fixed value encoding, shortened debug messages
...
This adds a length byte to the values before padding with 0, so that we
can omit the padding at the end again. Shards are not converted to the
type parameter `T` anymore, because they are not necessarily valid
representations of a `T` value, e.g. valid UTF-8, as in the tests.
It also shortens some debug messages by printing byte arrays as
hexadecimal, and eliding some bytes.
2018-04-14 12:27:17 +02:00
Andreas Fackler
fc3e502c5a
fixed test build
2018-04-14 10:40:06 +02:00
Vladimir Komendantskiy
13081f75ee
simple update in TestNode::run allowing to change the number of nodes in the pool
2018-04-13 18:49:49 +01:00
Vladimir Komendantskiy
d9bc81fe5f
integration test of broadcast mostly ready; there is a thread termination issue however
2018-04-13 18:28:41 +01:00
Vladimir Komendantskiy
efdb4467c5
added broadcast integration test concept
2018-04-12 17:17:33 +01:00