handle blobs by range requests
This commit is contained in:
parent
422d145902
commit
fc9d0a512d
@ -480,10 +480,10 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
/// Handle a `BlobsByRange` request from the peer.
|
/// Handle a `BlobsByRange` request from the peer.
|
||||||
pub fn handle_blobs_by_range_request(
|
pub fn handle_blobs_by_range_request(
|
||||||
self,
|
self,
|
||||||
_executor: TaskExecutor,
|
executor: TaskExecutor,
|
||||||
_send_on_drop: SendOnDrop,
|
send_on_drop: SendOnDrop,
|
||||||
peer_id: PeerId,
|
peer_id: PeerId,
|
||||||
_request_id: PeerRequestId,
|
request_id: PeerRequestId,
|
||||||
mut req: BlobsByRangeRequest,
|
mut req: BlobsByRangeRequest,
|
||||||
) {
|
) {
|
||||||
debug!(self.log, "Received BlobsByRange Request";
|
debug!(self.log, "Received BlobsByRange Request";
|
||||||
@ -497,10 +497,7 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
req.count = MAX_REQUEST_BLOBS_SIDECARS;
|
req.count = MAX_REQUEST_BLOBS_SIDECARS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME(sean) create the blobs iter
|
let forwards_block_root_iter = match self
|
||||||
|
|
||||||
/*
|
|
||||||
let forwards_blob_root_iter = match self
|
|
||||||
.chain
|
.chain
|
||||||
.forwards_iter_block_roots(Slot::from(req.start_slot))
|
.forwards_iter_block_roots(Slot::from(req.start_slot))
|
||||||
{
|
{
|
||||||
@ -512,13 +509,12 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
},
|
},
|
||||||
)) => {
|
)) => {
|
||||||
debug!(self.log, "Range request failed during backfill"; "requested_slot" => slot, "oldest_known_slot" => oldest_block_slot);
|
debug!(self.log, "Range request failed during backfill"; "requested_slot" => slot, "oldest_known_slot" => oldest_block_slot);
|
||||||
// return self.send_error_response(
|
return self.send_error_response(
|
||||||
// peer_id,
|
peer_id,
|
||||||
// RPCResponseErrorCode::ResourceUnavailable,
|
RPCResponseErrorCode::ResourceUnavailable,
|
||||||
// "Backfilling".into(),
|
"Backfilling".into(),
|
||||||
// request_id,
|
request_id,
|
||||||
// );
|
);
|
||||||
todo!("stuff")
|
|
||||||
}
|
}
|
||||||
Err(e) => return error!(self.log, "Unable to obtain root iter"; "error" => ?e),
|
Err(e) => return error!(self.log, "Unable to obtain root iter"; "error" => ?e),
|
||||||
};
|
};
|
||||||
@ -548,18 +544,13 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
// remove all skip slots
|
// remove all skip slots
|
||||||
let block_roots = block_roots.into_iter().flatten().collect::<Vec<_>>();
|
let block_roots = block_roots.into_iter().flatten().collect::<Vec<_>>();
|
||||||
|
|
||||||
*/
|
let mut blobs_sent = 0;
|
||||||
// Fetching blocks is async because it may have to hit the execution layer for payloads.
|
|
||||||
/*
|
|
||||||
executor.spawn(
|
|
||||||
async move {
|
|
||||||
let mut blocks_sent = 0;
|
|
||||||
let mut send_response = true;
|
let mut send_response = true;
|
||||||
|
|
||||||
for root in block_roots {
|
for root in block_roots {
|
||||||
match self.chain.store.get_blobs(&root) {
|
match self.chain.store.get_blobs(&root) {
|
||||||
Ok(Some(blob)) => {
|
Ok(Some(blob)) => {
|
||||||
blocks_sent += 1;
|
blobs_sent += 1;
|
||||||
self.send_network_message(NetworkMessage::SendResponse {
|
self.send_network_message(NetworkMessage::SendResponse {
|
||||||
peer_id,
|
peer_id,
|
||||||
response: Response::BlobsByRange(Some(Arc::new(blob))),
|
response: Response::BlobsByRange(Some(Arc::new(blob))),
|
||||||
@ -624,10 +615,5 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drop(send_on_drop);
|
drop(send_on_drop);
|
||||||
},
|
|
||||||
"load_blocks_by_range_blocks",
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
unimplemented!("")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user