|
|
@ -194,7 +194,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV2(update engine.ForkchoiceStateV1, pa |
|
|
|
if params.BeaconRoot != nil { |
|
|
|
if params.BeaconRoot != nil { |
|
|
|
return engine.STATUS_INVALID, engine.InvalidPayloadAttributes.With(errors.New("unexpected beacon root")) |
|
|
|
return engine.STATUS_INVALID, engine.InvalidPayloadAttributes.With(errors.New("unexpected beacon root")) |
|
|
|
} |
|
|
|
} |
|
|
|
switch api.eth.BlockChain().Config().LatestFork(params.Timestamp) { |
|
|
|
switch api.eth.BlockChain().Config().LatestPostLondonFork(params.Timestamp) { |
|
|
|
case forks.Paris: |
|
|
|
case forks.Paris: |
|
|
|
if params.Withdrawals != nil { |
|
|
|
if params.Withdrawals != nil { |
|
|
|
return engine.STATUS_INVALID, engine.InvalidPayloadAttributes.With(errors.New("withdrawals before shanghai")) |
|
|
|
return engine.STATUS_INVALID, engine.InvalidPayloadAttributes.With(errors.New("withdrawals before shanghai")) |
|
|
@ -220,7 +220,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV3(update engine.ForkchoiceStateV1, pa |
|
|
|
if params.BeaconRoot == nil { |
|
|
|
if params.BeaconRoot == nil { |
|
|
|
return engine.STATUS_INVALID, engine.InvalidPayloadAttributes.With(errors.New("missing beacon root")) |
|
|
|
return engine.STATUS_INVALID, engine.InvalidPayloadAttributes.With(errors.New("missing beacon root")) |
|
|
|
} |
|
|
|
} |
|
|
|
if api.eth.BlockChain().Config().LatestFork(params.Timestamp) != forks.Cancun { |
|
|
|
if api.eth.BlockChain().Config().LatestPostLondonFork(params.Timestamp) != forks.Cancun { |
|
|
|
return engine.STATUS_INVALID, engine.UnsupportedFork.With(errors.New("forkchoiceUpdatedV3 must only be called for cancun payloads")) |
|
|
|
return engine.STATUS_INVALID, engine.UnsupportedFork.With(errors.New("forkchoiceUpdatedV3 must only be called for cancun payloads")) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -465,7 +465,7 @@ func (api *ConsensusAPI) NewPayloadV2(params engine.ExecutableData) (engine.Payl |
|
|
|
if api.eth.BlockChain().Config().IsCancun(api.eth.BlockChain().Config().LondonBlock, params.Timestamp) { |
|
|
|
if api.eth.BlockChain().Config().IsCancun(api.eth.BlockChain().Config().LondonBlock, params.Timestamp) { |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("can't use newPayloadV2 post-cancun")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("can't use newPayloadV2 post-cancun")) |
|
|
|
} |
|
|
|
} |
|
|
|
if api.eth.BlockChain().Config().LatestFork(params.Timestamp) == forks.Shanghai { |
|
|
|
if api.eth.BlockChain().Config().LatestPostLondonFork(params.Timestamp) == forks.Shanghai { |
|
|
|
if params.Withdrawals == nil { |
|
|
|
if params.Withdrawals == nil { |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil withdrawals post-shanghai")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil withdrawals post-shanghai")) |
|
|
|
} |
|
|
|
} |
|
|
@ -502,7 +502,7 @@ func (api *ConsensusAPI) NewPayloadV3(params engine.ExecutableData, versionedHas |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil beaconRoot post-cancun")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil beaconRoot post-cancun")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if api.eth.BlockChain().Config().LatestFork(params.Timestamp) != forks.Cancun { |
|
|
|
if api.eth.BlockChain().Config().LatestPostLondonFork(params.Timestamp) != forks.Cancun { |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.UnsupportedFork.With(errors.New("newPayloadV3 must only be called for cancun payloads")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.UnsupportedFork.With(errors.New("newPayloadV3 must only be called for cancun payloads")) |
|
|
|
} |
|
|
|
} |
|
|
|
return api.newPayload(params, versionedHashes, beaconRoot) |
|
|
|
return api.newPayload(params, versionedHashes, beaconRoot) |
|
|
|