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

feat: check snapshot range on ProviderFactory #6608

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Feb 14, 2024

  • Execute the snapshot check before actually creating the DatabaseProvider.
  • BlockchainProvider should call ProviderFactory methods in instances where it can. Example: self.database.provider()?.header_td_by_number(number) -> self.database.header_td_by_number(number).
  • Removes some duplicate methods from a previous PR.

Improvements apply to methods that might skip opening a Database transaction if all the necessary data is available to query the static file data.

Holesky with maxperf

cryo blocks --blocks 0:900k --csv 
main -> 24s # 3e33ed20f5eaf18692f3e82a695a540e0ff598d7547c8135819f4be9e032c6f3
branch  -> 13s # 3e33ed20f5eaf18692f3e82a695a540e0ff598d7547c8135819f4be9e032c6f3
cryo txs --blocks 0:900k --csv
main  -> 132s # 1119bc690bdadbe65de11246eb2bfd2424d902ba9ad7ce47a027c9a696d4737e
branch  -> 120s # 1119bc690bdadbe65de11246eb2bfd2424d902ba9ad7ce47a027c9a696d4737e
cryo logs --blocks 0:900k --csv
main  -> 509s # 47079da470b7f8d6d946dbbbcd65a7d1032e7437aab094dd11d81d88971165c9
branch  -> 87s # 47079da470b7f8d6d946dbbbcd65a7d1032e7437aab094dd11d81d88971165c9

For equality tests, I run b3sum over the resulting csv and compare

I feel like cryo still has some big overhead on writing/handling the incoming data, but this seems like a clear improvement. Also, on cryo blocks the flamegraph hits on rpc_block went from 19k (feat/static-files) to 500 (this branch)

@joshieDo joshieDo added the A-static-files Related to static files label Feb 14, 2024
@shekhirin shekhirin changed the title feat: check snapshot range onProviderFactory feat: check snapshot range on ProviderFactory Feb 14, 2024
@joshieDo joshieDo marked this pull request as ready for review February 14, 2024 14:20
@joshieDo joshieDo merged commit dfb8c61 into feat/static-files Feb 15, 2024
23 of 25 checks passed
@joshieDo joshieDo deleted the joshie/factory-snapshot-check branch February 15, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-static-files Related to static files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants