Verify whether validators really are unknown during sync committee duty API request (#5174)

* Verify whether validators really are unknown during sync committee duty API request

* Merge branch 'unstable' into fix-4717

* Merge branch 'unstable' into fix-4717

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into fix-4717
This commit is contained in:
dknopik
2024-03-23 01:01:11 +01:00
committed by GitHub
parent 035c378c61
commit 0a6e4a11d7
3 changed files with 54 additions and 7 deletions

View File

@@ -960,10 +960,10 @@ impl<T: EthSpec> BeaconState<T> {
epoch: Epoch,
validator_indices: &[u64],
spec: &ChainSpec,
) -> Result<Vec<Option<SyncDuty>>, Error> {
) -> Result<Vec<Result<Option<SyncDuty>, Error>>, Error> {
let sync_committee = self.get_built_sync_committee(epoch, spec)?;
validator_indices
Ok(validator_indices
.iter()
.map(|&validator_index| {
let pubkey = self.get_validator(validator_index as usize)?.pubkey;
@@ -974,7 +974,7 @@ impl<T: EthSpec> BeaconState<T> {
sync_committee,
))
})
.collect()
.collect())
}
/// Get the canonical root of the `latest_block_header`, filling in its state root if necessary.