Interface StateRootCommitter
public interface StateRootCommitter
Computes the state root when a block's world state is persisted.
Implementations may compute synchronously from accumulated updates or delegate to background computation (for example BAL).
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcancel()Cancel any background computation started by this committer (no-op by default).compute(MutableWorldState worldState, org.hyperledger.besu.plugin.data.BlockHeader blockHeader, org.hyperledger.besu.evm.worldstate.WorldUpdater worldUpdater) Compute the state root and any deferred storage writes for the current world state.default StateRootCommittertimed(org.hyperledger.besu.plugin.services.metrics.OperationTimer timer) Wraps this committer with timing instrumentation.
-
Method Details
-
compute
StateRootComputation compute(MutableWorldState worldState, org.hyperledger.besu.plugin.data.BlockHeader blockHeader, org.hyperledger.besu.evm.worldstate.WorldUpdater worldUpdater) Compute the state root and any deferred storage writes for the current world state.- Parameters:
worldState- the world state being persistedblockHeader- the block being persistedworldUpdater- the world state updater with accumulated changes- Returns:
- the computation result
-
cancel
default void cancel()Cancel any background computation started by this committer (no-op by default). -
timed
Wraps this committer with timing instrumentation.- Parameters:
timer- the timer used to measure execution time- Returns:
- a new committer that delegates to this instance while recording timing metrics
-