[][src]Function rhododendron::agree

pub fn agree<C: Context, I, O>(
    context: C,
    nodes: usize,
    max_faulty: usize,
    input: I,
    output: O
) -> Agreement<C, I, O> where
    C: Context,
    I: Stream<Item = <C as TypeResolve>::Communication, Error = C::Error>,
    O: Sink<SinkItem = <C as TypeResolve>::Communication, SinkError = C::Error>, 

Attempt to reach BFT agreement on a candidate.

nodes is the number of nodes in the system. max_faulty is the maximum number of faulty nodes. Should be less than 1/3 of nodes, otherwise agreement may never be reached.

The input stream should never logically conclude. The logic here assumes that messages flushed to the output stream will eventually reach other nodes.

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. In general, this future should be pre-empted by the import of a justification set for this block height.