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
410
410
// NewPayloadV1 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
411
411
func (api * ConsensusAPI ) NewPayloadV1 (params engine.ExecutableData ) (engine.PayloadStatusV1 , error ) {
412
412
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" ) )
414
414
}
415
415
return api .newPayload (params )
416
416
}
417
417
418
418
// NewPayloadV2 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
419
419
func (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
+ }
420
427
return api .newPayload (params )
421
428
}
422
429
You can’t perform that action at this time.
0 commit comments