mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 21:27:12 +00:00
Gloas payload cache (#9209)
In Gloas, beacon blocks are imported into fork choice immediately - the payload envelope and data columns arrive separately. KZG commitments moved from the column sidecar into the execution payload bid, so the existing `DataAvailabilityChecker` (which assumes block and data are coupled) can't be used for Gloas. * Introduced `PendingPayloadCache` to keep track of payload and data columns per block root. * Added gossip column verification * Added support for Gloas data column reconstruction * Payload envelope verification simplified: removed `MaybeAvailableEnvelope`, `ExecutedEnvelope`, `EnvelopeImportData` Not yet implemented (tracked with TODOs): - Proper lookup sync for Gloas columns arriving before blocks - Partial column merging for Gloas - Moving `load_gloas_payload_bid` disk reads off the async runtime - Backfill/range sync for Gloas Based on @eserilev's PR and work in progress. See also #9202 for verification. Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: Daniel Knopik <daniel@dknopik.de> Co-Authored-By: Daniel Knopik <107140945+dknopik@users.noreply.github.com> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -119,10 +119,12 @@ impl<T: BeaconChainTypes> FetchBlobsBeaconAdapter<T> {
|
||||
.cached_blob_indexes(block_root)
|
||||
}
|
||||
|
||||
pub(crate) fn cached_data_column_indexes(&self, block_root: &Hash256) -> Option<Vec<u64>> {
|
||||
self.chain
|
||||
.data_availability_checker
|
||||
.cached_data_column_indexes(block_root)
|
||||
pub(crate) fn cached_data_column_indexes(
|
||||
&self,
|
||||
block_root: &Hash256,
|
||||
slot: Slot,
|
||||
) -> Option<Vec<u64>> {
|
||||
self.chain.cached_data_column_indexes(block_root, slot)
|
||||
}
|
||||
|
||||
pub(crate) async fn process_engine_blobs(
|
||||
|
||||
@@ -445,7 +445,7 @@ async fn compute_custody_columns_to_import<T: BeaconChainTypes>(
|
||||
|
||||
// Only consider columns that are not already known to data availability.
|
||||
if let Some(known_columns) =
|
||||
chain_adapter_cloned.cached_data_column_indexes(&block_root)
|
||||
chain_adapter_cloned.cached_data_column_indexes(&block_root, header.slot())
|
||||
{
|
||||
custody_columns.retain(|col| !known_columns.contains(&col.index()));
|
||||
if custody_columns.is_empty() {
|
||||
|
||||
@@ -199,7 +199,7 @@ mod get_blobs_v2 {
|
||||
.returning(|_| None);
|
||||
mock_adapter
|
||||
.expect_cached_data_column_indexes()
|
||||
.returning(|_| None);
|
||||
.returning(|_, _| None);
|
||||
mock_process_engine_blobs_result(
|
||||
&mut mock_adapter,
|
||||
Ok(AvailabilityProcessingStatus::Imported(block_root)),
|
||||
|
||||
Reference in New Issue
Block a user