Skip to content

Commit efabb98

Browse files
committed
Update reconstruction status on PendingComponents from cache instead of the clone.
1 parent 0f355a7 commit efabb98

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ impl<T: BeaconChainTypes> OverflowLRUCache<T> {
868868
) -> Result<Option<AvailabilityAndReconstructedColumns<T::EthSpec>>, AvailabilityCheckError>
869869
{
870870
// Clone the pending components, so we don't hold the read lock during reconstruction
871-
let Some(mut pending_components) = self
871+
let Some(pending_components) = self
872872
.peek_pending_components(&block_root, |pending_components_opt| {
873873
pending_components_opt.cloned()
874874
})
@@ -882,7 +882,12 @@ impl<T: BeaconChainTypes> OverflowLRUCache<T> {
882882
.map(|r| self.should_reconstruct(&r, &pending_components))?;
883883

884884
if should_reconstruct {
885-
pending_components.reconstruction_started();
885+
if let Some(pending_components_mut) =
886+
self.critical.write().in_memory.get_mut(&block_root)
887+
{
888+
pending_components_mut.reconstruction_started();
889+
}
890+
886891
metrics::inc_counter(&KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS);
887892
let timer = metrics::start_timer(&metrics::DATA_AVAILABILITY_RECONSTRUCTION_TIME);
888893

0 commit comments

Comments
 (0)