#node #bft #protocols #context #round #safe #input

rhododendron

Asynchronously safe BFT protocol, futures-based implementation

11 unstable releases (5 breaking)

0.7.0 Jul 30, 2019
0.6.0 Jun 25, 2019
0.5.0 Jan 29, 2019
0.4.0 Oct 11, 2018
0.2.0 Jul 6, 2018

#30 in #bft

Download history 3/week @ 2024-02-12 9/week @ 2024-02-19 35/week @ 2024-02-26 18/week @ 2024-03-04

65 downloads per month

GPL-3.0 license

73KB
2K SLoC

Rhododendron

Futures-based BFT in Rust. Mostly works, but not ready for production.

Most of the work is done with the agree function:

pub fn agree<C: Context, I, O>(context: C, nodes: usize, max_faulty: usize, input: I, output: O)
	-> Agreement<C, I, O>
{
    // ...
}

There are three parts to invoking agree:

  • A Context, encapsulating value type to be agreed upon, as well as generation, evaluation, and signatures on values.
  • An input stream of messages from other nodes.
  • An output sink of messages which will reach all other honest nodes.

This yields an Agreement which can be run on an event loop to completion.


lib.rs:

BFT Agreement based on a rotating proposer in different rounds, generic futures-based implementation.

Attempt to reach BFT agreement on a candidate. Not ready for production.

Agreement is between n nodes, max_faulty of whom are faulty. max_faulty should be less than 1/3 of nodes, otherwise agreement may never be reached.

Initiate agreement by calling agree with a generic Context, an input stream, and an output sink. The input should never logically conclude and contain messages from all other nodes, while the output sink

Note that it is possible to witness agreement being reached without ever seeing the candidate. Any candidates seen will be checked for validity.

Although technically the agreement will always complete (given the eventual delivery of messages), in practice it is possible for this future to conclude without having witnessed the conclusion.

Users of the Agreement future should schedule it to be pre-empted by an external import of an agreed value.

Dependencies

~2.6–4MB
~79K SLoC