-
Notifications
You must be signed in to change notification settings - Fork 839
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
Trie log prune using TrieLogEvent #6394
Trie log prune using TrieLogEvent #6394
Conversation
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
|
Main change is to remove the unsafe prune of orphaned blocks Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@Override | ||
public void onTrieLogAdded(final TrieLogEvent event) { | ||
if (TrieLogEvent.Type.ADDED.equals(event.getType())) { | ||
final TrieLogAddedEvent addedEvent = (TrieLogAddedEvent) event; |
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.
This cast doesn't look necessary
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.
good spot, removed
plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogEvent.java
Outdated
Show resolved
Hide resolved
remarking as draft while adding in the async piece |
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@@ -50,11 +53,13 @@ public class TrieLogPruner { | |||
public TrieLogPruner( | |||
final BonsaiWorldStateKeyValueStorage rootWorldStateStorage, | |||
final Blockchain blockchain, | |||
final Consumer<Runnable> executeAsync, |
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.
Might have been more obvious to pass EthScheduler in here but that would mean making the core
module depend on the eth
module which is circular.
I do like the way this is decoupled from the EthScheduler implementation anyway, even if the type is a little unobvious.
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.
The Executor
would be clearer than using a Consumer<Runnable>
type
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.
As discussed, while it happens to be the same type, the implementation I'm using does not actually represent an Executor implementation (rather a delay execution of a submission to one 😅 )
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
PR description
This PR aims to make the pruning logic async as this feature does not need to be in the synchronous.
Fixed Issue(s)
Part of #5390
Testing
Tested locally on a small chain.
Tested with a fresh holesky sync...
TrieLogPruning happening on an EthSchedule-Services thread...
Post sync, besu (on holesky) is only maintaining a single EthScheduler-Services thread so thread contention is low (it's a cachedThreadPool).
Tasks per second during and after sync...