Skip to content

Commit

Permalink
Review PR
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Nov 17, 2022
1 parent 6963c1c commit 864b7d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/beacon-node/src/network/gossip/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ export function getGossipHandlers(modules: ValidatorFnsModules, options: GossipH
const {beaconBlock, blobsSidecar} = blockAndBlocks;
const blockImport: BlockImport = {block: beaconBlock, blobs: blobsSidecar};

// TODO EIP-4844: Should throw for pre fork blocks?
if (config.getForkSeq(beaconBlock.message.slot) < ForkSeq.eip4844) {
throw new GossipActionError(GossipAction.REJECT, {code: "PRE_EIP4844_BLOCK"});
}

// Validate block + blob. Then forward, then handle both
await validateBeaconBlock(blockImport, topic.fork, peerIdStr);
await validateGossipBlobsSidecar(beaconBlock, blobsSidecar);
Expand Down
1 change: 1 addition & 0 deletions packages/beacon-node/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export class Network implements INetwork {
request: phase0.BeaconBlocksByRangeRequest
): Promise<BlockImport[]> {
// TODO EIP-4844: Assumes all blocks in the same epoch
// TODO EIP-4844: Ensure all blocks are in the same epoch
if (this.config.getForkSeq(request.startSlot) >= ForkSeq.eip4844) {
// TODO EIP-4844: Do two requests at once for blocks and blobs
const blocks = await this.reqResp.beaconBlocksByRange(peerId, request);
Expand Down

0 comments on commit 864b7d3

Please sign in to comment.