Skip to main content

BeaconChainInfo

Trait BeaconChainInfo 

Source
pub trait BeaconChainInfo: ChainInfo<OwnedBeaconChainBlock> {
    // Required methods
    fn shard_segment_roots(
        &self,
        ancestor_block_number: BlockNumber,
        descendant_block_root: &BlockRoot,
    ) -> Result<Arc<[ShardSegmentRoot]>, ShardSegmentRootsError>;
    fn last_super_segment_header(&self) -> Option<SuperSegmentHeader>;
    fn previous_super_segment_header(
        &self,
        block_number: BlockNumber,
    ) -> Option<SuperSegmentHeader>;
    fn get_super_segment_header(
        &self,
        super_segment_index: SuperSegmentIndex,
    ) -> Option<SuperSegmentHeader>;
    fn get_super_segment_header_for_segment_index(
        &self,
        segment_index: SegmentIndex,
    ) -> Option<SuperSegmentHeader>;
    fn shard_max_local_segment_index(
        &self,
        shard_index: ShardIndex,
    ) -> Option<LocalSegmentIndex>;
}
Expand description

Beacon chain info

Required Methods§

Source

fn shard_segment_roots( &self, ancestor_block_number: BlockNumber, descendant_block_root: &BlockRoot, ) -> Result<Arc<[ShardSegmentRoot]>, ShardSegmentRootsError>

Returns intermediate and leaf shard segment roots included in the block at ancestor_block_number on the chain ending at descendant_block_root.

If ancestor_block_number is the descendant’s own number, the descendant’s shard segment roots are returned.

Source

fn last_super_segment_header(&self) -> Option<SuperSegmentHeader>

Returns the last observed super segment header

Source

fn previous_super_segment_header( &self, block_number: BlockNumber, ) -> Option<SuperSegmentHeader>

Returns the previous super segment header for the block built with the specified target block number.

None is returned for blocks <= 1.

Source

fn get_super_segment_header( &self, super_segment_index: SuperSegmentIndex, ) -> Option<SuperSegmentHeader>

Get a single super segment header

Source

fn get_super_segment_header_for_segment_index( &self, segment_index: SegmentIndex, ) -> Option<SuperSegmentHeader>

Get a single super segment header for a segment index

Source

fn shard_max_local_segment_index( &self, shard_index: ShardIndex, ) -> Option<LocalSegmentIndex>

Returns the highest local segment index of a shard (the beacon chain included) that was included in super segments.

None is returned if no super segment included a segment of the shard yet.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§