Skip to content

Commit 050c082

Browse files
MariusVanDerWijdenshekhirin
authored andcommitted
eth/catalyst: disallow forkchoiceupdate v1 post-shanghai (ethereum#26645)
1 parent 3000fcc commit 050c082

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

eth/catalyst/api.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,13 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI {
169169
// If there are payloadAttributes: we try to assemble a block with the payloadAttributes
170170
// and return its payloadID.
171171
func (api *ConsensusAPI) ForkchoiceUpdatedV1(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) {
172-
if payloadAttributes != nil && payloadAttributes.Withdrawals != nil {
173-
return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("withdrawals not supported in V1"))
172+
if payloadAttributes != nil {
173+
if payloadAttributes.Withdrawals != nil {
174+
return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("withdrawals not supported in V1"))
175+
}
176+
if api.eth.BlockChain().Config().IsShanghai(payloadAttributes.Timestamp) {
177+
return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("forkChoiceUpdateV1 called post-shanghai"))
178+
}
174179
}
175180
return api.forkchoiceUpdated(update, payloadAttributes)
176181
}

0 commit comments

Comments
 (0)