Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CGC from data_availability checker #7033

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

dapplion
Copy link
Collaborator

Issue Addressed

Validator custody makes the CGC and set of sampling columns dynamic. Right now this information is stored twice:

  • in the data availability checker
  • in the network globals

If that state becomes dynamic we must make sure it is in sync updating it twice, or guarding it behind a mutex. However, I noted that we don't really have to keep the CGC inside the data availability checker. All consumers can actually read it from the network globals, and we can update make_available to read the expected count of data columns from the block.

@dapplion dapplion added the das Data Availability Sampling label Feb 24, 2025
@dapplion dapplion requested a review from jxs as a code owner February 24, 2025 23:40
@dapplion dapplion added the ready-for-review The code is ready for review label Feb 24, 2025
@@ -104,6 +109,8 @@ impl<E: EthSpec> RpcBlock<E> {
Self {
block_root,
block: RpcBlockInner::Block(block),
// Block has zero columns
custody_columns_count: 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An RPC blocks without columns will never read this value

if received_column_count >= total_column_count {
return ReconstructColumnsDecision::No("all columns received");
}
// Only supernodes receive >= 50% of columns
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the "not required for full node" condition as it's redundant and would force us to pipe the custody group here somehow

let mut expected_block_root = anchor_info.oldest_block_parent;
let mut prev_block_slot = anchor_info.oldest_block_slot;
let mut new_oldest_blob_slot = blob_info.oldest_blob_slot;
let mut new_oldest_data_column_slot = data_column_info.oldest_data_column_slot;

let mut blob_batch = Vec::<KeyValueStoreOp>::with_capacity(blob_batch_size);
let mut blob_batch = Vec::<KeyValueStoreOp>::new();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using with_capacity here feels like a micro-optimization unless I'm missing something. Dropped it as we don't have access to the column count here anymore

@@ -815,6 +815,11 @@ where
(0..self.validator_keypairs.len()).collect()
}

pub fn get_sampling_column_count(&self) -> usize {
// Default column custody count
8
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have no effect on tests I believe

block,
columns.clone(),
// TODO
columns.len(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assumes the CGC value is equal to all the columns received, which makes sense. We can change it later if we want to do more complex tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
das Data Availability Sampling ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant