mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Data column custody info (#7648)
#7647 Introduces a new record in the blobs db `DataColumnCustodyInfo` When `DataColumnCustodyInfo` exists in the db this indicates that a recent cgc change has occurred and/or that a custody backfill sync is currently in progress (custody backfill will be added as a separate PR). When a cgc change has occurred `earliest_available_slot` will be equal to the slot at which the cgc change occured. During custody backfill sync`earliest_available_slot` should be updated incrementally as it progresses. ~~Note that if `advertise_false_custody_group_count` is enabled we do not add a `DataColumnCustodyInfo` record in the db as that would affect the status v2 response.~~ (See comment https://github.com/sigp/lighthouse/pull/7648#discussion_r2212403389) ~~If `DataColumnCustodyInfo` doesn't exist in the db this indicates that we have fulfilled our custody requirements up to the DA window.~~ (It now always exist, and the slot will be set to `None` once backfill is complete) StatusV2 now uses `DataColumnCustodyInfo` to calculate the `earliest_available_slot` if a `DataColumnCustodyInfo` record exists in the db, if it's `None`, then we return the `oldest_block_slot`.
This commit is contained in:
@@ -29,8 +29,22 @@ pub(crate) fn status_message<T: BeaconChainTypes>(beacon_chain: &BeaconChain<T>)
|
||||
finalized_checkpoint.root = Hash256::zero();
|
||||
}
|
||||
|
||||
let earliest_available_slot = beacon_chain.store.get_anchor_info().oldest_block_slot;
|
||||
// NOTE: We are making an assumption that `get_data_column_custody_info` wont fail.
|
||||
let earliest_available_data_column_slot = beacon_chain
|
||||
.store
|
||||
.get_data_column_custody_info()
|
||||
.ok()
|
||||
.flatten()
|
||||
.and_then(|info| info.earliest_data_column_slot);
|
||||
|
||||
// If data_column_custody_info.earliest_data_column_slot is `None`,
|
||||
// no recent cgc changes have occurred and no cgc backfill is in progress.
|
||||
let earliest_available_slot =
|
||||
if let Some(earliest_available_data_column_slot) = earliest_available_data_column_slot {
|
||||
earliest_available_data_column_slot
|
||||
} else {
|
||||
beacon_chain.store.get_anchor_info().oldest_block_slot
|
||||
};
|
||||
StatusMessage::V2(StatusMessageV2 {
|
||||
fork_digest,
|
||||
finalized_root: finalized_checkpoint.root,
|
||||
|
||||
Reference in New Issue
Block a user