mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 22:38:34 +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:
@@ -954,6 +954,35 @@ where
|
||||
return;
|
||||
}
|
||||
}
|
||||
RequestType::PayloadEnvelopesByRange(request) => {
|
||||
let max_allowed = spec.max_request_payloads;
|
||||
if request.count > max_allowed {
|
||||
self.events_out.push(HandlerEvent::Err(HandlerErr::Inbound {
|
||||
id: self.current_inbound_substream_id,
|
||||
proto: Protocol::PayloadEnvelopesByRange,
|
||||
error: RPCError::InvalidData(format!(
|
||||
"requested exceeded limit. allowed: {}, requested: {}",
|
||||
max_allowed, request.count
|
||||
)),
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
RequestType::DataColumnsByRange(request) => {
|
||||
let max_requested = request.max_requested::<E>();
|
||||
let max_allowed = spec.max_request_data_column_sidecars;
|
||||
if max_requested > max_allowed {
|
||||
self.events_out.push(HandlerEvent::Err(HandlerErr::Inbound {
|
||||
id: self.current_inbound_substream_id,
|
||||
proto: Protocol::DataColumnsByRange,
|
||||
error: RPCError::InvalidData(format!(
|
||||
"requested exceeded limit. allowed: {}, requested: {}",
|
||||
max_allowed, max_requested
|
||||
)),
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user