Content pfp
Content
@
0 reply
0 recast
2 reactions

✳️ dcposch on daimo pfp
✳️ dcposch on daimo
@dcposch.eth
How do I know, via RPC, that I have all logs up thru block X? eth_getLogs and _getFilterLogs doesn’t seem to do this… give it a toBlock in future and it still returns (necessarily partial) results
1 reply
0 recast
2 reactions

Scott Sunarto pfp
Scott Sunarto
@scott
hmm.. would need to learn more about your node setup. i think alchemy/infura have # of logs limit and sometime would silently drop logs. if you are running your own node, i'd check for config that silently prune historical logs or limit # of logs on eth_getLogs
1 reply
0 recast
0 reaction

✳️ dcposch on daimo pfp
✳️ dcposch on daimo
@dcposch.eth
Not about pruning old logs, more about making sure you have the latest. I want to write a function that returns “here’s your current balance, and all new transfers that went into that balance” Seems like a common use case!
1 reply
2 recasts
1 reaction

Scott Sunarto pfp
Scott Sunarto
@scott
try passing "latest" to `toBlock` is this what you are looking for? fwiw, you probably want an indexer (checkout https://ponder.sh/) to do the heavy lifting here by sifting through all new incoming blocks. could also be fun to write your own!
1 reply
0 recast
0 reaction

✳️ dcposch on daimo pfp
✳️ dcposch on daimo
@dcposch.eth
Yes this is for my indexer The trouble is - Call eth_call with “latest” to get the current balance - Call eth_logs “latest” for logs No guarantee that they match! You might be missing a transfer needed to explain the balance.
3 replies
0 recast
0 reaction

jalil pfp
jalil
@jalil
i also keep running into issues where logs are missed, especially with new logs. my guess is that's from reorgs? only way that works for me is to do occasional resyncs and store everything in my own db to query from there.
1 reply
0 recast
0 reaction

Danny pfp
Danny
@ds
Some rpc providers limit you to 10k logs per call, unless fromBlock matches toBlock. You can fetch a range, but if that happens you need to go block by block. You will still need to reconcile reorgs, or artificially slow down processing to be N blocks behind the latest block.
0 reply
0 recast
1 reaction