INFURA / infura

Official Public Repository for INFURA
https://infura.io
380 stars 62 forks source link

eth_getLogs is taking about 12 seconds #148

Open wjmelements opened 6 years ago

wjmelements commented 6 years ago

The latency difference between fetching information with eth_getLogs compared to eth_call is significant. The high latency leads me to suspect that logs aren't indexed by contract address or topic.

Experimentally, the request seems to take between 11 and 14 seconds. Logs are important sources of information, and request latencies should be less than the block time.

The request I am sending is:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [{
    "address":"0x000000002bb43c83ece652d161ad0fa862129a2c",
    "fromBlock":"0x4ee93f",
    "toBlock":"latest",
    "topics":["0xd721fc4b71111225bba131141f013ef3e3956654b0eade3c9e9f611f0d93b551"]
  }]
}

There are 14 events currently expected in the response, spread over about 7 months.

wjmelements commented 6 years ago

I am currently working around this issue by specifying several, narrower, block ranges.

wjmelements commented 6 years ago

For comparison, the same request but on Rinkeby with a fromBlock of 0x0 takes about one second.

wnz99 commented 5 years ago

We are having similar issues.

terryli0095 commented 5 years ago

We are also experiencing the same issue