erigontech / erigontech/silkworm

rpcdaemon: limit default max number of output traces in trace_filter

Open
#2,670 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
318
Forks
84
PR merge metrics
No merged PRs in 30d

Description

Calling `trace_filter` API by providing `toBlock` >> `fromBlock` causes a long call execution.
For example:
```
{
"request": {
"id": 1,
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": 152918,
"toBlock": 2446688
}
]
}

{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5",
"gas": "0x7148",
"input": "0x",
"to": "0xef4f88a89dde9340a4ec680498aa1787ad608d8f",
"value": "0xb301e9c3d8fe10"
},
]
}
```
In order to mitigate this problem, we should limit the maximum number of traces contained in the response `result` to N, where N could be hard-coded or passed via CLI.
Such value N acts as a default value for the `count` input parameter.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.