Skip to content

Commit

Permalink
Add more code comments for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygchen committed Jan 7, 2025
1 parent aabb5c1 commit 4173135
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
}

if pending_components.is_available(self.sampling_column_count, log) {
// We keep the pending components in the availability cache during block import (#5845).
// `data_column_recv` is returned as part of the available block and is no longer needed here.
write_lock.put(block_root, pending_components.clone_without_column_recv());
// No need to hold the write lock anymore
drop(write_lock);
pending_components.make_available(&self.spec, |diet_block| {
self.state_cache.recover_pending_executed_block(diet_block)
Expand Down Expand Up @@ -548,8 +549,9 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
pending_components.merge_data_columns(kzg_verified_data_columns)?;

if pending_components.is_available(self.sampling_column_count, log) {
// We keep the pending components in the availability cache during block import (#5845).
// `data_column_recv` is returned as part of the available block and is no longer needed here.
write_lock.put(block_root, pending_components.clone_without_column_recv());
// No need to hold the write lock anymore
drop(write_lock);
pending_components.make_available(&self.spec, |diet_block| {
self.state_cache.recover_pending_executed_block(diet_block)
Expand Down Expand Up @@ -637,8 +639,9 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {

// Check if we have all components and entire set is consistent.
if pending_components.is_available(self.sampling_column_count, log) {
// We keep the pending components in the availability cache during block import (#5845).
// `data_column_recv` is returned as part of the available block and is no longer needed here.
write_lock.put(block_root, pending_components.clone_without_column_recv());
// No need to hold the write lock anymore
drop(write_lock);
pending_components.make_available(&self.spec, |diet_block| {
self.state_cache.recover_pending_executed_block(diet_block)
Expand Down

0 comments on commit 4173135

Please sign in to comment.