Skip to content

Commit

Permalink
fix: fix max responses that can be received by blobs side car by range (
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech authored Jun 22, 2023
1 parent c042a0b commit 3dd0dfe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/beacon-node/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {phase0, allForks, deneb, altair, Root, capella, SlotRootHex} from "@lode
import {routes} from "@lodestar/api";
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/score";
import {ResponseIncoming} from "@lodestar/reqresp";
import {ForkName, ForkSeq} from "@lodestar/params";
import {ForkName, ForkSeq, MAX_BLOBS_PER_BLOCK} from "@lodestar/params";
import {Metrics, RegistryMetricCreator} from "../metrics/index.js";
import {IBeaconChain} from "../chain/index.js";
import {IBeaconDb} from "../db/interface.js";
Expand Down Expand Up @@ -468,7 +468,8 @@ export class Network implements INetwork {
): Promise<deneb.BlobSidecar[]> {
return collectMaxResponseTyped(
this.sendReqRespRequest(peerId, ReqRespMethod.BlobSidecarsByRange, [Version.V1], request),
request.count,
// request's count represent the slots, so the actual max count received could be slots * blobs per slot
request.count * MAX_BLOBS_PER_BLOCK,
responseSszTypeByMethod[ReqRespMethod.BlobSidecarsByRange]
);
}
Expand Down

0 comments on commit 3dd0dfe

Please sign in to comment.