[][src]Enum exonum::blockchain::BlockContents

#[non_exhaustive]pub enum BlockContents<'a> {
    Transactions(&'a [Hash]),
    Skip,
}

Contents of a block, defining how the block is applied to the blockchain state.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Transactions(&'a [Hash])

Contents of an ordinary block: a list of transaction hashes to execute. Besides transactions, the blockchain will execute before_transactions and after_transactions hooks for all active services on the blockchain. If / when the block is accepted, the runtimes will be notified about the acceptance (the runtimes can notify services then).

See Runtime docs for more details about normal block processing in the context of runtimes and services.

Skip

Contents of a block skip. A block skip means executing no transactions and no service hooks. As such, the blockchain state is guaranteed to remain the same, and no errors can be raised during execution.

Block skips are recorded in the blockchain as Blocks; however, unlike normal blocks, block skips are not recorded permanently. Instead, only the latest skip on the current blockchain height is recorded. If a normal block is accepted, the recorded skip (if any) is removed. As one can see, such lax record-keeping does not harm blockchain authenticity or ability to replicate blockchain state. Indeed, because skips do not affect state, it is possible to skip (heh) all block skips without losing any blockchain information.

Block skips are useful during the periods of network inactivity. In this case, skips signal that the blockchain network is operational without bloating the storage. In terms of distributed systems, keeping such a "heartbeat" ensures that the consensus algorithm correctly estimates delays in the network. Without skips, such delays would have high estimates, which would negatively affect transaction latency once transactions appear in the network.

Trait Implementations

impl<'a> Clone for BlockContents<'a>[src]

impl<'a> Debug for BlockContents<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for BlockContents<'a>

impl<'a> Send for BlockContents<'a>

impl<'a> Sync for BlockContents<'a>

impl<'a> Unpin for BlockContents<'a>

impl<'a> UnwindSafe for BlockContents<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,