Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get logs from cache #985

Merged
merged 4 commits into from
Apr 19, 2024
Merged

get logs from cache #985

merged 4 commits into from
Apr 19, 2024

Conversation

shunjizhan
Copy link
Collaborator

@shunjizhan shunjizhan commented Apr 16, 2024

Context

Currently when no subql is presented, we can't get logs at all.

However, for most local testing scenarios, such as chopsticks acala fork testnet, it's deployed as a "light stack" without subql. In these cases we usually focus on recent txs/logs/blocks, and don't need to fetch very old data. So It would be nice if we can get (recent) logs without subql

Change

If no subql, check if the cache contains all required blocks:

  • if so fetch logs from the cache
  • else throw error (should throw explicit error instead of returning false empty)

Now we can start eth rpc with big cache size to simulate a fully functional stack to test more conveniently

fix #901

Test

Added tests to make sure it can still getlogs without subql

@shunjizhan shunjizhan requested review from zjb0807 and xlc April 19, 2024 07:48
@shunjizhan shunjizhan marked this pull request as ready for review April 19, 2024 07:48
@shunjizhan shunjizhan merged commit 87b6ca6 into master Apr 19, 2024
11 checks passed
@shunjizhan shunjizhan deleted the getlogs-from-cache branch April 19, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getlogs without subql
2 participants