trueblocks-core
trueblocks-core copied to clipboard
chifra export - poor performance of logs query
This query takes a very long time through chifra
time chifra export --cache \
--logs \
--fmt json \
0xBBAAc125DCE2B69d2a516C90559af1eD7B7d5EAf \
--emitter=0xC36442b4a4522E871399CD717aBDD847Ab11FE88 \
--topic 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef \
0x0000000000000000000000000000000000000000000000000000000000000000 \
0x000000000000000000000000BBAAc125DCE2B69d2a516C90559af1eD7B7d5EAf
The equivilant using just the RPC (see below) is MUCH faster.
here's the corresponding eth_getLogs request:
curl --request POST \
--url <ETH_MAINNET_RPC_URL> \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [
{
"address": [
"0xc36442b4a4522e871399cd717abdd847ab11fe88"
],
"fromBlock": "0x429d3b",
"toBlock": "latest",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000BBAAc125DCE2B69d2a516C90559af1eD7B7d5EAf"
]
}
]
}
'
Some timings:
| Description | Time |
|---|---|
| Into the cache with chifra export: | 4.72 seconds |
| Out of the cache with chifra export: | .313 seconds |
| Curl | 9.9 seconds (then on rerun: .868 seconds, .813, .843) |
Thanks for looking into this. Are these timings from a new release?
Current release. Yes.