mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 03:03:45 +00:00
Gloas serve envelope rpc (#8896)
Serves envelope by range and by root requests. Added PayloadEnvelopeStreamer so that we dont need to alter upstream code when we introduce blinded payload envelopes. Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
@@ -1524,6 +1524,28 @@ impl<E: EthSpec> Network<E> {
|
||||
request_type,
|
||||
})
|
||||
}
|
||||
RequestType::PayloadEnvelopesByRange(_) => {
|
||||
metrics::inc_counter_vec(
|
||||
&metrics::TOTAL_RPC_REQUESTS,
|
||||
&["payload_envelopes_by_range"],
|
||||
);
|
||||
Some(NetworkEvent::RequestReceived {
|
||||
peer_id,
|
||||
inbound_request_id,
|
||||
request_type,
|
||||
})
|
||||
}
|
||||
RequestType::PayloadEnvelopesByRoot(_) => {
|
||||
metrics::inc_counter_vec(
|
||||
&metrics::TOTAL_RPC_REQUESTS,
|
||||
&["payload_envelopes_by_root"],
|
||||
);
|
||||
Some(NetworkEvent::RequestReceived {
|
||||
peer_id,
|
||||
inbound_request_id,
|
||||
request_type,
|
||||
})
|
||||
}
|
||||
RequestType::BlobsByRange(_) => {
|
||||
metrics::inc_counter_vec(&metrics::TOTAL_RPC_REQUESTS, &["blobs_by_range"]);
|
||||
Some(NetworkEvent::RequestReceived {
|
||||
@@ -1638,6 +1660,16 @@ impl<E: EthSpec> Network<E> {
|
||||
RpcSuccessResponse::BlocksByRoot(resp) => {
|
||||
self.build_response(id, peer_id, Response::BlocksByRoot(Some(resp)))
|
||||
}
|
||||
RpcSuccessResponse::PayloadEnvelopesByRange(resp) => self.build_response(
|
||||
id,
|
||||
peer_id,
|
||||
Response::PayloadEnvelopesByRange(Some(resp)),
|
||||
),
|
||||
RpcSuccessResponse::PayloadEnvelopesByRoot(resp) => self.build_response(
|
||||
id,
|
||||
peer_id,
|
||||
Response::PayloadEnvelopesByRoot(Some(resp)),
|
||||
),
|
||||
RpcSuccessResponse::BlobsByRoot(resp) => {
|
||||
self.build_response(id, peer_id, Response::BlobsByRoot(Some(resp)))
|
||||
}
|
||||
@@ -1672,6 +1704,12 @@ impl<E: EthSpec> Network<E> {
|
||||
let response = match termination {
|
||||
ResponseTermination::BlocksByRange => Response::BlocksByRange(None),
|
||||
ResponseTermination::BlocksByRoot => Response::BlocksByRoot(None),
|
||||
ResponseTermination::PayloadEnvelopesByRange => {
|
||||
Response::PayloadEnvelopesByRange(None)
|
||||
}
|
||||
ResponseTermination::PayloadEnvelopesByRoot => {
|
||||
Response::PayloadEnvelopesByRoot(None)
|
||||
}
|
||||
ResponseTermination::BlobsByRange => Response::BlobsByRange(None),
|
||||
ResponseTermination::BlobsByRoot => Response::BlobsByRoot(None),
|
||||
ResponseTermination::DataColumnsByRoot => Response::DataColumnsByRoot(None),
|
||||
|
||||
Reference in New Issue
Block a user