[][src]Trait lmd_ghost::LmdGhost

pub trait LmdGhost<S: Store, E: EthSpec>: Send + Sync {
    fn new(
        store: Arc<S>,
        finalized_block: &BeaconBlock<E>,
        finalized_root: Hash256
    ) -> Self;
fn process_attestation(
        &self,
        validator_index: usize,
        block_hash: Hash256,
        block_slot: Slot
    ) -> Result<()>;
fn process_block(
        &self,
        block: &BeaconBlock<E>,
        block_hash: Hash256
    ) -> Result<()>;
fn find_head<F>(
        &self,
        start_block_slot: Slot,
        start_block_root: Hash256,
        weight: F
    ) -> Result<Hash256>
    where
        F: Fn(usize) -> Option<u64> + Copy
;
fn update_finalized_root(
        &self,
        finalized_block: &BeaconBlock<E>,
        finalized_block_root: Hash256
    ) -> Result<()>;
fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Slot)>;
fn verify_integrity(&self) -> Result<()>; }

Required methods

fn new(
    store: Arc<S>,
    finalized_block: &BeaconBlock<E>,
    finalized_root: Hash256
) -> Self

Create a new instance, with the given store and finalized_root.

fn process_attestation(
    &self,
    validator_index: usize,
    block_hash: Hash256,
    block_slot: Slot
) -> Result<()>

Process an attestation message from some validator that attests to some block_hash representing a block at some block_slot.

fn process_block(
    &self,
    block: &BeaconBlock<E>,
    block_hash: Hash256
) -> Result<()>

Process a block that was seen on the network.

fn find_head<F>(
    &self,
    start_block_slot: Slot,
    start_block_root: Hash256,
    weight: F
) -> Result<Hash256> where
    F: Fn(usize) -> Option<u64> + Copy

Returns the head of the chain, starting the search at start_block_root and moving upwards (in block height).

fn update_finalized_root(
    &self,
    finalized_block: &BeaconBlock<E>,
    finalized_block_root: Hash256
) -> Result<()>

Provide an indication that the blockchain has been finalized at the given finalized_block.

finalized_block_root must be the root of finalized_block.

fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Slot)>

Returns the latest message for a given validator index.

fn verify_integrity(&self) -> Result<()>

Runs an integrity verification function on fork choice algorithm.

Returns Ok(()) if the underlying fork choice has maintained it's integrity, Err(description) otherwise.

Loading content...

Implementors

impl<T, E> LmdGhost<T, E> for ThreadSafeReducedTree<T, E> where
    T: Store,
    E: EthSpec
[src]

fn process_block(
    &self,
    block: &BeaconBlock<E>,
    block_hash: Hash256
) -> SuperResult<()>
[src]

Process a block that was seen on the network.

Loading content...