Trait reef::traits::Ledger

source ·
pub trait Ledger: Copy + Debug + Send + Sync {
    type Validator: Validator;

    // Required methods
    fn name() -> String;
    fn record_root_history() -> usize;
    fn merkle_height() -> u8;
    fn srs() -> &'static UniversalParam;
}
Expand description

A CAP ledger.

This trait aggregates various other traits that constitute a ledger and network. It also provides whole-ledger information.

Required Associated Types§

source

type Validator: Validator

The state of a validator for this ledger.

Note that this determines all of the other types, such as Block and Transaction, used by this ledger.

Required Methods§

source

fn name() -> String

A human-readable name for this ledger.

source

fn record_root_history() -> usize

The number of past MerkleTree roots maintained by validators.

This determines how out of data a CAP transaction can be and still be accepted by a validator. If a transaction was constructed against a ledger state which is less than record_root_history transactions old, the transaction can be accepted.

source

fn merkle_height() -> u8

The height of the ledger’s records MerkleTree.

source

fn srs() -> &'static UniversalParam

The universal setup for PLONK proofs.

Implementors§

source§

impl<const H: u8> Ledger for LedgerWithHeight<H>