make batch size check compile time panic
This commit is contained in:
parent
8f9c5cfca9
commit
4c3561dcaf
@ -562,13 +562,12 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
|
|||||||
/// blocks and blobs.
|
/// blocks and blobs.
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn batch_type(&self, epoch: types::Epoch) -> ByRangeRequestType {
|
pub fn batch_type(&self, epoch: types::Epoch) -> ByRangeRequestType {
|
||||||
if super::backfill_sync::BACKFILL_EPOCHS_PER_BATCH * super::range_sync::EPOCHS_PER_BATCH
|
const _: () = assert!(
|
||||||
!= 1
|
super::backfill_sync::BACKFILL_EPOCHS_PER_BATCH == 1
|
||||||
{
|
&& super::range_sync::EPOCHS_PER_BATCH == 1,
|
||||||
panic!(
|
"To deal with alignment with 4844 boundaries, batches need to be of just one epoch"
|
||||||
"To deal with alignment with 4844 boundaries, batches need to be of just one epoch"
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
{
|
{
|
||||||
// Keep tests only for blocks.
|
// Keep tests only for blocks.
|
||||||
|
Loading…
Reference in New Issue
Block a user