Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update max blobs per block #4391

Merged
merged 3 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Change max blobs to 6 in code
  • Loading branch information
pawanjay176 committed Jun 12, 2023
commit cbc3c7a81477610499b8b75b0de3443aa09de15b
8 changes: 4 additions & 4 deletions beacon_node/lighthouse_network/src/rpc/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use regex::bytes::Regex;
use serde::Serialize;
use ssz_derive::{Decode, Encode};
use ssz_types::{
typenum::{U1024, U256, U512},
typenum::{U1024, U256, U768},
VariableList,
};
use std::ops::Deref;
Expand All @@ -31,9 +31,9 @@ pub const MAX_REQUEST_BLOCKS_DENEB: u64 = 128;
// TODO: this is calculated as MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK and
// MAX_BLOBS_PER_BLOCK comes from the spec.
// MAX_REQUEST_BLOCKS_DENEB = 128
// MAX_BLOBS_PER_BLOCK = 4
pub type MaxRequestBlobSidecars = U512;
pub const MAX_REQUEST_BLOB_SIDECARS: u64 = 512;
// MAX_BLOBS_PER_BLOCK = 6
pub type MaxRequestBlobSidecars = U768;
pub const MAX_REQUEST_BLOB_SIDECARS: u64 = 768;

/// Wrapper over SSZ List to represent error message in rpc responses.
#[derive(Debug, Clone)]
Expand Down
6 changes: 4 additions & 2 deletions beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use std::{
use types::ForkName;
use types::{
consts::altair::SYNC_COMMITTEE_SUBNET_COUNT, EnrForkId, EthSpec, ForkContext, Slot, SubnetId,
consts::deneb::MAX_BLOBS_PER_BLOCK,
};
use utils::{build_transport, strip_peer_id, Context as ServiceContext, MAX_CONNECTIONS_PER_PEER};

Expand Down Expand Up @@ -236,10 +237,11 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
possible_fork_digests,
ctx.chain_spec.attestation_subnet_count,
SYNC_COMMITTEE_SUBNET_COUNT,
4, // TODO(pawan): get this from chainspec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

MAX_BLOBS_PER_BLOCK,
),
max_subscribed_topics: 200,
max_subscriptions_per_request: 150, // 148 in theory = (64 attestation + 4 sync committee + 6 core topics) * 2
// 162 in theory = (64 attestation + 4 sync committee + 7 core topics + 6 blob topics) * 2
max_subscriptions_per_request: 160,
};

config.gs_config = gossipsub_config(config.network_load, ctx.fork_context.clone());
Expand Down
1 change: 1 addition & 0 deletions consensus/types/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ pub mod deneb {
}
pub const BLOB_TX_TYPE: u8 = 3;
pub const VERSIONED_HASH_VERSION_KZG: u8 = 1;
pub const MAX_BLOBS_PER_BLOCK: u64 = 6;
}
6 changes: 3 additions & 3 deletions consensus/types/src/eth_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use safe_arith::SafeArith;
use serde_derive::{Deserialize, Serialize};
use ssz_types::typenum::{
bit::B0, UInt, Unsigned, U0, U1024, U1048576, U1073741824, U1099511627776, U128, U131072, U16,
U16777216, U2, U2048, U256, U32, U4, U4096, U512, U625, U64, U65536, U8, U8192,
U16777216, U2, U2048, U256, U32, U4, U4096, U512, U6, U625, U64, U65536, U8, U8192,
};
use std::fmt::{self, Debug};
use std::str::FromStr;
Expand Down Expand Up @@ -294,7 +294,7 @@ impl EthSpec for MainnetEthSpec {
type GasLimitDenominator = U1024;
type MinGasLimit = U5000;
type MaxExtraDataBytes = U32;
type MaxBlobsPerBlock = U4;
type MaxBlobsPerBlock = U6;
type BytesPerFieldElement = U32;
type FieldElementsPerBlob = U4096;
type BytesPerBlob = U131072;
Expand Down Expand Up @@ -398,7 +398,7 @@ impl EthSpec for GnosisEthSpec {
type SlotsPerEth1VotingPeriod = U1024; // 64 epochs * 16 slots per epoch
type MaxBlsToExecutionChanges = U16;
type MaxWithdrawalsPerPayload = U8;
type MaxBlobsPerBlock = U4;
type MaxBlobsPerBlock = U6;
type FieldElementsPerBlob = U4096;
type BytesPerFieldElement = U32;
type BytesPerBlob = U131072;
Expand Down