-
Notifications
You must be signed in to change notification settings - Fork 91
feat: ensure rpc params array length according to rpc definitions #3892
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
Conversation
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
simzzz
left a comment
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.
LGTM
Signed-off-by: nikolay <[email protected]>
acuarica
left a comment
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.
can we include some tests in validators.spec.ts and rpcMethodDispatcher.spec.ts (where the error described in the original issue actually happens)?
Signed-off-by: nikolay <[email protected]>
Description:
Some RPC endpoints, like eth_getBalance, do not validate the parameters array length properly. This can lead to a "500 Internal Server Error" when it should have been a 400 error instead.
Solution:
Ensure
paramsarray length is less or equal toindexeslength here and throwINVALID_PARAMETERSif needed.Affected JSON-RPC Methods:
This issue affects the RPC endpoints that do not use a parameters layout, i.e.,
RPC_LAYOUT.customnorRPC_LAYOUT.REQUEST_DETAILS_ONLY, and logsrequestDetails.formattedRequestId. These are:Related issue(s):
Fixes #3858
Notes for reviewer:
Checklist