mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Fix attestation participation logic error.
This commit is contained in:
@@ -49,15 +49,16 @@ pub fn get_attestation_participation_flag_indices<E: EthSpec>(
|
|||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
// For non same-slot attestations, check execution payload availability
|
// For non same-slot attestations, check execution payload availability
|
||||||
// TODO(EIP7732) Discuss if we want to return new error BeaconStateError::InvalidExecutionPayloadAvailabilityIndex here for bit out of bounds or use something like BeaconStateError::InvalidBitfield
|
|
||||||
let slot_index = data
|
let slot_index = data
|
||||||
.slot
|
.slot
|
||||||
.as_usize()
|
.as_usize()
|
||||||
.safe_rem(E::slots_per_historical_root())?;
|
.safe_rem(E::slots_per_historical_root())?;
|
||||||
state
|
let payload_index = state
|
||||||
.execution_payload_availability()?
|
.execution_payload_availability()?
|
||||||
.get(slot_index)
|
.get(slot_index)
|
||||||
.map_err(|_| Error::InvalidExecutionPayloadAvailabilityIndex(slot_index))?
|
.map(|avail| if avail { 1 } else { 0 } as u64)
|
||||||
|
.map_err(|_| Error::InvalidExecutionPayloadAvailabilityIndex(slot_index))?;
|
||||||
|
data.index == payload_index
|
||||||
};
|
};
|
||||||
is_matching_target && head_root_matches && payload_matches
|
is_matching_target && head_root_matches && payload_matches
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user