mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-02 20:34:27 +00:00
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:
@@ -3031,6 +3031,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
pub async fn verify_block_for_gossip(
|
||||
self: &Arc<Self>,
|
||||
block: Arc<SignedBeaconBlock<T::EthSpec>>,
|
||||
custody_columns_count: usize,
|
||||
) -> Result<GossipVerifiedBlock<T>, BlockError> {
|
||||
let chain = self.clone();
|
||||
self.task_executor
|
||||
@@ -3040,7 +3041,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
let slot = block.slot();
|
||||
let graffiti_string = block.message().body().graffiti().as_utf8_lossy();
|
||||
|
||||
match GossipVerifiedBlock::new(block, &chain) {
|
||||
match GossipVerifiedBlock::new(block, &chain, custody_columns_count) {
|
||||
Ok(verified) => {
|
||||
let commitments_formatted = verified.block.commitments_formatted();
|
||||
debug!(
|
||||
@@ -7161,10 +7162,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
block_root: Hash256,
|
||||
block_data: AvailableBlockData<T::EthSpec>,
|
||||
) -> Result<Option<StoreOp<T::EthSpec>>, String> {
|
||||
// TODO(das) we currently store all subnet sampled columns. Tracking issue to exclude non
|
||||
// custody columns: https://github.com/sigp/lighthouse/issues/6465
|
||||
let _custody_columns_count = self.data_availability_checker.get_sampling_column_count();
|
||||
|
||||
match block_data {
|
||||
AvailableBlockData::NoData => Ok(None),
|
||||
AvailableBlockData::Blobs(blobs) => {
|
||||
|
||||
Reference in New Issue
Block a user