-
Notifications
You must be signed in to change notification settings - Fork 808
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
base: unstable
Are you sure you want to change the base?
Conversation
32018b4
to
629d054
Compare
@@ -104,6 +109,8 @@ impl<E: EthSpec> RpcBlock<E> { | |||
Self { | |||
block_root, | |||
block: RpcBlockInner::Block(block), | |||
// Block has zero columns | |||
custody_columns_count: 0, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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
Issue Addressed
Validator custody makes the CGC and set of sampling columns dynamic. Right now this information is stored twice:
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.