-
Notifications
You must be signed in to change notification settings - Fork 20.9k
Optimize the trie prefetcher #31831
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
Comments
May I take on it? |
hello, Https://github.com/ethereum/go-ethereum/blob/master/core/state/statedb.go#L789 triggers the slow, and blocking wait here https://github.com/ethereum/go-ethereum/blob/master/core/state/trie_prefetcher.go#L322 ?? |
Got it, is the inner |
yes |
By revamping the block prefetcher, state retrieval has been significantly optimized.
However, the account trie and storage trie updates is occasional slow.
In Geth’s workflow, state is typically fetched from the flat-state, while dirty states,
such as accounts and storage slots modified during transaction execution, are
scheduled for prefetching from the trie. This is based on the assumption that these
trie nodes are likely to be updated at the end of block execution.
Once all transactions in the block have been processed, Geth flushes all dirty states
into the trie and re-computes the state root. At this point, Geth is blocked until all
pending trie prefetching tasks are completed and then reuse the trie from prefetcher
for state rehasing. Preliminary investigation shows that a significant portion of the
time spent on storage updates is actually due to waiting on the trie prefetcher,
which appears to be inefficient.
An additional observation is that storage modifications are highly uneven. Some
contracts may modify hundreds of storage slots within a single transaction, creating
huge workload imbalances for the trie prefetcher.
The text was updated successfully, but these errors were encountered: