Skip to content
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

eth_getLogs suggest event ranges which can never be fetched #3412

Open
joshstevens19 opened this issue Dec 27, 2024 · 0 comments
Open

eth_getLogs suggest event ranges which can never be fetched #3412

joshstevens19 opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@joshstevens19
Copy link

joshstevens19 commented Dec 27, 2024

🐛 Bug Report

📝 Description

Hey, I am running the zkSync local node and hit an issue; the node supplies a message which suggests block ranges when requesting large amounts of logs, which frameworks use for indexing; all other providers like Alchemy or Tenderly do similar as well to allow you to skip over events faster instead of having to scan block by block:

Doing a request like:

{
  "jsonrpc":"2.0",
  "method":"eth_getLogs",
  "params":[{
      "fromBlock": "0x0",
       "topics":["0x3ae390be004f906708f14ce7e66ca2ce9e1ad7ba15cd6401d7479f74cc70a58e"]
  }],
  "id":74
}

would yield back:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32602,
        "message": "Query returned more than 10000 results. Try with this block range [0x0, 0x30f]."
    },
    "id": 74
}

which makes sense the indexing framework would extract that range and do the next request:

{
	"jsonrpc":"2.0",
	"method":"eth_getLogs",
	"params":[{
             "fromBlock": "0x0",
             "toBlock": "0x30f",
	     "topics":["0x3ae390be004f906708f14ce7e66ca2ce9e1ad7ba15cd6401d7479f74cc70a58e"]
	}],
	"id":74
}

but this then errors with:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32008,
        "message": "Response is too big",
        "data": "Exceeded max limit of 10485760"
    },
    "id": 74
}

This means indexing systems break as they expect the suggested range to always work, and indexing frameworks should not have to change the core code to handle this edge case.

🔄 Reproduction Steps

Find an event which has emitted over 10,000 events and produced a bigger payload than 10,485,760

🤔 Expected Behavior

The suggested blocks should consider the event payload response size to give a range which will always return from the node

😯 Current Behavior

The suggested blocks given back in eth_getLogs do not work meaning indexing systems would not be able to index that event

@joshstevens19 joshstevens19 added the bug Something isn't working label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant