Merge branch 'unstable' into gloas-payload-cache

This commit is contained in:
Daniel Knopik
2026-04-28 22:00:19 +02:00
committed by GitHub
42 changed files with 3012 additions and 128 deletions

View File

@@ -57,13 +57,15 @@ use crate::observed_aggregates::{
Error as AttestationObservationError, ObservedAggregateAttestations, ObservedSyncContributions,
};
use crate::observed_attesters::{
ObservedAggregators, ObservedAttesters, ObservedSyncAggregators, ObservedSyncContributors,
ObservedAggregators, ObservedAttesters, ObservedPayloadAttesters, ObservedSyncAggregators,
ObservedSyncContributors,
};
use crate::observed_block_producers::ObservedBlockProducers;
use crate::observed_data_sidecars::ObservedDataSidecars;
use crate::observed_operations::{ObservationOutcome, ObservedOperations};
use crate::observed_slashable::ObservedSlashable;
use crate::partial_data_column_assembler::PartialMergeResult;
use crate::payload_attestation_verification::VerifiedPayloadAttestationMessage;
use crate::payload_bid_verification::payload_bid_cache::GossipVerifiedPayloadBidCache;
#[cfg(not(test))]
use crate::payload_envelope_streamer::{EnvelopeRequestSource, launch_payload_envelope_stream};
@@ -423,6 +425,9 @@ pub struct BeaconChain<T: BeaconChainTypes> {
/// Maintains a record of which validators have been seen to create `SignedContributionAndProofs`
/// in recent epochs.
pub(crate) observed_sync_aggregators: RwLock<ObservedSyncAggregators<T::EthSpec>>,
/// Maintains a record of which validators have sent payload attestation messages
/// in recent slots.
pub(crate) observed_payload_attesters: RwLock<ObservedPayloadAttesters<T::EthSpec>>,
/// Maintains a record of which validators have proposed blocks for each slot.
pub observed_block_producers: RwLock<ObservedBlockProducers<T::EthSpec>>,
/// Maintains a record of blob sidecars seen over the gossip network.
@@ -2314,6 +2319,33 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
})
}
pub fn apply_payload_attestation_to_fork_choice(
&self,
indexed_payload_attestation: &IndexedPayloadAttestation<T::EthSpec>,
ptc: &PTC<T::EthSpec>,
) -> Result<(), Error> {
self.canonical_head
.fork_choice_write_lock()
.on_payload_attestation(
self.slot()?,
indexed_payload_attestation,
AttestationFromBlock::False,
&ptc.0,
)
.map_err(Into::into)
}
/// Add a verified payload attestation message to the operation pool for block inclusion.
pub fn add_payload_attestation_to_pool(
&self,
verified: &VerifiedPayloadAttestationMessage<T>,
) -> Result<(), Error> {
self.op_pool
.insert_payload_attestation_message(verified.payload_attestation_message().clone())
.map_err(Error::OpPoolError)?;
Ok(())
}
/// Accepts some `SyncCommitteeMessage` from the network and attempts to verify it, returning `Ok(_)` if
/// it is valid to be (re)broadcast on the gossip network.
pub fn verify_sync_committee_message_for_gossip(