getlogs
and internal timing polish
#902
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
we have a bug that returns false empty for the corner cases when:
1. was temporarily fixed by #828, but it has very poor performance.
2. was not fixed yet
To solve the whole issue completely, we need some bottom level refactor, instead of awkward patches like #828
core problem
We directly use node best block as eth best block, so we can query for this block before subql or cache is ready. In other words, latest block goes faster than latest state.
solution
We can redefine "latest block" as "latest cached block", so we can always get logs/receipts for the latest block.
For logs, we can't wait for subql to catch up, which takes 10+ seconds, instead we can make use of cache to query the blocks missed by subql
Change
fix #863
Test