Skip to content

Commit 1a1adcd

Browse files
committed
beacon/engine, eth/catalyst: return UnknownParent error when parent doesn't exist
1 parent e42bfa1 commit 1a1adcd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

beacon/engine/errors.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ var (
8585
TooLargeRequest = &EngineAPIError{code: -38004, msg: "Too large request"}
8686
InvalidParams = &EngineAPIError{code: -32602, msg: "Invalid parameters"}
8787
UnsupportedFork = &EngineAPIError{code: -38005, msg: "Unsupported fork"}
88+
UnknownParent = &EngineAPIError{code: -38006, msg: "Unknown parent"}
8889

8990
STATUS_INVALID = ForkChoiceResponse{PayloadStatus: PayloadStatusV1{Status: INVALID}, PayloadID: nil}
9091
STATUS_SYNCING = ForkChoiceResponse{PayloadStatus: PayloadStatusV1{Status: SYNCING}, PayloadID: nil}

eth/catalyst/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,10 @@ func (api *ConsensusAPI) GetInclusionListV1(parentHash common.Hash) (types.Inclu
574574
return inclusionList, nil
575575
}
576576

577+
if api.eth.BlockChain().GetBlockByHash(parentHash) == nil {
578+
return nil, engine.UnknownParent
579+
}
580+
577581
args := &miner.BuildInclusionListArgs{
578582
Parent: parentHash,
579583
}

0 commit comments

Comments
 (0)