Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/ethlambda/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@ async fn run_node(options: Options) -> eyre::Result<()> {
// block production collects.
let prepared_payloads = ethlambda_blockchain::PreparedPayloads::default();
let rpc_prepared_payloads = prepared_payloads.clone();
// And the attestations of the next PQ block, packed alongside its build.
let prepared_pq_attestations = ethlambda_blockchain::PreparedPqAttestations::default();
let rpc_prepared_pq_attestations = prepared_pq_attestations.clone();
let rpc_p2p = p2p.actor_ref().to_rpc_to_p2p_ref();
let rpc_custody_columns = match &setup.chain {
ChainActor::Beacon {
Expand Down Expand Up @@ -979,6 +982,7 @@ async fn run_node(options: Options) -> eyre::Result<()> {
sync_committee_pool: sync_committee_pool.clone(),
fee_recipients: rpc_fee_recipients,
prepared_payloads: rpc_prepared_payloads,
prepared_pq_attestations: rpc_prepared_pq_attestations,
custody_columns: rpc_custody_columns,
engine: rpc_engine,
events: rpc_events,
Expand Down Expand Up @@ -1034,6 +1038,7 @@ async fn run_node(options: Options) -> eyre::Result<()> {
builder_market,
always_prepare: always_prepare_payload,
prepared_payloads,
prepared_pq_attestations,
},
)
}
Expand Down
2 changes: 2 additions & 0 deletions crates/blockchain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ use crate::store::StoreError;

pub use events::{ChainEvent, EventBus, Topic, UnknownTopic};
pub use payload_attributes::{FeeRecipients, PayloadPreparation, PreparedPayloads};
pub use pq_attestation_packing::PreparedPqAttestations;

pub mod aggregation;
mod beacon_aggregates;
Expand All @@ -79,6 +80,7 @@ pub mod import_timing;
pub mod key_manager;
pub mod metrics;
pub mod payload_attributes;
pub mod pq_attestation_packing;
pub mod reaggregate;
pub mod spec_test_runner;
pub mod store;
Expand Down
20 changes: 20 additions & 0 deletions crates/blockchain/src/payload_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ pub struct PayloadPreparation {
/// The payload builds the actor started ahead of their slots, shared
/// with block production.
pub prepared_payloads: PreparedPayloads,
/// The attestations of the next PQ block, packed and merged ahead of its
/// slot alongside its payload build, shared with block production. See
/// [`crate::pq_attestation_packing`].
pub prepared_pq_attestations: crate::pq_attestation_packing::PreparedPqAttestations,
}

/// Payload builds started ahead of their slot, by the payload id the
Expand Down Expand Up @@ -1022,6 +1026,22 @@ impl BlockChainServer {
let prepared = preparation.prepared_payloads.clone();
let custody = CustodyColumns::from_indices(self.custody_columns.iter().copied());
tokio::spawn(start_build(engine, prepared, custody, key, build));

// A PQ block's attestation proofs are merged now too, rather than at
// the slot: everything the merge reads is already here (see
// `pq_attestation_packing`). Only for a proposer a validator client
// registered here, not for every slot `--always-prepare-payload`
// builds for: a merge is ~0.6 s of the prover nobody would collect.
let proposal_epoch = compute_epoch_at_slot(key.proposal_slot);
if self.store.config().fork_at_epoch(proposal_epoch) == ForkName::Pq
&& key.fee_recipient.is_some()
{
preparation.prepared_pq_attestations.start(
self.store.clone(),
key.head_root,
key.proposal_slot,
);
}
}
}

Expand Down
Loading
Loading