Description
With the work being done in #3543, we have refactored the StateManagerInterface
to make certain functions optional (getProof
) in State Managers that do not support them so we have a single unified StateManager interface for all implementations that maintains the core features necessary for interacting with Ethereum state (read/write accounts/storage). The current interface also has getStateRoot
/setStateRoot
/hasStateRoot
which really only apply to the DefaultStatemanager
and some hopefully future StatefulVerkleStateManager
implementations since you only need the state root when validating whole state transitions (i.e. blocks or maybe transactions). So, you only need access to a valid state root if you are interacting with the VM
class doing the full work of maintaining an Ethereum chain with a stateful client sort of interface.
There was a time when we dreamed of the RPCStateManager
being able to run blocks and validate state roots but there are inherent issues with the MPT that make this impossible if you don't already know the full state locally.
So, the question is, do we need to have these stateRoot getter/setter functions in the State Manager interface and explore how a statemanager which doesn't maintain the full Ethereum state on disk should expose a state Root so the vm
package can use some of the alternative implementation? The RPCStateManager
can already run blocks so it would seem not. Will need to research more to decide.