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

Optimize running event filter build time #2439

Open
sistemd opened this issue Dec 6, 2024 · 0 comments
Open

Optimize running event filter build time #2439

sistemd opened this issue Dec 6, 2024 · 0 comments
Assignees

Comments

@sistemd
Copy link
Contributor

sistemd commented Dec 6, 2024

During startup, it takes about 20 seconds on mainnet to rebuild the running event filter in the worst case. There's a way to improve this situation by storing the running event filter in the DB on shutdown, as part of our graceful shutdown process. On startup, we can load the running event filter from the DB and check if its block range is valid (i.e. does it span from the last stored aggregate bloom filter to the latest stored block). If it is, then we can use the loaded running event filter and we don't have to build it from scratch. The end result is that during normal operation there would be no additional startup costs, and only in the case of crashes or power outages does the running event filter have to be rebuilt from scratch.

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

No branches or pull requests

1 participant