mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 18:21:45 +00:00
don't expect context bytes for blob messages
This commit is contained in:
@@ -570,38 +570,42 @@ fn handle_v1_response<T: EthSpec>(
|
||||
SignedBeaconBlock::Base(SignedBeaconBlockBase::from_ssz_bytes(decoded_buffer)?),
|
||||
)))),
|
||||
Protocol::BlobsByRange => {
|
||||
let fork_name = fork_name.take().ok_or_else(|| {
|
||||
RPCError::ErrorResponse(
|
||||
RPCResponseErrorCode::InvalidRequest,
|
||||
format!("No context bytes provided for {} response", protocol),
|
||||
)
|
||||
})?;
|
||||
match fork_name {
|
||||
ForkName::Eip4844 => Ok(Some(RPCResponse::BlobsByRange(Arc::new(
|
||||
BlobsSidecar::from_ssz_bytes(decoded_buffer)?,
|
||||
)))),
|
||||
_ => Err(RPCError::ErrorResponse(
|
||||
RPCResponseErrorCode::InvalidRequest,
|
||||
"Invalid forkname for blobsbyrange".to_string(),
|
||||
)),
|
||||
}
|
||||
Ok(Some(RPCResponse::BlobsByRange(Arc::new(
|
||||
BlobsSidecar::from_ssz_bytes(decoded_buffer)?,
|
||||
))))
|
||||
//FIXME(sean) do we need context bytes?
|
||||
// let fork_name = fork_name.take().ok_or_else(|| {
|
||||
// RPCError::ErrorResponse(
|
||||
// RPCResponseErrorCode::InvalidRequest,
|
||||
// format!("No context bytes provided for {} response", protocol),
|
||||
// )
|
||||
// })?;
|
||||
// match fork_name {
|
||||
// ForkName::Eip4844 => ,
|
||||
// _ => Err(RPCError::ErrorResponse(
|
||||
// RPCResponseErrorCode::InvalidRequest,
|
||||
// "Invalid forkname for blobsbyrange".to_string(),
|
||||
// )),
|
||||
// }
|
||||
}
|
||||
Protocol::BlobsByRoot => {
|
||||
let fork_name = fork_name.take().ok_or_else(|| {
|
||||
RPCError::ErrorResponse(
|
||||
RPCResponseErrorCode::InvalidRequest,
|
||||
format!("No context bytes provided for {} response", protocol),
|
||||
)
|
||||
})?;
|
||||
match fork_name {
|
||||
ForkName::Eip4844 => Ok(Some(RPCResponse::BlobsByRoot(Arc::new(
|
||||
SignedBeaconBlockAndBlobsSidecar::from_ssz_bytes(decoded_buffer)?,
|
||||
)))),
|
||||
_ => Err(RPCError::ErrorResponse(
|
||||
RPCResponseErrorCode::InvalidRequest,
|
||||
"Invalid forkname for blobsbyroot".to_string(),
|
||||
)),
|
||||
}
|
||||
Ok(Some(RPCResponse::BlobsByRoot(Arc::new(
|
||||
SignedBeaconBlockAndBlobsSidecar::from_ssz_bytes(decoded_buffer)?,
|
||||
))))
|
||||
//FIXME(sean) do we need context bytes?
|
||||
// let fork_name = fork_name.take().ok_or_else(|| {
|
||||
// RPCError::ErrorResponse(
|
||||
// RPCResponseErrorCode::InvalidRequest,
|
||||
// format!("No context bytes provided for {} response", protocol),
|
||||
// )
|
||||
// })?;
|
||||
// match fork_name {
|
||||
// ForkName::Eip4844 =>
|
||||
// _ => Err(RPCError::ErrorResponse(
|
||||
// RPCResponseErrorCode::InvalidRequest,
|
||||
// "Invalid forkname for blobsbyroot".to_string(),
|
||||
// )),
|
||||
// }
|
||||
}
|
||||
Protocol::Ping => Ok(Some(RPCResponse::Pong(Ping {
|
||||
data: u64::from_ssz_bytes(decoded_buffer)?,
|
||||
|
||||
Reference in New Issue
Block a user