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.
This cast doesn't look necessary
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>
| public TrieLogPruner( | ||
| final BonsaiWorldStateKeyValueStorage rootWorldStateStorage, | ||
| final Blockchain blockchain, | ||
| final Consumer<Runnable> executeAsync, |
There was a problem hiding this comment.
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.
The Executor would be clearer than using a Consumer<Runnable> type
There was a problem hiding this comment.
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...