-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
beacon/engine: check for empty requests #31010
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: lightclient <14004106 [email protected]>
for _, req := range requests { | ||
// No empty requests. | ||
if len(req) < 2 { | ||
return nil, fmt.Errorf("empty request: %v", req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they define an error code for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the normal invalid params error code: https://github.com/ethereum/execution-apis/pull/622/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue with this PR is that it returns a PayloadStatusV1, status INVALID and no error -- note the return api.invalid(err, nil), nil
in newPayload(..)
.
The PR requires clients return the error -32602: Invalid params
. Usually we return this in the body of the versioned method e.g.
func (api *ConsensusAPI) NewPayloadV4(params engine.ExecutableData, versionedHashes []common.Hash, beaconRoot *common.Hash, executionRequests []hexutil.Bytes) (engine.PayloadStatusV1, error) {
...
if executionRequests == nil {
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil executionRequests post-prague"))
}
}
So we should either do this requests check there in the versioned method or we need to interpret the error from ExecutableDataToBlock
and return invalid params from newPayload
.
According to https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#engine_newpayloadv4: