mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 10:52:43 +00:00
Implement data columns by network boilerplate (#6224)
* Implement data columns by network boilerplate * Use correct quota values * Address PR review * Update currently_supported * Merge remote-tracking branch 'sigp/unstable' into peerdas-network-boilerplate * PR reviews * Fix data column rpc request not being sent due to incorrect limits set. (#6000)
This commit is contained in:
@@ -101,6 +101,14 @@ pub enum SyncMessage<E: EthSpec> {
|
||||
seen_timestamp: Duration,
|
||||
},
|
||||
|
||||
/// A data columns has been received from the RPC
|
||||
RpcDataColumn {
|
||||
request_id: SyncRequestId,
|
||||
peer_id: PeerId,
|
||||
data_column: Option<Arc<DataColumnSidecar<E>>>,
|
||||
seen_timestamp: Duration,
|
||||
},
|
||||
|
||||
/// A block with an unknown parent has been received.
|
||||
UnknownParentBlock(PeerId, RpcBlock<E>, Hash256),
|
||||
|
||||
@@ -337,6 +345,9 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
SyncRequestId::SingleBlob { id } => {
|
||||
self.on_single_blob_response(id, peer_id, RpcEvent::RPCError(error))
|
||||
}
|
||||
SyncRequestId::DataColumnsByRoot { .. } => {
|
||||
// TODO(das)
|
||||
}
|
||||
SyncRequestId::RangeBlockAndBlobs { id } => {
|
||||
if let Some(sender_id) = self.network.range_request_failed(id) {
|
||||
match sender_id {
|
||||
@@ -614,6 +625,12 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
blob_sidecar,
|
||||
seen_timestamp,
|
||||
} => self.rpc_blob_received(request_id, peer_id, blob_sidecar, seen_timestamp),
|
||||
SyncMessage::RpcDataColumn {
|
||||
request_id,
|
||||
peer_id,
|
||||
data_column,
|
||||
seen_timestamp,
|
||||
} => self.rpc_data_column_received(request_id, peer_id, data_column, seen_timestamp),
|
||||
SyncMessage::UnknownParentBlock(peer_id, block, block_root) => {
|
||||
let block_slot = block.slot();
|
||||
let parent_root = block.parent_root();
|
||||
@@ -846,6 +863,9 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
SyncRequestId::SingleBlob { .. } => {
|
||||
crit!(self.log, "Block received during blob request"; "peer_id" => %peer_id );
|
||||
}
|
||||
SyncRequestId::DataColumnsByRoot { .. } => {
|
||||
// TODO(das)
|
||||
}
|
||||
SyncRequestId::RangeBlockAndBlobs { id } => {
|
||||
self.range_block_and_blobs_response(id, peer_id, block.into())
|
||||
}
|
||||
@@ -888,12 +908,25 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
None => RpcEvent::StreamTermination,
|
||||
},
|
||||
),
|
||||
SyncRequestId::DataColumnsByRoot { .. } => {
|
||||
// TODO(das)
|
||||
}
|
||||
SyncRequestId::RangeBlockAndBlobs { id } => {
|
||||
self.range_block_and_blobs_response(id, peer_id, blob.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn rpc_data_column_received(
|
||||
&mut self,
|
||||
_request_id: SyncRequestId,
|
||||
_peer_id: PeerId,
|
||||
_data_column: Option<Arc<DataColumnSidecar<T::EthSpec>>>,
|
||||
_seen_timestamp: Duration,
|
||||
) {
|
||||
// TODO(das): implement handler
|
||||
}
|
||||
|
||||
fn on_single_blob_response(
|
||||
&mut self,
|
||||
id: SingleLookupReqId,
|
||||
|
||||
Reference in New Issue
Block a user