py-evm
py-evm copied to clipboard
Create State without ExecutionContext
Extract ExecutionContext out as something that's adjacent to State instead of embedded in it. When you want to execute, you run it through the VM which combines state with the execution context generated with the header in order to actually build a computation.
This makes State as easy to initialize as AccountDB was.
I'm thinking something like:
- move
BaseState.execution_context->BaseVM.execution_context - move
BaseState.get_computation->BaseVM.get_computation(which builds with its local execution context) - rename
ExecutionContext->BlockContext - Computation learns about
BlockContext, like it knows aboutTransactionContext BaseStatenow only needs a db and state root to be generated
Note that there is some hacky code in eth.chains.base.Chain.from_genesis should be cleaned up when State is easier to initialize.
cc @lithp
Originally posted by @carver in https://github.com/ethereum/py-evm/pull/1755