Skip to content

Commit

Permalink
Fix bug on pre-Pectra newPayload (#12998)
Browse files Browse the repository at this point in the history
Fixes bug introduced in #12979
  • Loading branch information
somnathb1 authored Dec 4, 2024
1 parent 53b973d commit e56550f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions turbo/engineapi/engine_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,17 @@ func (s *EngineServer) checkWithdrawalsPresence(time uint64, withdrawals types.W
}

func (s *EngineServer) checkRequestsPresence(version clparams.StateVersion, executionRequests []hexutility.Bytes) error {
if version < clparams.ElectraVersion && executionRequests != nil {
return &rpc.InvalidParamsError{Message: "requests in EngineAPI not supported before Prague"}
}
if executionRequests == nil {
return &rpc.InvalidParamsError{Message: "missing requests list"}
}
if len(executionRequests) != len(types.KnownRequestTypes) {
return &rpc.InvalidParamsError{Message: "invalid requests lists"}
if version < clparams.ElectraVersion {
if executionRequests != nil {
return &rpc.InvalidParamsError{Message: "requests in EngineAPI not supported before Prague"}
}
} else {
if executionRequests == nil {
return &rpc.InvalidParamsError{Message: "missing requests list"}
}
if len(executionRequests) != len(types.KnownRequestTypes) {
return &rpc.InvalidParamsError{Message: "invalid requests lists"}
}
}
return nil
}
Expand Down

0 comments on commit e56550f

Please sign in to comment.