Skip to content

Commit

Permalink
fix: ignore ALREADY_KNOWN gossip block error (#5714)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored and philknows committed Jun 28, 2023
1 parent ec55a67 commit 67a2b72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/beacon-node/src/network/processor/gossipHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export function getGossipHandlers(modules: ValidatorFnsModules, options: GossipH

chain
.processBlock(blockInput, {
// block may be downloaded and processed by UnknownBlockSync
ignoreIfKnown: true,
// proposer signature already checked in validateBeaconBlock()
validProposerSignature: true,
// blobsSidecar already checked in validateGossipBlobsSidecar()
Expand All @@ -162,6 +164,8 @@ export function getGossipHandlers(modules: ValidatorFnsModules, options: GossipH
.catch((e) => {
if (e instanceof BlockError) {
switch (e.type.code) {
// ALREADY_KNOWN should not happen with ignoreIfKnown=true above
// PARENT_UNKNOWN should not happen, we handled this in validateBeaconBlock() function above
case BlockErrorCode.ALREADY_KNOWN:
case BlockErrorCode.PARENT_UNKNOWN:
case BlockErrorCode.PRESTATE_MISSING:
Expand Down

0 comments on commit 67a2b72

Please sign in to comment.