Is the return from `getLogs` in order by blockNumber?

Or is it just no order and i need to sort the block numbers myself?

Hi @rob_rob, and welcome to the Infura community!
eth_getLogs should return in order by block number - please let us know if you’re seeing something different! One thing to keep in mind with this call is that the default fromBlock is “latest,” so if you’re getting an empty response, try specifying that fromBlock as “0x00” to make sure the block you’re looking for is included.

Thanks @Leiya_Kenney. I do believe ours are coming in order. We are attempting to setup a cron job that will fetch the logs for us at some given interval and be able to put together the history that we want contiguously. It generally works, but there are some events that invariably are missed. It’s not a large number, but it is quite a bit larger than 0. Still investigating. There are quite a few varibles here to process…

The events that we miss are always in blocks that we did grep. It really has the appearance that event logs may show up later for blocks we already looked at at some period in the past.

This is on rinkeby however, so I’m aware that this could also be some strange POA wierdness… Like I said, so many variables to wade thru…

This may be simply issues with pending. Gunna do some logging and see if that hypothesis holds. If so I’ll implement a re-grep for those pending somehow. If getLogs shows up in block order as we established, where are pending blocks? Are there, indeed, logs present for blocks that are pending? I should know soon. Any input helps tho…

Hey @rob_rob, that sounds good.
If you discover anything, please let us know and we can see what we can do on our end to help you out! The pending blocks can be found by using the eth_newPendingTransactionFilter - that will create a filter that listens for new pending transactions.