mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
cleanup
This commit is contained in:
@@ -188,8 +188,9 @@ fn build_data_column_sidecars<E: EthSpec>(
|
||||
spec: &ChainSpec,
|
||||
) -> Result<DataColumnSidecarList<E>, String> {
|
||||
let number_of_columns = spec.number_of_columns;
|
||||
let max_blobs_per_block =
|
||||
spec.max_blobs_per_block(signed_block_header.message.slot.epoch(E::slots_per_epoch())) as usize;
|
||||
let max_blobs_per_block = spec
|
||||
.max_blobs_per_block(signed_block_header.message.slot.epoch(E::slots_per_epoch()))
|
||||
as usize;
|
||||
let mut columns = vec![Vec::with_capacity(max_blobs_per_block); number_of_columns];
|
||||
let mut column_kzg_proofs = vec![Vec::with_capacity(max_blobs_per_block); number_of_columns];
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ pub const MAX_ERROR_LEN: u64 = 256;
|
||||
/// The max number of blobs we expect in the configs to set for compile time params.
|
||||
/// Note: This value is an estimate that we should use only for rate limiting,
|
||||
/// bounds checking and other non-consensus critical operations.
|
||||
///
|
||||
///
|
||||
/// For exact value, we should always check the chainspec.
|
||||
pub const MAX_BLOBS_PER_BLOCK_CEILING: u64 = 16;
|
||||
|
||||
@@ -335,11 +335,11 @@ pub struct BlobsByRangeRequest {
|
||||
impl BlobsByRangeRequest {
|
||||
/// This function provides an upper bound on number of blobs expected in
|
||||
/// a certain slot range.
|
||||
///
|
||||
///
|
||||
/// Note: **must not** use for anything consensus critical, only for
|
||||
/// bounds checking and rate limiting.
|
||||
/// bounds checking and rate limiting.
|
||||
pub fn max_blobs_requested<E: EthSpec>(&self) -> u64 {
|
||||
self.count.saturating_mul(MAX_BLOBS_PER_BLOCK_CEILING as u64)
|
||||
self.count.saturating_mul(MAX_BLOBS_PER_BLOCK_CEILING)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ use std::time::Duration;
|
||||
use tokio::sync::mpsc;
|
||||
use types::blob_sidecar::FixedBlobSidecarList;
|
||||
use types::{
|
||||
BlobSidecar, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, EthSpec,
|
||||
Hash256, SignedBeaconBlock, Slot,
|
||||
BlobSidecar, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, EthSpec, Hash256,
|
||||
SignedBeaconBlock, Slot,
|
||||
};
|
||||
|
||||
pub mod custody;
|
||||
|
||||
Reference in New Issue
Block a user