make batch size check compile time panic

This commit is contained in:
realbigsean 2023-02-13 16:50:33 -05:00
parent 8f9c5cfca9
commit 4c3561dcaf
No known key found for this signature in database
GPG Key ID: BE1B3DB104F6C788

View File

@ -562,13 +562,12 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
/// blocks and blobs.
#[allow(unused)]
pub fn batch_type(&self, epoch: types::Epoch) -> ByRangeRequestType {
if super::backfill_sync::BACKFILL_EPOCHS_PER_BATCH * super::range_sync::EPOCHS_PER_BATCH
!= 1
{
panic!(
"To deal with alignment with 4844 boundaries, batches need to be of just one epoch"
);
}
const _: () = assert!(
super::backfill_sync::BACKFILL_EPOCHS_PER_BATCH == 1
&& super::range_sync::EPOCHS_PER_BATCH == 1,
"To deal with alignment with 4844 boundaries, batches need to be of just one epoch"
);
#[cfg(test)]
{
// Keep tests only for blocks.