-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: api: Length check the array sent to RPC. #11696
Conversation
Seems reasonable, except that I don't know what a reasonable limit on this would be; geth doesn't appear to have one, at least when you get this deep: https://github.com/ethereum/go-ethereum/blob/c41105ce80f12f60ec4bf6c65c4c59c6bf4a86e7/eth/gasprice/feehistory.go#L200 and it event does an |
Co-authored-by: Rod Vagg <rod@vagg.org>
@rvagg. I had a discussion about the limits with @Stebalien, that maybe 100 would be reasonable number since one would not need more than that to calculate the eth_feehistory. It also aims to solve computation issues this might cause with huge arrays.
I was not aware of such a case in geth. I am not too expert in this area and how often, how much data it is expected to compute. I will agree to what you think should be right. Though, imo keeping the hard fix on the length won't harm. |
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.
this seems fine to me, we can bump it up if there's a genuine request for more
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.
Nits, but this looks correct.
Co-authored-by: Steven Allen <steven@stebalien.com>
Thank you! Sorry for all the nits. One final thing: it looks like some of the lints are unhappy. I think you just need to run |
Co-authored-by: Rod Vagg <rod@vagg.org> Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Rod Vagg <rod@vagg.org> Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Rod Vagg <rod@vagg.org> Co-authored-by: Steven Allen <steven@stebalien.com>
Related Issues
When calling eth_feeHistory, it takes input a rewardPercentile array. Currently, there isn't any restriction on the length of the array, can result in high computation and potentially leading to OOM issues in RPC nodes. The fix is to set a hard limit of the array to 100.
Proposed Changes
Changing the length of RewardPercentiles Array to upto 100.
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps