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

feat: make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable #7294

Merged
merged 5 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 8 additions & 8 deletions packages/beacon-node/src/network/core/networkCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export class NetworkCore implements INetworkCore {
}

for (const fork of getActiveForks(this.config, this.clock.currentEpoch)) {
this.subscribeCoreTopicsAtFork(fork);
this.subscribeCoreTopicsAtFork(this.config, fork);
}
}

Expand All @@ -325,7 +325,7 @@ export class NetworkCore implements INetworkCore {
*/
async unsubscribeGossipCoreTopics(): Promise<void> {
for (const fork of this.subscribedForks.values()) {
this.unsubscribeCoreTopicsAtFork(fork);
this.unsubscribeCoreTopicsAtFork(this.config, fork);
}
}

Expand Down Expand Up @@ -456,7 +456,7 @@ export class NetworkCore implements INetworkCore {
if (epoch === forkEpoch - FORK_EPOCH_LOOKAHEAD) {
// Don't subscribe to new fork if the node is not subscribed to any topic
if (await this.isSubscribedToGossipCoreTopics()) {
this.subscribeCoreTopicsAtFork(nextFork);
this.subscribeCoreTopicsAtFork(this.config, nextFork);
this.logger.info("Subscribing gossip topics before fork", {nextFork});
} else {
this.logger.info("Skipping subscribing gossip topics before fork", {nextFork});
Expand All @@ -475,7 +475,7 @@ export class NetworkCore implements INetworkCore {
// After fork transition
if (epoch === forkEpoch + FORK_EPOCH_LOOKAHEAD) {
this.logger.info("Unsubscribing gossip topics from prev fork", {prevFork});
this.unsubscribeCoreTopicsAtFork(prevFork);
this.unsubscribeCoreTopicsAtFork(this.config, prevFork);
this.attnetsService.unsubscribeSubnetsFromPrevFork(prevFork);
this.syncnetsService.unsubscribeSubnetsFromPrevFork(prevFork);
}
Expand All @@ -501,25 +501,25 @@ export class NetworkCore implements INetworkCore {
}
};

private subscribeCoreTopicsAtFork(fork: ForkName): void {
private subscribeCoreTopicsAtFork(config: BeaconConfig, fork: ForkName): void {
if (this.subscribedForks.has(fork)) return;
this.subscribedForks.add(fork);
const {subscribeAllSubnets, disableLightClientServer} = this.opts;

for (const topic of getCoreTopicsAtFork(fork, {
for (const topic of getCoreTopicsAtFork(config, fork, {
subscribeAllSubnets,
disableLightClientServer,
})) {
this.gossip.subscribeTopic({...topic, fork});
}
}

private unsubscribeCoreTopicsAtFork(fork: ForkName): void {
private unsubscribeCoreTopicsAtFork(config: BeaconConfig, fork: ForkName): void {
if (!this.subscribedForks.has(fork)) return;
this.subscribedForks.delete(fork);
const {subscribeAllSubnets, disableLightClientServer} = this.opts;

for (const topic of getCoreTopicsAtFork(fork, {
for (const topic of getCoreTopicsAtFork(config, fork, {
subscribeAllSubnets,
disableLightClientServer,
})) {
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/gossip/gossipsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function getMetricsTopicStrToLabel(config: BeaconConfig, opts: {disableLightClie
const metricsTopicStrToLabel = new Map<TopicStr, TopicLabel>();

for (const {name: fork} of config.forksAscendingEpochOrder) {
const topics = getCoreTopicsAtFork(fork, {
const topics = getCoreTopicsAtFork(config, fork, {
subscribeAllSubnets: true,
disableLightClientServer: opts.disableLightClientServer,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/beacon-node/src/network/gossip/topic.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {ForkDigestContext} from "@lodestar/config";
import {ChainConfig, ForkDigestContext} from "@lodestar/config";
import {
ATTESTATION_SUBNET_COUNT,
ForkName,
ForkSeq,
MAX_BLOBS_PER_BLOCK,
SYNC_COMMITTEE_SUBNET_COUNT,
isForkLightClient,
} from "@lodestar/params";
Expand Down Expand Up @@ -199,6 +198,7 @@ export function parseGossipTopic(forkDigestContext: ForkDigestContext, topicStr:
* De-duplicate logic to pick fork topics between subscribeCoreTopicsAtFork and unsubscribeCoreTopicsAtFork
*/
export function getCoreTopicsAtFork(
config: ChainConfig,
fork: ForkName,
opts: {subscribeAllSubnets?: boolean; disableLightClientServer?: boolean}
): GossipTopicTypeMap[keyof GossipTopicTypeMap][] {
Expand All @@ -213,7 +213,7 @@ export function getCoreTopicsAtFork(

// After Deneb also track blob_sidecar_{index}
if (ForkSeq[fork] >= ForkSeq.deneb) {
for (let index = 0; index < MAX_BLOBS_PER_BLOCK; index++) {
for (let index = 0; index < config.MAX_BLOBS_PER_BLOCK; index++) {
Copy link
Member

Choose a reason for hiding this comment

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

just a side note, we should use BLOB_SIDECAR_SUBNET_COUNT here instead, currently this does not matter as BLOB_SIDECAR_SUBNET_COUNT == MAX_BLOBS_PER_BLOCK but would be good to clean up some open todos left over from Deneb

Will put up a separate PR for that

topics.push({type: GossipType.blob_sidecar, index});
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/beacon-node/src/network/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import type {Datastore} from "interface-datastore";
import {Libp2p as ILibp2p} from "libp2p";
import {PeerIdStr} from "../util/peerId.js";
import {BlobSidecarsByRootRequest} from "../util/types.js";
import {INetworkCorePublic} from "./core/types.js";
import {INetworkEventBus} from "./events.js";
import {GossipType} from "./gossip/interface.js";
Expand Down Expand Up @@ -66,7 +67,7 @@ export interface INetwork extends INetworkCorePublic {
request: phase0.BeaconBlocksByRootRequest
): Promise<WithBytes<SignedBeaconBlock>[]>;
sendBlobSidecarsByRange(peerId: PeerIdStr, request: deneb.BlobSidecarsByRangeRequest): Promise<deneb.BlobSidecar[]>;
sendBlobSidecarsByRoot(peerId: PeerIdStr, request: deneb.BlobSidecarsByRootRequest): Promise<deneb.BlobSidecar[]>;
sendBlobSidecarsByRoot(peerId: PeerIdStr, request: BlobSidecarsByRootRequest): Promise<deneb.BlobSidecar[]>;

// Gossip
publishBeaconBlock(signedBlock: SignedBeaconBlock): Promise<number>;
Expand Down
12 changes: 5 additions & 7 deletions packages/beacon-node/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {PeerId} from "@libp2p/interface";
import {routes} from "@lodestar/api";
import {BeaconConfig} from "@lodestar/config";
import {LoggerNode} from "@lodestar/logger/node";
import {ForkSeq, MAX_BLOBS_PER_BLOCK} from "@lodestar/params";
import {ForkSeq} from "@lodestar/params";
import {ResponseIncoming} from "@lodestar/reqresp";
import {computeStartSlotAtEpoch, computeTimeAtSlot} from "@lodestar/state-transition";
import {
Expand All @@ -28,6 +28,7 @@ import {IBeaconDb} from "../db/interface.js";
import {Metrics, RegistryMetricCreator} from "../metrics/index.js";
import {IClock} from "../util/clock.js";
import {PeerIdStr, peerIdToString} from "../util/peerId.js";
import {BlobSidecarsByRootRequest} from "../util/types.js";
import {INetworkCore, NetworkCore, WorkerNetworkCore} from "./core/index.js";
import {INetworkEventBus, NetworkEvent, NetworkEventBus, NetworkEventData} from "./events.js";
import {getActiveForks} from "./forks.js";
Expand Down Expand Up @@ -502,15 +503,12 @@ export class Network implements INetwork {
return collectMaxResponseTyped(
this.sendReqRespRequest(peerId, ReqRespMethod.BlobSidecarsByRange, [Version.V1], request),
// request's count represent the slots, so the actual max count received could be slots * blobs per slot
request.count * MAX_BLOBS_PER_BLOCK,
request.count * this.config.MAX_BLOBS_PER_BLOCK,
responseSszTypeByMethod[ReqRespMethod.BlobSidecarsByRange]
);
}

async sendBlobSidecarsByRoot(
peerId: PeerIdStr,
request: deneb.BlobSidecarsByRootRequest
): Promise<deneb.BlobSidecar[]> {
async sendBlobSidecarsByRoot(peerId: PeerIdStr, request: BlobSidecarsByRootRequest): Promise<deneb.BlobSidecar[]> {
return collectMaxResponseTyped(
this.sendReqRespRequest(peerId, ReqRespMethod.BlobSidecarsByRoot, [Version.V1], request),
request.length,
Expand All @@ -524,7 +522,7 @@ export class Network implements INetwork {
versions: number[],
request: Req
): AsyncIterable<ResponseIncoming> {
const requestType = requestSszTypeByMethod[method];
const requestType = requestSszTypeByMethod(this.config)[method];
const requestData = requestType ? requestType.serialize(request as never) : new Uint8Array();

// ReqResp outgoing request, emit from main thread to worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export class ReqRespBeaconNode extends ReqResp {

// Overwrite placeholder requestData from main thread with correct sequenceNumber
if (method === ReqRespMethod.Ping) {
requestData = requestSszTypeByMethod[ReqRespMethod.Ping].serialize(this.metadataController.seqNumber);
requestData = requestSszTypeByMethod(this.config)[ReqRespMethod.Ping].serialize(
this.metadataController.seqNumber
);
}

// ReqResp outgoing request, emit from main thread to worker
Expand Down Expand Up @@ -205,7 +207,7 @@ export class ReqRespBeaconNode extends ReqResp {
versions: number[],
request: Req
): AsyncIterable<ResponseIncoming> {
const requestType = requestSszTypeByMethod[method];
const requestType = requestSszTypeByMethod(this.config)[method];
const requestData = requestType ? requestType.serialize(request as never) : new Uint8Array();
return this.sendRequestWithoutEncoding(peerId, method, versions, requestData);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {BLOBSIDECAR_FIXED_SIZE} from "@lodestar/params";
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
import {RootHex, deneb} from "@lodestar/types";
import {RootHex} from "@lodestar/types";
import {fromHex, toRootHex} from "@lodestar/utils";
import {IBeaconChain} from "../../../chain/index.js";
import {IBeaconDb} from "../../../db/index.js";
import {BLOB_SIDECARS_IN_WRAPPER_INDEX} from "../../../db/repositories/blobSidecars.js";
import {BlobSidecarsByRootRequest} from "../../../util/types.js";

export async function* onBlobSidecarsByRoot(
requestBody: deneb.BlobSidecarsByRootRequest,
requestBody: BlobSidecarsByRootRequest,
chain: IBeaconChain,
db: IBeaconDb
): AsyncIterable<ResponseOutgoing> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {ProtocolHandler} from "@lodestar/reqresp";
import {ssz} from "@lodestar/types";
import {IBeaconChain} from "../../../chain/index.js";
import {IBeaconDb} from "../../../db/index.js";
import {BlobSidecarsByRootRequestType} from "../../../util/types.js";
import {GetReqRespHandlerFn, ReqRespMethod} from "../types.js";
import {onBeaconBlocksByRange} from "./beaconBlocksByRange.js";
import {onBeaconBlocksByRoot} from "./beaconBlocksByRoot.js";
Expand Down Expand Up @@ -37,7 +38,7 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
return onBeaconBlocksByRoot(body, chain, db);
},
[ReqRespMethod.BlobSidecarsByRoot]: (req) => {
const body = ssz.deneb.BlobSidecarsByRootRequest.deserialize(req.data);
const body = BlobSidecarsByRootRequestType(chain.config).deserialize(req.data);
return onBlobSidecarsByRoot(body, chain, db);
},
[ReqRespMethod.BlobSidecarsByRange]: (req) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/beacon-node/src/network/reqresp/protocols.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ForkDigestContext} from "@lodestar/config";
import {BeaconConfig, ForkDigestContext} from "@lodestar/config";
import {ContextBytesFactory, ContextBytesType, Encoding} from "@lodestar/reqresp";
import {rateLimitQuotas} from "./rateLimit.js";
import {ProtocolNoHandler, ReqRespMethod, Version, requestSszTypeByMethod, responseSszTypeByMethod} from "./types.js";
Expand Down Expand Up @@ -100,13 +100,13 @@ type ProtocolSummary = {
};

function toProtocol(protocol: ProtocolSummary) {
return (config: ForkDigestContext): ProtocolNoHandler => ({
return (config: BeaconConfig): ProtocolNoHandler => ({
method: protocol.method,
version: protocol.version,
encoding: Encoding.SSZ_SNAPPY,
contextBytes: toContextBytes(protocol.contextBytesType, config),
inboundRateLimits: rateLimitQuotas[protocol.method],
requestSizes: requestSszTypeByMethod[protocol.method],
inboundRateLimits: rateLimitQuotas(config)[protocol.method],
requestSizes: requestSszTypeByMethod(config)[protocol.method],
responseSizes: (fork) => responseSszTypeByMethod[protocol.method](fork, protocol.version),
});
}
Expand Down
29 changes: 13 additions & 16 deletions packages/beacon-node/src/network/reqresp/rateLimit.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import {
MAX_BLOBS_PER_BLOCK,
MAX_REQUEST_BLOB_SIDECARS,
MAX_REQUEST_BLOCKS,
MAX_REQUEST_LIGHT_CLIENT_UPDATES,
} from "@lodestar/params";
import {ChainConfig} from "@lodestar/config";
import {MAX_REQUEST_BLOCKS, MAX_REQUEST_LIGHT_CLIENT_UPDATES} from "@lodestar/params";
import {InboundRateLimitQuota} from "@lodestar/reqresp";
import {ReqRespMethod, RequestBodyByMethod} from "./types.js";
import {requestSszTypeByMethod} from "./types.js";

export const rateLimitQuotas: Record<ReqRespMethod, InboundRateLimitQuota> = {
export const rateLimitQuotas: (config: ChainConfig) => Record<ReqRespMethod, InboundRateLimitQuota> = (config) => ({
[ReqRespMethod.Status]: {
// Rationale: https://github.com/sigp/lighthouse/blob/bf533c8e42cc73c35730e285c21df8add0195369/beacon_node/lighthouse_network/src/rpc/mod.rs#L118-L130
byPeer: {quota: 5, quotaTimeMs: 15_000},
Expand All @@ -29,22 +25,22 @@ export const rateLimitQuotas: Record<ReqRespMethod, InboundRateLimitQuota> = {
[ReqRespMethod.BeaconBlocksByRange]: {
// Rationale: https://github.com/sigp/lighthouse/blob/bf533c8e42cc73c35730e285c21df8add0195369/beacon_node/lighthouse_network/src/rpc/mod.rs#L118-L130
byPeer: {quota: MAX_REQUEST_BLOCKS, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(ReqRespMethod.BeaconBlocksByRange, (req) => req.count),
getRequestCount: getRequestCountFn(config, ReqRespMethod.BeaconBlocksByRange, (req) => req.count),
},
[ReqRespMethod.BeaconBlocksByRoot]: {
// Rationale: https://github.com/sigp/lighthouse/blob/bf533c8e42cc73c35730e285c21df8add0195369/beacon_node/lighthouse_network/src/rpc/mod.rs#L118-L130
byPeer: {quota: 128, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(ReqRespMethod.BeaconBlocksByRoot, (req) => req.length),
getRequestCount: getRequestCountFn(config, ReqRespMethod.BeaconBlocksByRoot, (req) => req.length),
},
[ReqRespMethod.BlobSidecarsByRange]: {
// Rationale: MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
byPeer: {quota: MAX_REQUEST_BLOB_SIDECARS, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(ReqRespMethod.BlobSidecarsByRange, (req) => req.count),
byPeer: {quota: config.MAX_REQUEST_BLOB_SIDECARS, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(config, ReqRespMethod.BlobSidecarsByRange, (req) => req.count),
},
[ReqRespMethod.BlobSidecarsByRoot]: {
// Rationale: quota of BeaconBlocksByRoot * MAX_BLOBS_PER_BLOCK
byPeer: {quota: 128 * MAX_BLOBS_PER_BLOCK, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(ReqRespMethod.BlobSidecarsByRoot, (req) => req.length),
byPeer: {quota: config.MAX_REQUEST_BLOB_SIDECARS, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(config, ReqRespMethod.BlobSidecarsByRoot, (req) => req.length),
},
[ReqRespMethod.LightClientBootstrap]: {
// As similar in the nature of `Status` protocol so we use the same rate limits.
Expand All @@ -53,7 +49,7 @@ export const rateLimitQuotas: Record<ReqRespMethod, InboundRateLimitQuota> = {
[ReqRespMethod.LightClientUpdatesByRange]: {
// Same rationale as for BeaconBlocksByRange
byPeer: {quota: MAX_REQUEST_LIGHT_CLIENT_UPDATES, quotaTimeMs: 10_000},
getRequestCount: getRequestCountFn(ReqRespMethod.LightClientUpdatesByRange, (req) => req.count),
getRequestCount: getRequestCountFn(config, ReqRespMethod.LightClientUpdatesByRange, (req) => req.count),
},
[ReqRespMethod.LightClientFinalityUpdate]: {
// Finality updates should not be requested more than once per epoch.
Expand All @@ -65,14 +61,15 @@ export const rateLimitQuotas: Record<ReqRespMethod, InboundRateLimitQuota> = {
// Allow 2 per slot and a very safe bound until there's more testing of real usage.
byPeer: {quota: 2, quotaTimeMs: 12_000},
},
};
});

// Helper to produce a getRequestCount function
function getRequestCountFn<T extends ReqRespMethod>(
config: ChainConfig,
method: T,
fn: (req: RequestBodyByMethod[T]) => number
): (reqData: Uint8Array) => number {
const type = requestSszTypeByMethod[method];
const type = requestSszTypeByMethod(config)[method];
return (reqData: Uint8Array) => {
try {
return (type && fn(type.deserialize(reqData))) ?? 1;
Expand Down
12 changes: 7 additions & 5 deletions packages/beacon-node/src/network/reqresp/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Type} from "@chainsafe/ssz";
import {ChainConfig} from "@lodestar/config";
import {ForkLightClient, ForkName, isForkLightClient} from "@lodestar/params";
import {Protocol, ProtocolHandler, ReqRespRequest} from "@lodestar/reqresp";
import {
Expand All @@ -15,6 +16,7 @@ import {
ssz,
sszTypesFor,
} from "@lodestar/types";
import {BlobSidecarsByRootRequest, BlobSidecarsByRootRequestType} from "../../util/types.js";

export type ProtocolNoHandler = Omit<Protocol, "handler">;

Expand Down Expand Up @@ -44,7 +46,7 @@ export type RequestBodyByMethod = {
[ReqRespMethod.BeaconBlocksByRange]: phase0.BeaconBlocksByRangeRequest;
[ReqRespMethod.BeaconBlocksByRoot]: phase0.BeaconBlocksByRootRequest;
[ReqRespMethod.BlobSidecarsByRange]: deneb.BlobSidecarsByRangeRequest;
[ReqRespMethod.BlobSidecarsByRoot]: deneb.BlobSidecarsByRootRequest;
[ReqRespMethod.BlobSidecarsByRoot]: BlobSidecarsByRootRequest;
[ReqRespMethod.LightClientBootstrap]: Root;
[ReqRespMethod.LightClientUpdatesByRange]: altair.LightClientUpdatesByRange;
[ReqRespMethod.LightClientFinalityUpdate]: null;
Expand All @@ -68,22 +70,22 @@ type ResponseBodyByMethod = {
};

/** Request SSZ type for each method and ForkName */
export const requestSszTypeByMethod: {
export const requestSszTypeByMethod: (config: ChainConfig) => {
[K in ReqRespMethod]: RequestBodyByMethod[K] extends null ? null : Type<RequestBodyByMethod[K]>;
} = {
} = (config) => ({
[ReqRespMethod.Status]: ssz.phase0.Status,
[ReqRespMethod.Goodbye]: ssz.phase0.Goodbye,
[ReqRespMethod.Ping]: ssz.phase0.Ping,
[ReqRespMethod.Metadata]: null,
[ReqRespMethod.BeaconBlocksByRange]: ssz.phase0.BeaconBlocksByRangeRequest,
[ReqRespMethod.BeaconBlocksByRoot]: ssz.phase0.BeaconBlocksByRootRequest,
[ReqRespMethod.BlobSidecarsByRange]: ssz.deneb.BlobSidecarsByRangeRequest,
[ReqRespMethod.BlobSidecarsByRoot]: ssz.deneb.BlobSidecarsByRootRequest,
[ReqRespMethod.BlobSidecarsByRoot]: BlobSidecarsByRootRequestType(config),
[ReqRespMethod.LightClientBootstrap]: ssz.Root,
[ReqRespMethod.LightClientUpdatesByRange]: ssz.altair.LightClientUpdatesByRange,
[ReqRespMethod.LightClientFinalityUpdate]: null,
[ReqRespMethod.LightClientOptimisticUpdate]: null,
};
});

export type ResponseTypeGetter<T> = (fork: ForkName, version: number) => Type<T>;

Expand Down
7 changes: 6 additions & 1 deletion packages/beacon-node/src/util/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ContainerType, ListCompositeType, ValueOf} from "@chainsafe/ssz";
import {ChainConfig} from "@lodestar/config";
import {ssz} from "@lodestar/types";

// Misc SSZ types used only in the beacon-node package, no need to upstream to types
Expand All @@ -12,3 +13,7 @@ export const signedBLSToExecutionChangeVersionedType = new ContainerType(
{jsonCase: "eth2", typeName: "SignedBLSToExecutionChangeVersionedType"}
);
export type SignedBLSToExecutionChangeVersioned = ValueOf<typeof signedBLSToExecutionChangeVersionedType>;

export const BlobSidecarsByRootRequestType = (config: ChainConfig) =>
new ListCompositeType(ssz.deneb.BlobIdentifier, config.MAX_REQUEST_BLOB_SIDECARS);
export type BlobSidecarsByRootRequest = ValueOf<ReturnType<typeof BlobSidecarsByRootRequestType>>;
3 changes: 3 additions & 0 deletions packages/config/src/chainConfig/configs/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export const chainConfig: ChainConfig = {
// Deneb
// `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096,
MAX_BLOBS_PER_BLOCK: 6,
// MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
MAX_REQUEST_BLOB_SIDECARS: 768,

// Electra
// 2**8 * 10**9 (= 256,000,000,000)
Expand Down
3 changes: 3 additions & 0 deletions packages/config/src/chainConfig/configs/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ export const chainConfig: ChainConfig = {
// Deneb
// `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096,
MAX_BLOBS_PER_BLOCK: 6,
// MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
MAX_REQUEST_BLOB_SIDECARS: 768,

// Electra
// 2**7 * 10**9 (= 128,000,000,000)
Expand Down
Loading
Loading