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 Type
    Method
    Description
    default void
    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.
    timed(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 persisted
      blockHeader - the block being persisted
      worldUpdater - 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

      default StateRootCommitter timed(org.hyperledger.besu.plugin.services.metrics.OperationTimer timer)
      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