Docs.rs
  • manul-0.2.1
    • manul 0.2.1
    • Permalink
    • Docs.rs crate page
    • AGPL-3.0-or-later
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • fjarri
    • Dependencies
      • derive-where ^1 normal
      • digest ^0.10 normal
      • displaydoc ^0.2 normal
      • erased-serde ^0.4 normal
      • postcard ^1 normal optional
      • rand ^0.8 normal optional
      • rand_core ^0.6.4 normal
      • serde ^1 normal
      • serde-encoded-bytes ^0.2 normal
      • serde-persistent-deserializer ^0.3 normal optional
      • serde_json ^1 normal optional
      • signature ^2 normal
      • tinyvec ^1 normal
      • tokio ^1 normal optional
      • tracing ^0.1 normal
      • criterion ^0.5 dev
      • impls ^1 dev
      • postcard ^1 dev
      • rand ^0.8 dev
      • rand_core ^0.6.4 dev
      • serde-persistent-deserializer ^0.3 dev
      • serde_asn1_der ^0.8 dev
      • serde_json ^1 dev
      • tracing ^0.1 dev
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate manul

manul0.2.1

  • All Items

Sections

  • Round-based distributed protocols
    • Goals
    • Assumptions

Crate Items

  • Re-exports
  • Modules

Crates

  • manul

Crate manul

Source
Expand description

§Round-based distributed protocols

crate Docs License Build Status Coveralls

The body is round

§Goals

  • Sans-I/O API. That is, bring your own async libraries, or don’t.
  • Generic over signer/verifier/signature types, so you can use whatever your blockchain uses.
  • Support parallelization where possible, to offload expensive cryptographic operations into spawned tasks (but since it’s Sans-I/O, it’s up to you to make use of that functionality).
  • Provide tools for unit and integration testing of the protocols.
  • Support generating malicious behavior proofs with bundled signed messages.
  • Support caching messages intended for the next round and then applying them when it starts (since some nodes can finalize a round before others and send out a new batch of messages).

§Assumptions

We try to find the balance between supporting the majority of protocols and keeping the API simple. Currently we operate under the following assumptions:

  • A protocol consists of several rounds.
  • A round generates messages to send out without any additional external input, then waits for messages from other parties. When it receives enough messages, it can be finalized.
  • On finalization, a round can return the result, halt with an error, or continue to another round.
  • Each round declares a set of parties it sends messages to. Then it can optionally send a direct message to each party in the set, send a regular broadcast to all parties in the set, or send an echo-broadcast to all parties in the set (that is, a broadcast where it is ensured that all parties received the same thing). Any number of these options can be picked.

Re-exports§

pub use digest;
pub use signature;

Modules§

combinators
Combinators operating on protocols.
devdev
Utilities for testing protocols.
protocol
API for protocol implementors.
session
API for protocol users.
utils
Assorted utilities.

Results

Settings
Help
    trait
    manul::protocol::Round
    A type representing a single round of a protocol.
    struct field
    manul::combinators::misbehave::FinalizeOverride::UseDefault::round
    The round object to pass to finalize().
    struct
    manul::protocol::RoundId
    A round identifier.
    method
    manul::session::Session::round_id
    Returns the ID of the current round.
    enum
    manul::session::RoundOutcome
    Possible non-erroneous results of finalizing a round.
    struct
    manul::session::RoundAccumulator
    A mutable accumulator for collecting the results and …
    trait method
    manul::protocol::EntryPoint::make_round
    Creates the round.
    method
    manul::combinators::misbehave::MisbehavingEntryPoint::make_round
    enum
    manul::protocol::EchoRoundParticipation
    The specific way the node participates in the echo round …
    struct field
    manul::protocol::CommunicationInfo::echo_round_participation
    Returns the specific way the node participates in the echo …
    struct
    manul::protocol::BoxedRound
    A wrapped new round that may be returned by Round::finalize
    trait method
    manul::protocol::EntryPoint::entry_round_id
    Returns the ID of the round returned by Self::make_round.
    method
    manul::combinators::misbehave::MisbehavingEntryPoint::entry_round_id
    enum variant
    manul::protocol::FinalizeOutcome::AnotherRound
    Transition to a new round.
    enum variant
    manul::session::RoundOutcome::AnotherRound
    Transitioned to another round.
    method
    manul::session::Session::finalize_round
    Attempts to finalize the current round.
    trait method
    manul::protocol::Round::transition_info
    &Round -> TransitionInfo
    Returns the information about the position of this round …
    trait method
    manul::protocol::Round::communication_info
    &Round -> CommunicationInfo<Id>
    Returns the information about the communication this …
    method
    manul::protocol::BoxedRound::new_dynamic
    R -> BoxedRound<Id, P>
    where
    R: Round<Protocol=P, Id>
    Wraps an object implementing the dynamic round trait (Round…
    method
    manul::protocol::Round::make_echo_broadcast
    &Round, &mut CryptoRngCore, &BoxedFormat -> Result<EchoBroadcast, LocalError>
    Returns the echo broadcast for this round.
    method
    manul::protocol::Round::make_normal_broadcast
    &Round, &mut CryptoRngCore, &BoxedFormat -> Result<NormalBroadcast, LocalError>
    Returns the normal broadcast for this round.
    trait method
    manul::protocol::Round::receive_message
    &Round, &BoxedFormat, &Id, ProtocolMessage -> Result<Payload, ReceiveError<Id, Round::Protocol>>
    Processes the received message and generates the payload …
    method
    manul::protocol::Round::make_direct_message
    &Round, &mut CryptoRngCore, &BoxedFormat, &Id -> Result<(DirectMessage, Option<Artifact>), LocalError>
    Returns the direct message to the given destination and …
    trait method
    manul::protocol::Round::finalize
    Box<Round>, &mut CryptoRngCore, BTreeMap<Id, Payload>, BTreeMap<Id, Artifact> -> Result<FinalizeOutcome<Id, Round::Protocol>, LocalError>
    Attempts to finalize the round, producing the next round …
    method
    manul::protocol::BoxedRound::downcast
    BoxedRound<Id, P> -> Result<T, LocalError>
    where
    T: Round<Id>
    Attempts to extract an object of a concrete type.
    method
    manul::protocol::BoxedRound::downcast_ref
    &BoxedRound<Id, P> -> Result<&T, LocalError>
    where
    T: Round<Id>
    Attempts to provide a reference to an object of a concrete …
    method
    manul::protocol::BoxedRound::try_downcast
    BoxedRound<Id, P> -> Result<T, BoxedRound<Id, P>>
    where
    T: Round<Id>
    Attempts to extract an object of a concrete type, …