mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-17 10:48:28 +00:00
Add payload attestation pool and block packing
Store gossip-verified PayloadAttestationMessages in the operation pool keyed by PayloadAttestationData. At block production time, aggregate them into PayloadAttestations using PTC position mapping and include in the block body. Wire pool insertion into the gossip handler after fork choice.
This commit is contained in:
@@ -61,6 +61,7 @@ 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};
|
||||
@@ -2328,6 +2329,17 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
.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(
|
||||
|
||||
@@ -434,8 +434,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
deposits,
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
// TODO(gloas) need to implement payload attestations
|
||||
payload_attestations: vec![],
|
||||
payload_attestations: self
|
||||
.op_pool
|
||||
.get_payload_attestations(&state, parent_root, &self.spec)
|
||||
.map_err(BlockProductionError::OpPoolError)?,
|
||||
bls_to_execution_changes,
|
||||
},
|
||||
state,
|
||||
|
||||
Reference in New Issue
Block a user