Skip to content

Commit

Permalink
eth/catalyst: disallow fcuv1 post-shanghai
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Feb 9, 2023
1 parent 095e365 commit 890f622
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 890f622

Please sign in to comment.