Cache empty slots#4874
Merged
Merged
Conversation
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
garyschulte
requested changes
Jan 6, 2023
garyschulte
left a comment
Contributor
There was a problem hiding this comment.
Looks good, minor feedback about isDirty()
…mpty. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
49e1a18 to
494e274
Compare
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>
siladu
pushed a commit
to jflo/besu
that referenced
this pull request
Feb 7, 2023
* Cache empty slots. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> * clear after each block and copy during clone Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * add changelog Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> * Avoid triggering a calculate root hash when empty slot cache is not empty. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Karim TAAM <karim.t2am@gmail.com> Signed-off-by: ahamlat <ameziane.hamlat@consensys.net> Co-authored-by: Karim TAAM <karim.t2am@gmail.com>
siladu
pushed a commit
to jflo/besu
that referenced
this pull request
Feb 7, 2023
* Cache empty slots. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> * clear after each block and copy during clone Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * add changelog Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> * Avoid triggering a calculate root hash when empty slot cache is not empty. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Karim TAAM <karim.t2am@gmail.com> Signed-off-by: ahamlat <ameziane.hamlat@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Karim TAAM <karim.t2am@gmail.com>
Merged
jflo
added a commit
that referenced
this pull request
Feb 8, 2023
* 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 <karim.t2am@gmail.com> Signed-off-by: garyschulte <garyschulte@gmail.com> Signed-off-by: Justin Florentine <justin+github@florentine.us> Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: ahamlat <ameziane.hamlat@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: matkt <karim.t2am@gmail.com> Co-authored-by: garyschulte <garyschulte@gmail.com> Co-authored-by: ahamlat <ameziane.hamlat@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
eum602
pushed a commit
to lacchain/besu
that referenced
this pull request
Nov 3, 2023
* Cache empty slots. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> * clear after each block and copy during clone Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * add changelog Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> * Avoid triggering a calculate root hash when empty slot cache is not empty. Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Karim TAAM <karim.t2am@gmail.com> Signed-off-by: ahamlat <ameziane.hamlat@consensys.net> Co-authored-by: Karim TAAM <karim.t2am@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Ameziane H ameziane.hamlat@consensys.net
Co-authored-by: Karim TAAM karim.t2am@gmail.com
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

Block Processing CPU profiling
SSTORE CPU Profiling

After this PR

Block Processing CPU profiling
SSTORE CPU Profiling

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-requiredlabel to this PR ifupdates are required.
Changelog