'removed' could be true in the response of eth_getLogs?

When using eth_getLogs to get logs of minted blocks, could ‘removed’ field of the returned logs be true?

hi @jason.kim, I might not be completely following your question. That is a field is true when the log was removed, due to a chain reorganization, false if it’s a valid log. Is that missing completely in your output ?

When using eth_getLogs to get logs of a block, this block should be a valid block at that time even if it will be replaced because of a chain reorganization. So I think ‘removed’ should be false in the response of eth_getLogs.

I am trying to use eth_getLogs to get logs and persist them to database block by block. I saw the ‘removed’ field and am thinking about whether I need to handle it.

Another thing that I am not sure is that whether the logs returned by eth_getLogs are final, will they change in future due to a chain reorganization?

So I think ‘removed’ should be false in the response of eth_getLogs.

Not necessary, think about that you’re querying an old block that has logs that were moved because of a reorg, removed = true will specifically tell you to take care of that.

Another thing that I am not sure is that whether the logs returned by eth_getLogs are final, will they change in future due to a chain reorganization?

There is always inconsistency around the chain head but if you take the data a few blocks deeper you’ll probably avoid seeing reorgs. In ethereum -10 blocks should be safe to assume that there won’t be any reorgs but with other chains you might need to go deeper.

These are good discussions about this topic:

Thank you very much.