Skip to content

Commit 9d17826

Browse files
committed
beacon/engine, eth/catalyst: return UnknownParent error when parent doesn't exist
1 parent 508ba1b commit 9d17826

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
@@ -655,6 +655,10 @@ func (api *ConsensusAPI) GetInclusionListV1(parentHash common.Hash) (types.Inclu
655655
return inclusionList, nil
656656
}
657657

658+
if api.eth.BlockChain().GetBlockByHash(parentHash) == nil {
659+
return nil, engine.UnknownParent
660+
}
661+
658662
args := &miner.BuildInclusionListArgs{
659663
Parent: parentHash,
660664
}

0 commit comments

Comments
 (0)