Skip to content

support cast logs query chunking #12687

@mattsse

Description

@mattsse

Component

Cast

Describe the feature you would like

there's often a length query limit on eth_getlogs:

Error: server returned an error response: error code -32602: query exceeds max block range 100000

Error: server returned an error response: error code -32603: eth_getLogs range is too large, max is 1k blocks

Error: server returned an error response: error code 35: ranges over 10000 blocks are not supported on freetier

so usually 1k or 10k

Error: server returned an error response: error code -32602: eth_getLogs is limited to 1024 block range. Please check the parameter requirements at https://docs.blockpi.io/documentations/api-reference

when done with

cast logs --from-block <> --to-block <>

Ideally we can detect this and auto chunk this in based on the response, naive option would be to just junk by 10k blocks, that should work for most
but we should also make this a cli arg, like --query-size

the same we have for the matches:

Error: server returned an error response: error code -32602: query exceeds max results 20000, retry with the range 23879634-23879696

e.g.: cast logs --from-block 23879634 --to-block 23889634 "Transfer(address indexed from, address indexed to, uint256 value)"

so ideally we also figure this out from the response and adjust the size accordingly

Additional context

No response

Metadata

Metadata

Labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions