File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -410,13 +410,20 @@ func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID) (*engine.Executi
410410// NewPayloadV1 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
411411func (api * ConsensusAPI ) NewPayloadV1 (params engine.ExecutableData ) (engine.PayloadStatusV1 , error ) {
412412 if params .Withdrawals != nil {
413- return engine.PayloadStatusV1 {Status : engine .INVALID }, fmt .Errorf ("withdrawals not supported in V1" )
413+ return engine.PayloadStatusV1 {Status : engine .INVALID }, engine . InvalidParams . With ( fmt .Errorf ("withdrawals not supported in V1" ) )
414414 }
415415 return api .newPayload (params )
416416}
417417
418418// NewPayloadV2 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
419419func (api * ConsensusAPI ) NewPayloadV2 (params engine.ExecutableData ) (engine.PayloadStatusV1 , error ) {
420+ if api .eth .BlockChain ().Config ().IsShanghai (params .Timestamp ) {
421+ if params .Withdrawals == nil {
422+ return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .InvalidParams .With (fmt .Errorf ("nil withdrawals post-shanghai" ))
423+ }
424+ } else if params .Withdrawals != nil {
425+ return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .InvalidParams .With (fmt .Errorf ("non-nil withdrawals pre-shanghai" ))
426+ }
420427 return api .newPayload (params )
421428}
422429
You can’t perform that action at this time.
0 commit comments