-
Notifications
You must be signed in to change notification settings - Fork 19
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: add trie prefetch when executing blocks #56
Conversation
Have you guys benchmarked this work yet? Pretty exciting and stuff we've talked about before, keen to see how well it does as state root is by far the bottleneck... |
Thank you for being so interested. We are currently conducting performance tests and will soon release the relevant data publicly. |
Description
This pull request enhances merkleization efficiency by prefetching trie nodes from the database during execution.
Rationale
This pull request can enhance merkleization efficiency by approximately 56% for the BSC network.
Example
We separately tracked the time taken for inserting blocks, executing blocks, and calculating the state root during live sync. We will compare these metrics to gain insights into their performance.
BSC Test Result - Live sync 14K blocks, from 41550000 to 41564139.
Scatter Plot for Execution Time
Scatter Plot for State Root Calculation Time
Scatter Plot for Total Time
The Prefetch feature boosts state root calculation efficiency during BSC live sync without compromising block execution efficiency. This leads to a 56% decrease in state root calculation time and a 29% reduction in total block insertion time.
opBNB Test Result - Live sync 14K blocks, from 33180000 to 33194139.
Scatter Plot for Execution Time
Scatter Plot for State Root Calculation Time
Scatter Plot for Total Time
In the case of opBNB, the execution time, state root calculation time, and total time for block insertion are all relatively small. Prefetching optimization doesn't show clear benefits for opBNB. This could be due to the small world state tree of opBNB. When opBNB runs on a machine with 128GB of memory, most trie nodes are already in memory, making prefetch optimization ineffective.
Changes
Notable changes:
Potential Impacts