parent
c2f2813385
commit
ab86b42874
@ -391,7 +391,6 @@ fn context_bytes<T: EthSpec>(
|
|||||||
// NOTE: If you are adding another fork type here, be sure to modify the
|
// NOTE: If you are adding another fork type here, be sure to modify the
|
||||||
// `fork_context.to_context_bytes()` function to support it as well!
|
// `fork_context.to_context_bytes()` function to support it as well!
|
||||||
SignedBeaconBlock::Merge { .. } => {
|
SignedBeaconBlock::Merge { .. } => {
|
||||||
// TODO: check this
|
|
||||||
// Merge context being `None` implies that "merge never happened".
|
// Merge context being `None` implies that "merge never happened".
|
||||||
fork_context.to_context_bytes(ForkName::Merge)
|
fork_context.to_context_bytes(ForkName::Merge)
|
||||||
}
|
}
|
||||||
@ -561,7 +560,6 @@ fn handle_v2_response<T: EthSpec>(
|
|||||||
ForkName::Base => Ok(Some(RPCResponse::BlocksByRange(Box::new(
|
ForkName::Base => Ok(Some(RPCResponse::BlocksByRange(Box::new(
|
||||||
SignedBeaconBlock::Base(SignedBeaconBlockBase::from_ssz_bytes(decoded_buffer)?),
|
SignedBeaconBlock::Base(SignedBeaconBlockBase::from_ssz_bytes(decoded_buffer)?),
|
||||||
)))),
|
)))),
|
||||||
// TODO: check this (though it seems okay)
|
|
||||||
ForkName::Merge => Ok(Some(RPCResponse::BlocksByRange(Box::new(
|
ForkName::Merge => Ok(Some(RPCResponse::BlocksByRange(Box::new(
|
||||||
SignedBeaconBlock::Merge(SignedBeaconBlockMerge::from_ssz_bytes(
|
SignedBeaconBlock::Merge(SignedBeaconBlockMerge::from_ssz_bytes(
|
||||||
decoded_buffer,
|
decoded_buffer,
|
||||||
@ -577,7 +575,6 @@ fn handle_v2_response<T: EthSpec>(
|
|||||||
ForkName::Base => Ok(Some(RPCResponse::BlocksByRoot(Box::new(
|
ForkName::Base => Ok(Some(RPCResponse::BlocksByRoot(Box::new(
|
||||||
SignedBeaconBlock::Base(SignedBeaconBlockBase::from_ssz_bytes(decoded_buffer)?),
|
SignedBeaconBlock::Base(SignedBeaconBlockBase::from_ssz_bytes(decoded_buffer)?),
|
||||||
)))),
|
)))),
|
||||||
// TODO: check this (though it seems right)
|
|
||||||
ForkName::Merge => Ok(Some(RPCResponse::BlocksByRoot(Box::new(
|
ForkName::Merge => Ok(Some(RPCResponse::BlocksByRoot(Box::new(
|
||||||
SignedBeaconBlock::Merge(SignedBeaconBlockMerge::from_ssz_bytes(
|
SignedBeaconBlock::Merge(SignedBeaconBlockMerge::from_ssz_bytes(
|
||||||
decoded_buffer,
|
decoded_buffer,
|
||||||
|
@ -206,7 +206,7 @@ impl RpcLimits {
|
|||||||
Self { min, max }
|
Self { min, max }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the given length is is greater than `MAX_RPC_SIZE` or out of
|
/// Returns true if the given length is greater than `MAX_RPC_SIZE` or out of
|
||||||
/// bounds for the given ssz type, returns false otherwise.
|
/// bounds for the given ssz type, returns false otherwise.
|
||||||
pub fn is_out_of_bounds(&self, length: usize, max_rpc_size: usize) -> bool {
|
pub fn is_out_of_bounds(&self, length: usize, max_rpc_size: usize) -> bool {
|
||||||
length > std::cmp::min(self.max, max_rpc_size) || length < self.min
|
length > std::cmp::min(self.max, max_rpc_size) || length < self.min
|
||||||
|
Loading…
Reference in New Issue
Block a user