-
Notifications
You must be signed in to change notification settings - Fork 885
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
Cache empty slots #4874
Cache empty slots #4874
Conversation
Signed-off-by: Ameziane H <[email protected]>
Signed-off-by: Karim TAAM <[email protected]>
Signed-off-by: Ameziane H <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, minor feedback about isDirty()
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateUpdater.java
Outdated
Show resolved
Hide resolved
…mpty. Signed-off-by: Ameziane H <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
49e1a18
to
494e274
Compare
Signed-off-by: ahamlat <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
* Cache empty slots. Signed-off-by: Ameziane H <[email protected]> * clear after each block and copy during clone Signed-off-by: Karim TAAM <[email protected]> * add changelog Signed-off-by: Ameziane H <[email protected]> * Avoid triggering a calculate root hash when empty slot cache is not empty. Signed-off-by: Ameziane H <[email protected]> Signed-off-by: Ameziane H <[email protected]> Signed-off-by: Karim TAAM <[email protected]> Signed-off-by: ahamlat <[email protected]> Co-authored-by: Karim TAAM <[email protected]>
* Cache empty slots. Signed-off-by: Ameziane H <[email protected]> * clear after each block and copy during clone Signed-off-by: Karim TAAM <[email protected]> * add changelog Signed-off-by: Ameziane H <[email protected]> * Avoid triggering a calculate root hash when empty slot cache is not empty. Signed-off-by: Ameziane H <[email protected]> Signed-off-by: Ameziane H <[email protected]> Signed-off-by: Karim TAAM <[email protected]> Signed-off-by: ahamlat <[email protected]> Signed-off-by: Simon Dudley <[email protected]> Co-authored-by: Karim TAAM <[email protected]>
* Fix transaction pool issue (#4964) * Cache empty slots (#4874) * clear after each block and copy during clone * fix transaction pool issue * add block replay * support in-memory snapshots * Keep Worldstate Storage open for Bonsai archive latest layer (#5039) * bonsai layered worldstate subscription * unsubscribe from worldstatestorage on close of BonsaiLayeredWorldState * minor txpool logging improvements * Avoid triggering a calculate root hash when empty slot cache is not empty. * use the updater cache to get an account during block processing (#4897) * Worldstate-only resync behavior (#4875) * use debug rpc endpoint to resync worldstate * Reset transaction pool state every time the initial sync is done * init heal code --------- Signed-off-by: Karim TAAM <[email protected]> Signed-off-by: garyschulte <[email protected]> Signed-off-by: Justin Florentine <[email protected]> Signed-off-by: Ameziane H <[email protected]> Signed-off-by: ahamlat <[email protected]> Signed-off-by: Simon Dudley <[email protected]> Co-authored-by: matkt <[email protected]> Co-authored-by: garyschulte <[email protected]> Co-authored-by: ahamlat <[email protected]> Co-authored-by: Simon Dudley <[email protected]> Co-authored-by: Fabio Di Fabio <[email protected]>
* Cache empty slots. Signed-off-by: Ameziane H <[email protected]> * clear after each block and copy during clone Signed-off-by: Karim TAAM <[email protected]> * add changelog Signed-off-by: Ameziane H <[email protected]> * Avoid triggering a calculate root hash when empty slot cache is not empty. Signed-off-by: Ameziane H <[email protected]> Signed-off-by: Ameziane H <[email protected]> Signed-off-by: Karim TAAM <[email protected]> Signed-off-by: ahamlat <[email protected]> Co-authored-by: Karim TAAM <[email protected]>
Signed-off-by: Ameziane H [email protected]
Co-authored-by: Karim TAAM [email protected]
PR description
This will add a cache for empty slots. This would help to improve SLOAD and SSTORE performance. It would improve especially SSTORE during cost gas and refund amount calculation because some original and current values used during this calculation are empty.
CPU Profiling before and after this PR
Before this PR
![image](https://user-images.githubusercontent.com/5099602/210971638-a1cef57a-91b3-45e4-8306-8fd1ad426ce8.png)
Block Processing CPU profiling
SSTORE CPU Profiling
![image](https://user-images.githubusercontent.com/5099602/210973428-eb505a85-11db-4500-8bf6-c46d4935a332.png)
After this PR
![Screenshot 2023-01-06 at 10 20 15](https://user-images.githubusercontent.com/5099602/210971139-c4c6151a-b03f-4ab7-bb3c-87251f5bdbfc.png)
Block Processing CPU profiling
SSTORE CPU Profiling
![image](https://user-images.githubusercontent.com/5099602/210974334-eba33fe9-da1a-4cbd-8187-d0c9ca6300a9.png)
The results
As we can see in the screenshot below, there is an improvement on block processing time on 50th percentile (mean) and 95th percentile.
Fixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog