mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
clean up
This commit is contained in:
@@ -543,7 +543,6 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
match self.chain.get_data_columns_checking_all_caches(
|
||||
data_column_ids_by_root.block_root,
|
||||
&indices_to_retrieve,
|
||||
request.fork_name,
|
||||
) {
|
||||
Ok(data_columns) => {
|
||||
send_data_column_count += data_columns.len();
|
||||
|
||||
@@ -172,7 +172,7 @@ impl<T: BeaconChainTypes> RequestState<T> for CustodyRequestState<T::EthSpec> {
|
||||
_: usize,
|
||||
cx: &mut SyncNetworkContext<T>,
|
||||
) -> Result<LookupRequestResult, LookupRequestError> {
|
||||
cx.custody_lookup_request(id, self.slot, self.block_root, lookup_peers)
|
||||
cx.custody_lookup_request(id, self.block_root, lookup_peers)
|
||||
.map_err(LookupRequestError::SendFailedNetwork)
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ impl<T: BeaconChainTypes> SingleBlockLookup<T> {
|
||||
);
|
||||
} else if cx.chain.should_fetch_custody_columns(block_epoch) {
|
||||
self.component_requests = ComponentRequests::ActiveCustodyRequest(
|
||||
CustodyRequestState::new(block.slot(), self.block_root),
|
||||
CustodyRequestState::new(self.block_root),
|
||||
);
|
||||
} else {
|
||||
self.component_requests = ComponentRequests::NotNeeded("outside da window");
|
||||
@@ -399,15 +399,13 @@ impl<E: EthSpec> BlobRequestState<E> {
|
||||
pub struct CustodyRequestState<E: EthSpec> {
|
||||
#[educe(Debug(ignore))]
|
||||
pub block_root: Hash256,
|
||||
pub slot: Slot,
|
||||
pub state: SingleLookupRequestState<DataColumnSidecarList<E>>,
|
||||
}
|
||||
|
||||
impl<E: EthSpec> CustodyRequestState<E> {
|
||||
pub fn new(slot: Slot, block_root: Hash256) -> Self {
|
||||
pub fn new(block_root: Hash256) -> Self {
|
||||
Self {
|
||||
block_root,
|
||||
slot,
|
||||
state: SingleLookupRequestState::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
|
||||
pub fn custody_lookup_request(
|
||||
&mut self,
|
||||
lookup_id: SingleLookupId,
|
||||
_slot: Slot,
|
||||
block_root: Hash256,
|
||||
lookup_peers: Arc<RwLock<HashSet<PeerId>>>,
|
||||
) -> Result<LookupRequestResult, RpcRequestSendError> {
|
||||
@@ -1090,6 +1089,11 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.cached_data_column_indexes(&block_root)
|
||||
.or_else(|| {
|
||||
self.chain
|
||||
.pending_payload_cache
|
||||
.cached_data_column_indexes(&block_root)
|
||||
})
|
||||
.unwrap_or_default();
|
||||
|
||||
let current_epoch = self.chain.epoch().map_err(|e| {
|
||||
|
||||
@@ -26,7 +26,6 @@ impl DataColumnsByRootSingleBlockRequest {
|
||||
block_root: self.block_root,
|
||||
columns,
|
||||
}],
|
||||
fork_name,
|
||||
spec.max_request_blocks(fork_name),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user