Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

This commit is contained in:
realbigsean
2024-06-20 10:41:17 -04:00
143 changed files with 1467 additions and 1519 deletions

View File

@@ -129,6 +129,7 @@ pub enum BlockProcessingError {
target_address: Address,
},
InavlidConsolidationSignature,
PendingAttestationInElectra,
}
impl From<BeaconStateError> for BlockProcessingError {

View File

@@ -91,33 +91,30 @@ pub mod base {
)
.map_err(|e| e.into_with_index(i))?;
match attestation {
AttestationRef::Base(att) => {
let pending_attestation = PendingAttestation {
aggregation_bits: att.aggregation_bits.clone(),
data: att.data.clone(),
inclusion_delay: state.slot().safe_sub(att.data.slot)?.as_u64(),
proposer_index,
};
if attestation.data().target.epoch == state.current_epoch() {
state
.as_base_mut()?
.current_epoch_attestations
.push(pending_attestation)?;
} else {
state
.as_base_mut()?
.previous_epoch_attestations
.push(pending_attestation)?;
}
}
AttestationRef::Electra(_) => {
// TODO(electra) pending attestations are only phase 0
// so we should just raise a relevant error here
todo!()
}
let AttestationRef::Base(attestation) = attestation else {
// Pending attestations have been deprecated in a altair, this branch should
// never happen
return Err(BlockProcessingError::PendingAttestationInElectra);
};
let pending_attestation = PendingAttestation {
aggregation_bits: attestation.aggregation_bits.clone(),
data: attestation.data.clone(),
inclusion_delay: state.slot().safe_sub(attestation.data.slot)?.as_u64(),
proposer_index,
};
if attestation.data.target.epoch == state.current_epoch() {
state
.as_base_mut()?
.current_epoch_attestations
.push(pending_attestation)?;
} else {
state
.as_base_mut()?
.previous_epoch_attestations
.push(pending_attestation)?;
}
}
Ok(())

View File

@@ -326,7 +326,6 @@ where
genesis_validators_root,
);
// TODO(electra), signing root isnt unique in the case of electra
let message = indexed_attestation.data().signing_root(domain);
Ok(SignatureSet::multiple_pubkeys(signature, pubkeys, message))