go-ethereum
go-ethereum copied to clipboard
internal/ethapi: crash casued by no limits for rewardPercentiles at interface FeeHistory
there is no number limit for rewardPercentiles
when maxBlockHistory
set to 1024,
then set 600k element(limited by rpc requtest size) in rewardPercentiles to call FeeHistory
the node will crash, for too many memory need.
maybe only a few nodes set maxBlockHistory
such a big number,
but I think It's better to limit the number of rewardPercentiles to defend attack.
so, please check this PR eth/gasprice: add query limit for FeeHistory to defend DDOS attack again, thx.