Skip to content

Commit

Permalink
Revert a few more regressions and add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Jan 13, 2025
1 parent 3b17732 commit e2ff440
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions beacon_node/lighthouse_network/src/rpc/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ pub static SIGNED_BEACON_BLOCK_DENEB_MAX: LazyLock<usize> = LazyLock::new(|| {
*SIGNED_BEACON_BLOCK_CAPELLA_MAX_WITHOUT_PAYLOAD
+ types::ExecutionPayload::<MainnetEthSpec>::max_execution_payload_deneb_size() // adding max size of execution payload (~16gb)
+ ssz::BYTES_PER_LENGTH_OFFSET // Adding the additional offsets for the `ExecutionPayload`
+ (<types::KzgCommitment as Encode>::ssz_fixed_len() * MainnetEthSpec::default_spec().max_blobs_per_block_by_fork(ForkName::Deneb) as usize)
+ ssz::BYTES_PER_LENGTH_OFFSET
}); // Length offset for the blob commitments field.
//
pub static SIGNED_BEACON_BLOCK_ELECTRA_MAX: LazyLock<usize> = LazyLock::new(|| {
*SIGNED_BEACON_BLOCK_ELECTRA_MAX_WITHOUT_PAYLOAD
+ types::ExecutionPayload::<MainnetEthSpec>::max_execution_payload_electra_size() // adding max size of execution payload (~16gb)
+ ssz::BYTES_PER_LENGTH_OFFSET // Adding the additional ssz offset for the `ExecutionPayload` field
+ (<types::KzgCommitment as Encode>::ssz_fixed_len() * MainnetEthSpec::default_spec().max_blobs_per_block_by_fork(ForkName::Electra) as usize)
+ ssz::BYTES_PER_LENGTH_OFFSET
}); // Length offset for the blob commitments field.

Expand Down Expand Up @@ -712,6 +710,7 @@ pub fn rpc_blob_limits<E: EthSpec>() -> RpcLimits {
}
}

// TODO(peerdas): fix hardcoded max here
pub fn rpc_data_column_limits<E: EthSpec>(fork_name: ForkName) -> RpcLimits {
RpcLimits::new(
DataColumnSidecar::<E>::empty().as_ssz_bytes().len(),
Expand Down
1 change: 1 addition & 0 deletions beacon_node/store/src/impls/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use types::{
EthSpec, ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella,
ExecutionPayloadDeneb, ExecutionPayloadElectra, ExecutionPayloadFulu,
};

macro_rules! impl_store_item {
($ty_name:ident) => {
impl<E: EthSpec> StoreItem for $ty_name<E> {
Expand Down
5 changes: 5 additions & 0 deletions consensus/types/src/beacon_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,11 @@ impl<E: EthSpec> BeaconState<E> {
}
}

/// Fork-aware abstraction for the shuffling.
///
/// In Electra and later, the random value is a 16-bit integer stored in a `u64`.
///
/// Prior to Electra, the random value is an 8-bit integer stored in a `u64`.
fn shuffling_random_value(&self, i: usize, seed: &[u8]) -> Result<u64, Error> {
if self.fork_name_unchecked().electra_enabled() {
Self::shuffling_random_u16_electra(i, seed).map(u64::from)
Expand Down
4 changes: 0 additions & 4 deletions consensus/types/src/runtime_var_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ use std::slice::SliceIndex;
/// // Push a value to if it _does_ exceed the maximum.
/// assert!(long.push(6).is_err());
///
///
/// uninit.push(5).unwrap();
/// assert_eq!(&uninit[..], &[5]);
///
/// ```
#[derive(Debug, Clone, Serialize, Deserialize, Derivative)]
#[derivative(PartialEq, Eq, Hash(bound = "T: std::hash::Hash"))]
Expand Down

0 comments on commit e2ff440

Please sign in to comment.