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

Use Latest state provider if possible in block_state_provider #13848

Open
Rjected opened this issue Jan 17, 2025 · 3 comments
Open

Use Latest state provider if possible in block_state_provider #13848

Rjected opened this issue Jan 17, 2025 · 3 comments
Labels
A-db Related to the database A-execution Related to the Execution and EVM C-perf A change motivated by improving speed, memory usage or disk footprint

Comments

@Rjected
Copy link
Member

Rjected commented Jan 17, 2025

Currently block_state_provider does the following, constructing a historical state provider based on the anchor hash:

This means, that if there is an overlap of in-memory blocks and the DB, even if we could use the latest state provider for state, a historical state provider may be constructed.

This leads to some redundant I/O, a 25-35% hit on all storage reads whenever we've constructed a historical state provider. Specifically this is redundant history_info calls, that always hit the InPlainState | MaybeInPlainState branch.
Image
Image
Image

We could instead:

  • open a DB TX
  • determine if the BlockState is a direct extension of the DB state
  • If so, use the latest state provider
@Rjected Rjected added A-db Related to the database A-execution Related to the Execution and EVM C-perf A change motivated by improving speed, memory usage or disk footprint labels Jan 17, 2025
@Rjected Rjected changed the title Use Latest state provider if possible in ` Use Latest state provider if possible in block_state_provider Jan 17, 2025
@nadtech-hub
Copy link
Contributor

I would like to make it

@Rjected
Copy link
Member Author

Rjected commented Jan 18, 2025

I would like to make it

@nadtech-hub please let me know how you plan on approaching this problem, and feel free to submit a PR!

@nadtech-hub
Copy link
Contributor

@Rjected
I am reviewing code and making up the plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database A-execution Related to the Execution and EVM C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
Status: Todo
Development

No branches or pull requests

2 participants