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

✳️ dcposch on daimo pfp
✳️ dcposch on daimo
@dcposch.eth
So what if you fetch the latest block first , then pass that block number explicitly to eth_call and _getLogs? As far as I can tell , eth_logs will return successfully and still not guarantee that it actually has all logs thru that block. Wack
3 replies
0 recast
1 reaction

Scott Sunarto pfp
Scott Sunarto
@scott
I would try using parity_subscribe. It's a more powerful version of eth_subscribe that basically allows you to subscribe to arbitrary eth_ rpc endpoint. so for your usecase, you can subscribe to both call and logs nethereum node supports them https://docs.nethereum.com/en/latest/nethereum-subscriptions-streaming/
1 reply
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