diff --git a/eth2_libp2p b/eth2_libp2p index cd94317..1b3ffc3 160000 --- a/eth2_libp2p +++ b/eth2_libp2p @@ -1 +1 @@ -Subproject commit cd94317bcf623e7f501cfd5370423bd95fdaff65 +Subproject commit 1b3ffc3e83600da66b54167c37902ab10150c786 diff --git a/helper_functions/src/misc.rs b/helper_functions/src/misc.rs index a730d93..43b79a8 100644 --- a/helper_functions/src/misc.rs +++ b/helper_functions/src/misc.rs @@ -204,7 +204,7 @@ pub fn compute_subnet_for_attestation( /// [`compute_subnet_for_blob_sidecar`](https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/validator.md#sidecar) #[must_use] -pub const fn compute_subnet_for_blob_sidecar(config: &Config, blob_index: BlobIndex) -> SubnetId { +pub fn compute_subnet_for_blob_sidecar(config: &Config, blob_index: BlobIndex) -> SubnetId { blob_index % config.blob_sidecar_subnet_count } diff --git a/types/src/combined.rs b/types/src/combined.rs index 37e6881..e8dc200 100644 --- a/types/src/combined.rs +++ b/types/src/combined.rs @@ -1248,9 +1248,8 @@ impl SszWrite for LightClientUpdate

{ fn write_variable(&self, bytes: &mut Vec) -> Result<(), WriteError> { match self { Self::Altair(update) => { - let size = AltairLightClientUpdate::

::SIZE.get(); let length_before = bytes.len(); - let length_after = length_before + size; + let length_after = length_before + AltairLightClientUpdate::

::SIZE.get(); bytes.resize(length_after, 0); update.write_fixed(&mut bytes[length_before..]); diff --git a/types/src/config.rs b/types/src/config.rs index 383e882..4e094ab 100644 --- a/types/src/config.rs +++ b/types/src/config.rs @@ -136,7 +136,7 @@ pub struct Config { #[serde(with = "serde_utils::string_or_native")] pub min_epochs_for_blob_sidecars_requests: u64, #[serde(with = "serde_utils::string_or_native")] - pub blob_sidecar_subnet_count: u64, + pub blob_sidecar_subnet_count: NonZeroU64, #[serde(with = "serde_utils::string_or_native")] pub data_column_sidecar_subnet_count: u64, @@ -232,7 +232,7 @@ impl Default for Config { max_request_blocks_deneb: 128, max_request_blob_sidecars: 768, min_epochs_for_blob_sidecars_requests: 4096, - blob_sidecar_subnet_count: 6, + blob_sidecar_subnet_count: nonzero!(6_u64), data_column_sidecar_subnet_count: 64, // Transition