[−][src]Struct beacon_chain::ForkChoice
Methods
impl<T: BeaconChainTypes> ForkChoice<T>
[src]
pub fn new(
store: Arc<T::Store>,
backend: T::LmdGhost,
genesis_block_root: Hash256
) -> Self
[src]
store: Arc<T::Store>,
backend: T::LmdGhost,
genesis_block_root: Hash256
) -> Self
Instantiate a new fork chooser.
"Genesis" does not necessarily need to be the absolute genesis, it can be some finalized block.
pub fn find_head(&self, chain: &BeaconChain<T>) -> Result<Hash256, Error>
[src]
pub fn process_block(
&self,
state: &BeaconState<T::EthSpec>,
block: &BeaconBlock<T::EthSpec>,
block_root: Hash256
) -> Result<(), Error>
[src]
&self,
state: &BeaconState<T::EthSpec>,
block: &BeaconBlock<T::EthSpec>,
block_root: Hash256
) -> Result<(), Error>
Process all attestations in the given block
.
Assumes the block (and therefore it's attestations) are valid. It is a logic error to provide an invalid block.
pub fn process_attestation(
&self,
state: &BeaconState<T::EthSpec>,
attestation: &Attestation<T::EthSpec>,
block: &BeaconBlock<T::EthSpec>
) -> Result<(), Error>
[src]
&self,
state: &BeaconState<T::EthSpec>,
attestation: &Attestation<T::EthSpec>,
block: &BeaconBlock<T::EthSpec>
) -> Result<(), Error>
Process an attestation which references block
in attestation.data.beacon_block_root
.
Assumes the attestation is valid.
pub fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Slot)>
[src]
Returns the latest message for a given validator, if any.
Returns (block_root, block_slot)
.
pub fn verify_integrity(&self) -> Result<(), String>
[src]
Runs an integrity verification function on the underlying fork choice algorithm.
Returns Ok(())
if the underlying fork choice has maintained it's integrity,
Err(description)
otherwise.
pub fn process_finalization(
&self,
finalized_block: &BeaconBlock<T::EthSpec>,
finalized_block_root: Hash256
) -> Result<(), Error>
[src]
&self,
finalized_block: &BeaconBlock<T::EthSpec>,
finalized_block_root: Hash256
) -> Result<(), Error>
Inform the fork choice that the given block (and corresponding root) have been finalized so it may prune it's storage.
finalized_block_root
must be the root of finalized_block
.
Auto Trait Implementations
impl<T> Send for ForkChoice<T> where
<T as BeaconChainTypes>::LmdGhost: Send,
<T as BeaconChainTypes>::Store: Send + Sync,
<T as BeaconChainTypes>::LmdGhost: Send,
<T as BeaconChainTypes>::Store: Send + Sync,
impl<T> Unpin for ForkChoice<T> where
<T as BeaconChainTypes>::LmdGhost: Unpin,
<T as BeaconChainTypes>::LmdGhost: Unpin,
impl<T> Sync for ForkChoice<T> where
<T as BeaconChainTypes>::LmdGhost: Sync,
<T as BeaconChainTypes>::Store: Send + Sync,
<T as BeaconChainTypes>::LmdGhost: Sync,
<T as BeaconChainTypes>::Store: Send + Sync,
impl<T> UnwindSafe for ForkChoice<T> where
<T as BeaconChainTypes>::LmdGhost: UnwindSafe,
<T as BeaconChainTypes>::Store: RefUnwindSafe,
<T as BeaconChainTypes>::LmdGhost: UnwindSafe,
<T as BeaconChainTypes>::Store: RefUnwindSafe,
impl<T> RefUnwindSafe for ForkChoice<T> where
<T as BeaconChainTypes>::LmdGhost: RefUnwindSafe,
<T as BeaconChainTypes>::Store: RefUnwindSafe,
<T as BeaconChainTypes>::LmdGhost: RefUnwindSafe,
<T as BeaconChainTypes>::Store: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,