Skip to content

Commit 3badc3b

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

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs

Lines changed: 9 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,14 @@ 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+
self.critical
886+
.write()
887+
.in_memory
888+
.get_mut(&block_root)
889+
.map(|pending_components| {
890+
pending_components.reconstruction_started();
891+
});
892+
886893
metrics::inc_counter(&KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS);
887894
let timer = metrics::start_timer(&metrics::DATA_AVAILABILITY_RECONSTRUCTION_TIME);
888895

0 commit comments

Comments
 (0)