Skip to content

Commit

Permalink
fix: revert BlobSidecarsByRoot/Range version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jan 10, 2025
1 parent cf64359 commit 6109a83
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
15 changes: 2 additions & 13 deletions packages/beacon-node/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,27 +504,16 @@ export class Network implements INetwork {
): Promise<deneb.BlobSidecar[]> {
const fork = this.config.getForkName(request.startSlot);
return collectMaxResponseTyped(
this.sendReqRespRequest(
peerId,
ReqRespMethod.BlobSidecarsByRange,
[isForkPostElectra(fork) ? Version.V2 : Version.V1],
request
),
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 * this.config.getMaxBlobsPerBlock(fork),
responseSszTypeByMethod[ReqRespMethod.BlobSidecarsByRange]
);
}

async sendBlobSidecarsByRoot(peerId: PeerIdStr, request: BlobSidecarsByRootRequest): Promise<deneb.BlobSidecar[]> {
const fork = this.config.getForkName(this.clock.currentSlot);
return collectMaxResponseTyped(
this.sendReqRespRequest(
peerId,
ReqRespMethod.BlobSidecarsByRoot,
[isForkPostElectra(fork) ? Version.V2 : Version.V1],
request
),
this.sendReqRespRequest(peerId, ReqRespMethod.BlobSidecarsByRoot, [Version.V1], request),
request.length,
responseSszTypeByMethod[ReqRespMethod.BlobSidecarsByRoot]
);
Expand Down
8 changes: 0 additions & 8 deletions packages/beacon-node/src/network/reqresp/ReqRespBeaconNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,12 @@ export class ReqRespBeaconNode extends ReqResp {
}

if (ForkSeq[fork] >= ForkSeq.deneb) {
// TODO Electra: Consider deprecating BlobSidecarsByRootV1 and BlobSidecarsByRangeV1 at fork boundary or after Electra is stable
protocolsAtFork.push(
[protocols.BlobSidecarsByRoot(this.config), this.getHandler(ReqRespMethod.BlobSidecarsByRoot)],
[protocols.BlobSidecarsByRange(this.config), this.getHandler(ReqRespMethod.BlobSidecarsByRange)]
);
}

if (ForkSeq[fork] >= ForkSeq.electra) {
protocolsAtFork.push(
[protocols.BlobSidecarsByRootV2(this.config), this.getHandler(ReqRespMethod.BlobSidecarsByRoot)],
[protocols.BlobSidecarsByRangeV2(this.config), this.getHandler(ReqRespMethod.BlobSidecarsByRange)]
);
}

return protocolsAtFork;
}

Expand Down
12 changes: 0 additions & 12 deletions packages/beacon-node/src/network/reqresp/protocols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,12 @@ export const BlobSidecarsByRange = toProtocol({
contextBytesType: ContextBytesType.ForkDigest,
});

export const BlobSidecarsByRangeV2 = toProtocol({
method: ReqRespMethod.BlobSidecarsByRange,
version: Version.V2,
contextBytesType: ContextBytesType.ForkDigest,
});

export const BlobSidecarsByRoot = toProtocol({
method: ReqRespMethod.BlobSidecarsByRoot,
version: Version.V1,
contextBytesType: ContextBytesType.ForkDigest,
});

export const BlobSidecarsByRootV2 = toProtocol({
method: ReqRespMethod.BlobSidecarsByRoot,
version: Version.V2,
contextBytesType: ContextBytesType.ForkDigest,
});

export const LightClientBootstrap = toProtocol({
method: ReqRespMethod.LightClientBootstrap,
version: Version.V1,
Expand Down

0 comments on commit 6109a83

Please sign in to comment.