From 6a148dd5c349c57431a3a6efd48842a41b9d0821 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Thu, 9 Feb 2023 09:53:22 +0100 Subject: [PATCH] eth/catalyst: disallow forkchoiceupdate v1 post-shanghai (#26645) --- eth/catalyst/api.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 15b53985a..01a29fc44 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -169,8 +169,13 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI { // If there are payloadAttributes: we try to assemble a block with the payloadAttributes // and return its payloadID. func (api *ConsensusAPI) ForkchoiceUpdatedV1(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) { - if payloadAttributes != nil && payloadAttributes.Withdrawals != nil { - return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("withdrawals not supported in V1")) + if payloadAttributes != nil { + if payloadAttributes.Withdrawals != nil { + return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("withdrawals not supported in V1")) + } + if api.eth.BlockChain().Config().IsShanghai(payloadAttributes.Timestamp) { + return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("forkChoiceUpdateV1 called post-shanghai")) + } } return api.forkchoiceUpdated(update, payloadAttributes) }