pub fn validator_attestation_duties(
        &self,
        validator_indices: &[u64],
        epoch: Epoch,
        head_block_root: Hash256,
    ) -> Result<(Vec<Option<AttestationDuty>>, Hash256), Error> {
        self.with_committee_cache(head_block_root, epoch, |committee_cache, dependent_root| {
            let duties = validator_indices
                .iter()
                .map(|validator_index| {
                    let validator_index = *validator_index as usize;
                    committee_cache.get_attestation_duties(validator_index)
                })
                .collect();

            Ok((duties, dependent_root))
        })
    }
/// Returns the attestation duties for the given validator indices using the shuffling cache.
///
/// An error may be returned if `head_block_root` is a finalized block, this function is only
/// designed for operations at the head of the chain.
///
/// The returned `Vec` will have the same length as `validator_indices`, any
/// non-existing/inactive validators will have `None` values.
///
/// ## Notes
///
/// This function will try to use the shuffling cache to return the value. If the value is not
/// in the shuffling cache, it will be added. Care should be taken not to wash out the
/// shuffling cache with historical/useless values.
Returns the attestation duties for the given validator indices using the shuffling cache.
An error may be returned if `head_block_root` is a finalized block, this function is only
designed for operations at the head of the chain.


Returns the attestation duties for the given validator indices using the shuffling cache . An error may be returned if ` head_block_root ` is a finalized block this function is only designed for operations at the head of the chain .
pub fn validator_attestation_duties(
        &self,
        validator_indices: &[u64],
        epoch: Epoch,
        head_block_root: Hash256,
    ) -> Result<(Vec<Option<AttestationDuty>>, Hash256), Error> {
        self.with_committee_cache(head_block_root, epoch, |committee_cache, dependent_root| {
            let duties = validator_indices
                .iter()
                .map(|validator_index| {
                    let validator_index = *validator_index as usize;
                    committee_cache.get_attestation_duties(validator_index)
                })
                .collect();
            Ok((duties, dependent_root))
        })
    }
pub fn validator_attestation_duties ( & self , validator_indices : & [ u64 ] , epoch : Epoch , head_block_root : Hash256 , ) -> Result < ( Vec < Option < AttestationDuty > > , Hash256 ) , Error > { self . with_committee_cache ( head_block_root , epoch , | committee_cache , dependent_root | { let duties = validator_indices . iter ( ) . map ( | validator_index | { let validator_index = * validator_index as usize ; committee_cache . get_attestation_duties ( validator_index ) } ) . collect ( ) ; Ok ( ( duties , dependent_root ) ) } ) }
Returns the attestation duties for the given validator indices using the shuffling cache.
Returns the attestation duties for the given validator indices using the shuffling cache .
&self
validator_indices
&[u64]
epoch
Epoch
head_block_root
Hash256
notes
This function will try to use the shuffling cache to return the value. If the value is not
in the shuffling cache, it will be added. Care should be taken not to wash out the
shuffling cache with historical/useless values.
This function will try to use the shuffling cache to return the value . If the value is not in the shuffling cache it will be added . Care should be taken not to wash out the shuffling cache with historical / useless values .