Fix BlocksByRootRequest min/max bounds calculation (#1312)
This commit is contained in:
parent
2ccb9f48da
commit
d4dd9fae07
@ -188,7 +188,7 @@ pub struct BlocksByRangeRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Request a number of beacon block bodies from a peer.
|
/// Request a number of beacon block bodies from a peer.
|
||||||
#[derive(Encode, Decode, Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub struct BlocksByRootRequest {
|
pub struct BlocksByRootRequest {
|
||||||
/// The list of beacon block bodies being requested.
|
/// The list of beacon block bodies being requested.
|
||||||
pub block_roots: VariableList<Hash256, MaxRequestBlocks>,
|
pub block_roots: VariableList<Hash256, MaxRequestBlocks>,
|
||||||
|
@ -43,18 +43,16 @@ lazy_static! {
|
|||||||
}
|
}
|
||||||
.as_ssz_bytes()
|
.as_ssz_bytes()
|
||||||
.len();
|
.len();
|
||||||
pub static ref BLOCKS_BY_ROOT_REQUEST_MIN: usize = BlocksByRootRequest {
|
pub static ref BLOCKS_BY_ROOT_REQUEST_MIN: usize =
|
||||||
block_roots: VariableList::<Hash256, MaxRequestBlocks>::from(Vec::<Hash256>::new())
|
VariableList::<Hash256, MaxRequestBlocks>::from(Vec::<Hash256>::new())
|
||||||
}
|
|
||||||
.as_ssz_bytes()
|
.as_ssz_bytes()
|
||||||
.len();
|
.len();
|
||||||
pub static ref BLOCKS_BY_ROOT_REQUEST_MAX: usize = BlocksByRootRequest {
|
pub static ref BLOCKS_BY_ROOT_REQUEST_MAX: usize =
|
||||||
block_roots: VariableList::<Hash256, MaxRequestBlocks>::from(vec![
|
VariableList::<Hash256, MaxRequestBlocks>::from(vec![
|
||||||
Hash256::zero();
|
Hash256::zero();
|
||||||
MAX_REQUEST_BLOCKS
|
MAX_REQUEST_BLOCKS
|
||||||
as usize
|
as usize
|
||||||
])
|
])
|
||||||
}
|
|
||||||
.as_ssz_bytes()
|
.as_ssz_bytes()
|
||||||
.len();
|
.len();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user