[][src]Struct exonum::blockchain::config::ConsensusConfig

pub struct ConsensusConfig {
    pub round_timeout: Milliseconds,
    pub status_timeout: Milliseconds,
    pub peers_timeout: Milliseconds,
    pub txs_block_limit: u32,
    pub max_message_len: u32,
    pub min_propose_timeout: Milliseconds,
    pub max_propose_timeout: Milliseconds,
    pub propose_timeout_threshold: u32,
}

Consensus algorithm parameters.

This configuration is initially created with default recommended values, which can later be edited as required. The parameters in this configuration should be the same for all nodes in the network and can be changed using the configuration updater service.

Default propose timeout value, along with the threshold, is chosen for maximal performance. In order to slow down block generation,hence consume less disk space, these values can be increased.

For additional information on the Exonum consensus algorithm, refer to Consensus in Exonum.

Fields

round_timeout: Milliseconds

Interval between rounds. This interval defines the time that passes between the moment a new block is committed to the blockchain and the time when a new round starts, regardless of whether a new block has been committed during this period or not.

Note that rounds in Exonum do not have a defined end time. Nodes in a new round can continue to vote for proposals and process messages related to previous rounds.

status_timeout: Milliseconds

Period of sending a Status message. This parameter defines the frequency with which a node broadcasts its status message to the network.

peers_timeout: Milliseconds

Peer exchange timeout. This parameter defines the frequency with which a node requests collected Connect messages from a random peer node in the network.

txs_block_limit: u32

Maximum number of transactions per block.

max_message_len: u32

Maximum message length (in bytes). This parameter determines the maximum size of both consensus messages and transactions. The default value of the parameter is 1 MB (1024 * 1024 bytes). The range of possible values for this parameter is between 1MB and 2^32-1 bytes.

min_propose_timeout: Milliseconds

Minimal propose timeout.

max_propose_timeout: Milliseconds

Maximal propose timeout.

propose_timeout_threshold: u32

Amount of transactions in pool to start use min_propose_timeout.

Default value is equal to half of the txs_block_limit in order to gather more transactions in a block if the transaction pool is almost empty, and create blocks faster when there are enough transactions in the pool.

Methods

impl ConsensusConfig
[src]

pub const DEFAULT_MAX_MESSAGE_LEN: u32[src]

Default value for max_message_len.

Trait Implementations

impl Default for ConsensusConfig
[src]

impl PartialEq<ConsensusConfig> for ConsensusConfig
[src]

impl Clone for ConsensusConfig
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ConsensusConfig
[src]

impl<'de> Deserialize<'de> for ConsensusConfig
[src]

impl Serialize for ConsensusConfig
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> SerializeContent for T where
    T: Serialize
[src]

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Erased for T

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same for T

type Output = T

Should always be Self