Add back AttestationFromBlock

This commit is contained in:
Michael Sproul
2026-03-26 10:39:04 +11:00
parent fdf2fd2267
commit 9f1f68c3ee
6 changed files with 51 additions and 27 deletions

View File

@@ -85,8 +85,8 @@ use execution_layer::{
};
use fixed_bytes::FixedBytesExtended;
use fork_choice::{
ExecutionStatus, ForkChoice, ForkchoiceUpdateParameters, InvalidationOperation,
PayloadVerificationStatus, ResetPayloadStatuses,
AttestationFromBlock, ExecutionStatus, ForkChoice, ForkchoiceUpdateParameters,
InvalidationOperation, PayloadVerificationStatus, ResetPayloadStatuses,
};
use futures::channel::mpsc::Sender;
use itertools::Itertools;
@@ -2297,7 +2297,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.on_attestation(
self.slot()?,
verified.indexed_attestation().to_ref(),
false,
AttestationFromBlock::False,
&self.spec,
)
.map_err(Into::into)
@@ -4757,6 +4757,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
})
}
// TODO(gloas): wrong for Gloas, needs an update
pub fn overridden_forkchoice_update_params_or_failure_reason(
&self,
canonical_forkchoice_params: &ForkchoiceUpdateParameters,

View File

@@ -71,7 +71,7 @@ use bls::{PublicKey, PublicKeyBytes};
use educe::Educe;
use eth2::types::{BlockGossip, EventKind};
use execution_layer::PayloadStatus;
pub use fork_choice::PayloadVerificationStatus;
pub use fork_choice::{AttestationFromBlock, PayloadVerificationStatus};
use metrics::TryExt;
use parking_lot::RwLockReadGuard;
use proto_array::Block as ProtoBlock;
@@ -1666,7 +1666,12 @@ impl<T: BeaconChainTypes> ExecutionPendingBlock<T> {
.get_indexed_attestation(&state, attestation)
.map_err(|e| BlockError::PerBlockProcessingError(e.into_with_index(i)))?;
match fork_choice.on_attestation(current_slot, indexed_attestation, true, &chain.spec) {
match fork_choice.on_attestation(
current_slot,
indexed_attestation,
AttestationFromBlock::True,
&chain.spec,
) {
Ok(()) => Ok(()),
// Ignore invalid attestations whilst importing attestations from a block. The
// block might be very old and therefore the attestations useless to fork choice.
@@ -1689,7 +1694,7 @@ impl<T: BeaconChainTypes> ExecutionPendingBlock<T> {
match fork_choice.on_payload_attestation(
current_slot,
indexed_payload_attestation,
true,
AttestationFromBlock::True,
&ptc.0,
) {
Ok(()) => Ok(()),