pub fn rev_iter_block_roots_from(
        &self,
        block_root: Hash256,
    ) -> Result<impl Iterator<Item = Result<(Hash256, Slot), Error>>, Error> {
        let block = self
            .get_block(&block_root)?
            .ok_or(Error::MissingBeaconBlock(block_root))?;
        let state = self
            .get_state(&block.state_root(), Some(block.slot()))?
            .ok_or_else(|| Error::MissingBeaconState(block.state_root()))?;
        let iter = BlockRootsIterator::owned(self.store.clone(), state);
        Ok(std::iter::once(Ok((block_root, block.slot())))
            .chain(iter)
            .map(|result| result.map_err(|e| e.into())))
    }
/// Traverse backwards from `block_root` to find the block roots of its ancestors.
///
/// ## Notes
///
/// `slot` always decreases by `1`.
/// - Skipped slots contain the root of the closest prior
///     non-skipped slot (identical to the way they are stored in `state.block_roots`) .
/// - Iterator returns `(Hash256, Slot)`.
/// - The provided `block_root` is included as the first item in the iterator.
Traverse backwards from `block_root` to find the block roots of its ancestors.
Traverse backwards from ` block_root ` to find the block roots of its ancestors .
pub fn rev_iter_block_roots_from(
        &self,
        block_root: Hash256,
    ) -> Result<impl Iterator<Item = Result<(Hash256, Slot), Error>>, Error> {
        let block = self
            .get_block(&block_root)?
            .ok_or(Error::MissingBeaconBlock(block_root))?;
        let state = self
            .get_state(&block.state_root(), Some(block.slot()))?
            .ok_or_else(|| Error::MissingBeaconState(block.state_root()))?;
        let iter = BlockRootsIterator::owned(self.store.clone(), state);
        Ok(std::iter::once(Ok((block_root, block.slot())))
            .chain(iter)
            .map(|result| result.map_err(|e| e.into())))
    }
pub fn rev_iter_block_roots_from ( & self , block_root : Hash256 , ) -> Result < impl Iterator < Item = Result < ( Hash256 , Slot ) , Error > > , Error > { let block = self . get_block ( & block_root ) ? . ok_or ( Error :: MissingBeaconBlock ( block_root ) ) ? ; let state = self . get_state ( & block . state_root ( ) , Some ( block . slot ( ) ) ) ? . ok_or_else ( | | Error :: MissingBeaconState ( block . state_root ( ) ) ) ? ; let iter = BlockRootsIterator :: owned ( self . store . clone ( ) , state ) ; Ok ( std :: iter :: once ( Ok ( ( block_root , block . slot ( ) ) ) ) . chain ( iter ) . map ( | result | result . map_err ( | e | e . into ( ) ) ) ) }
Traverse backwards from `block_root` to find the block roots of its ancestors.
Traverse backwards from ` block_root ` to find the block roots of its ancestors .
&self
block_root
Hash256
notes
`slot` always decreases by `1`.
Skipped slots contain the root of the closest prior
non-skipped slot (identical to the way they are stored in `state.block_roots`) .
Iterator returns `(Hash256, Slot)`.
The provided `block_root` is included as the first item in the iterator.
` slot ` always decreases by ` 1 ` . Skipped slots contain the root of the closest prior non - skipped slot ( identical to the way they are stored in ` state . block_roots ` ) . Iterator returns ` ( Hash256 Slot ) ` . The provided ` block_root ` is included as the first item in the iterator .