Remove CGC from data_availability checker (#7033)

- Part of https://github.com/sigp/lighthouse/issues/6767

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.
This commit is contained in:
Lion - dapplion
2025-03-26 02:19:51 -03:00
committed by GitHub
parent 9dce729cb6
commit 6f31d44343
21 changed files with 298 additions and 215 deletions

View File

@@ -1203,8 +1203,12 @@ impl TestRig {
payload_verification_status: PayloadVerificationStatus::Verified,
is_valid_merge_transition_block: false,
};
let executed_block =
AvailabilityPendingExecutedBlock::new(block, import_data, payload_verification_outcome);
let executed_block = AvailabilityPendingExecutedBlock::new(
block,
import_data,
payload_verification_outcome,
self.network_globals.custody_columns_count() as usize,
);
match self
.harness
.chain

View File

@@ -449,7 +449,15 @@ fn build_rpc_block(
RpcBlock::new(None, block, Some(blobs.clone())).unwrap()
}
Some(DataSidecars::DataColumns(columns)) => {
RpcBlock::new_with_custody_columns(None, block, columns.clone(), spec).unwrap()
RpcBlock::new_with_custody_columns(
None,
block,
columns.clone(),
// TODO(das): Assumes CGC = max value. Change if we want to do more complex tests
columns.len(),
spec,
)
.unwrap()
}
None => RpcBlock::new_without_blobs(None, block),
}