diff --git a/beacon_node/network/src/network_beacon_processor/mod.rs b/beacon_node/network/src/network_beacon_processor/mod.rs index 7a4d697880..e026d04776 100644 --- a/beacon_node/network/src/network_beacon_processor/mod.rs +++ b/beacon_node/network/src/network_beacon_processor/mod.rs @@ -554,7 +554,7 @@ impl NetworkBeaconProcessor { pub fn send_rpc_validate_data_columns( self: &Arc, block_root: Hash256, - data_columns: Vec>>, + data_columns: DataColumnSidecarList, seen_timestamp: Duration, id: SamplingId, ) -> Result<(), Error> { diff --git a/beacon_node/network/src/sync/network_context.rs b/beacon_node/network/src/sync/network_context.rs index 3197fcf13e..f4db7e2256 100644 --- a/beacon_node/network/src/sync/network_context.rs +++ b/beacon_node/network/src/sync/network_context.rs @@ -1216,7 +1216,7 @@ impl SyncNetworkContext { id: DataColumnsByRootRequestId, peer_id: PeerId, rpc_event: RpcEvent>>, - ) -> Option>>>> { + ) -> Option>> { let resp = self .data_columns_by_root_requests .on_response(id, rpc_event); @@ -1314,7 +1314,7 @@ impl SyncNetworkContext { id: CustodyId, req_id: DataColumnsByRootRequestId, peer_id: PeerId, - resp: RpcResponseResult>>>, + resp: RpcResponseResult>, ) -> Option> { let span = span!( Level::INFO, @@ -1381,7 +1381,7 @@ impl SyncNetworkContext { id: CustodyByRangeRequestId, req_id: DataColumnsByRangeRequestId, peer_id: PeerId, - resp: RpcResponseResult>>>, + resp: RpcResponseResult>, ) -> Option> { // Note: need to remove the request to borrow self again below. Otherwise we can't // do nested requests diff --git a/beacon_node/network/src/sync/network_context/block_components_by_range.rs b/beacon_node/network/src/sync/network_context/block_components_by_range.rs index 7c8e59eb97..00f64f2e39 100644 --- a/beacon_node/network/src/sync/network_context/block_components_by_range.rs +++ b/beacon_node/network/src/sync/network_context/block_components_by_range.rs @@ -15,8 +15,8 @@ use parking_lot::RwLock; use std::collections::{HashMap, HashSet}; use std::sync::Arc; use types::{ - BlobSidecar, ChainSpec, ColumnIndex, DataColumnSidecar, EthSpec, Hash256, RuntimeVariableList, - SignedBeaconBlock, Slot, + BlobSidecar, ChainSpec, ColumnIndex, DataColumnSidecarList, EthSpec, Hash256, + RuntimeVariableList, SignedBeaconBlock, Slot, }; /// Given a `BlocksByRangeRequest` (a range of slots) fetches all necessary data to return @@ -57,7 +57,7 @@ enum FuluEnabledState { blocks: Vec>>, block_peer: PeerId, custody_by_range_request: - ByRangeRequest>>, PeerGroup>, + ByRangeRequest, PeerGroup>, }, } @@ -389,7 +389,7 @@ impl BlockComponentsByRangeRequest { pub fn on_custody_by_range_result( &mut self, id: CustodyByRangeRequestId, - data: Vec>>, + data: DataColumnSidecarList, peers: PeerGroup, cx: &mut SyncNetworkContext, ) -> BlockComponentsByRangeRequestResult { @@ -483,7 +483,7 @@ fn couple_blocks_deneb( fn couple_blocks_fulu( blocks: Vec>>, - data_columns: Vec>>, + data_columns: DataColumnSidecarList, custody_column_indices: Vec, spec: &ChainSpec, ) -> Result>, Error> { diff --git a/beacon_node/network/src/sync/network_context/custody_by_range.rs b/beacon_node/network/src/sync/network_context/custody_by_range.rs index 22d0d02d98..6b4d233188 100644 --- a/beacon_node/network/src/sync/network_context/custody_by_range.rs +++ b/beacon_node/network/src/sync/network_context/custody_by_range.rs @@ -16,8 +16,8 @@ use std::time::{Duration, Instant}; use std::{collections::HashMap, marker::PhantomData, sync::Arc}; use tracing::{debug, warn}; use types::{ - data_column_sidecar::ColumnIndex, DataColumnSidecar, Epoch, EthSpec, Hash256, - SignedBeaconBlockHeader, Slot, + data_column_sidecar::ColumnIndex, DataColumnSidecar, DataColumnSidecarList, Epoch, EthSpec, + Hash256, SignedBeaconBlockHeader, Slot, }; use super::{PeerGroup, RpcResponseResult, SyncNetworkContext}; @@ -25,8 +25,6 @@ use super::{PeerGroup, RpcResponseResult, SyncNetworkContext}; const TEMPORARY_FAULT_EXPIRY_SECONDS: u64 = 15; const REQUEST_EXPIRY_SECONDS: u64 = 300; -type DataColumnSidecarList = Vec>>; - pub struct ActiveCustodyByRangeRequest { start_time: Instant, id: CustodyByRangeRequestId, diff --git a/beacon_node/network/src/sync/network_context/custody_by_root.rs b/beacon_node/network/src/sync/network_context/custody_by_root.rs index 3b7b373790..489b9c3b11 100644 --- a/beacon_node/network/src/sync/network_context/custody_by_root.rs +++ b/beacon_node/network/src/sync/network_context/custody_by_root.rs @@ -15,7 +15,7 @@ use std::time::{Duration, Instant}; use std::{collections::HashMap, marker::PhantomData, sync::Arc}; use strum::IntoStaticStr; use tracing::{debug, warn}; -use types::{data_column_sidecar::ColumnIndex, DataColumnSidecar, Hash256}; +use types::{data_column_sidecar::ColumnIndex, DataColumnSidecar, DataColumnSidecarList, Hash256}; use super::{LookupRequestResult, PeerGroup, RpcResponseResult, SyncNetworkContext}; @@ -24,8 +24,6 @@ const REQUEST_EXPIRY_SECONDS: u64 = 300; /// TODO(das): this attempt count is nested into the existing lookup request count. const MAX_CUSTODY_COLUMN_DOWNLOAD_ATTEMPTS: usize = 3; -type DataColumnSidecarList = Vec>>; - pub struct ActiveCustodyByRootRequest { start_time: Instant, block_root: Hash256, diff --git a/beacon_node/network/src/sync/network_context/requests/data_columns_by_range.rs b/beacon_node/network/src/sync/network_context/requests/data_columns_by_range.rs index 276ede93c1..54ff0c1c73 100644 --- a/beacon_node/network/src/sync/network_context/requests/data_columns_by_range.rs +++ b/beacon_node/network/src/sync/network_context/requests/data_columns_by_range.rs @@ -1,13 +1,13 @@ use super::{ActiveRequestItems, LookupVerifyError}; use lighthouse_network::rpc::methods::DataColumnsByRangeRequest; use std::sync::Arc; -use types::{DataColumnSidecar, EthSpec, Slot}; +use types::{DataColumnSidecar, DataColumnSidecarList, EthSpec, Slot}; /// Accumulates results of a data_columns_by_range request. Only returns items after receiving the /// stream termination. pub struct DataColumnsByRangeRequestItems { request: DataColumnsByRangeRequest, - items: Vec>>, + items: DataColumnSidecarList, } impl DataColumnsByRangeRequestItems { diff --git a/beacon_node/network/src/sync/tests/lookups.rs b/beacon_node/network/src/sync/tests/lookups.rs index 3e83605a27..d85504d465 100644 --- a/beacon_node/network/src/sync/tests/lookups.rs +++ b/beacon_node/network/src/sync/tests/lookups.rs @@ -43,8 +43,8 @@ use tracing::info; use types::{ data_column_sidecar::ColumnIndex, test_utils::{SeedableRng, TestRandom, XorShiftRng}, - BeaconState, BeaconStateBase, BlobSidecar, DataColumnSidecar, EthSpec, ForkContext, ForkName, - Hash256, MinimalEthSpec as E, SignedBeaconBlock, Slot, + BeaconState, BeaconStateBase, BlobSidecar, DataColumnSidecar, DataColumnSidecarList, EthSpec, + ForkContext, ForkName, Hash256, MinimalEthSpec as E, SignedBeaconBlock, Slot, }; const D: Duration = Duration::new(0, 0); @@ -216,9 +216,7 @@ impl TestRig { generate_rand_block_and_blobs::(fork_name, num_blobs, rng, &self.spec) } - fn rand_block_and_data_columns( - &mut self, - ) -> (SignedBeaconBlock, Vec>>) { + fn rand_block_and_data_columns(&mut self) -> (SignedBeaconBlock, DataColumnSidecarList) { let num_blobs = NumBlobs::Number(1); generate_rand_block_and_data_columns::( self.fork_name, @@ -721,7 +719,7 @@ impl TestRig { fn complete_valid_sampling_column_requests( &mut self, ids: DCByRootIds, - data_columns: Vec>>, + data_columns: DataColumnSidecarList, ) { for id in ids { self.log(&format!("return valid data column for {id:?}")); @@ -766,7 +764,7 @@ impl TestRig { fn complete_valid_custody_request( &mut self, ids: DCByRootIds, - data_columns: Vec>>, + data_columns: DataColumnSidecarList, missing_components: bool, ) { let lookup_id = if let SyncRequestId::DataColumnsByRoot(DataColumnsByRootRequestId {