Problem
Currently, the T8N class takes options, out_file and in_file as instantiation parameters, which makes it difficult for the ExecutionSpecsTransitionTool class create an instance without constructing the parameters of the command-line, which in the end adds no benefit and limits our possibilities for integration between both parts of the repository.
Proposed Solutions
- Create T8N.from_cli class method and refactor __init__
The __init__ method of T8N should take concrete arguments, such as the alloc, env and txs in the correct types that T8N will end up using, along with arguments for each option like state_fork, state_chainid, trace, trace_memory, etc. Perhaps even fork could be a required argument for instantiation.
Then T8N.from_cli should be a class method which takes the options: Any, out_file: TextIO, in_file: TextIO and properly formats it before instantiation.
- Remove t8n as argument for instantiation for Alloc, Env and Txs in src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py
This dependency makes it really hard for ExecutionSpecsTransitionTool to prepare the arguments to instantiate T8N, and it kinda feels like a redundant dependency.
We should strip out this dependency and only require concrete arguments for each class type (e.g. request the fork directly instead of fishing it out using t8n.fork).
- Refactor T8N instantiation in ExecutionSpecsTransitionTool
At the end, this line
|
t8n = T8N(t8n_options, out_stream, in_stream, self.fork_cache) |
should pass alloc, env, txs, state_fork, state_chainid, trace, trace_memory, etc, directly.
Problem
Currently, the
T8Nclass takesoptions,out_fileandin_fileas instantiation parameters, which makes it difficult for theExecutionSpecsTransitionToolclass create an instance without constructing the parameters of the command-line, which in the end adds no benefit and limits our possibilities for integration between both parts of the repository.Proposed Solutions
- Create
T8N.from_cliclass method and refactor__init__The
__init__method ofT8Nshould take concrete arguments, such as thealloc,envandtxsin the correct types that T8N will end up using, along with arguments for each option likestate_fork,state_chainid,trace,trace_memory, etc. Perhaps evenforkcould be a required argument for instantiation.Then
T8N.from_clishould be a class method which takes theoptions: Any, out_file: TextIO, in_file: TextIOand properly formats it before instantiation.- Remove
t8nas argument for instantiation forAlloc,EnvandTxsinsrc/ethereum_spec_tools/evm_tools/t8n/t8n_types.pyThis dependency makes it really hard for
ExecutionSpecsTransitionToolto prepare the arguments to instantiateT8N, and it kinda feels like a redundant dependency.We should strip out this dependency and only require concrete arguments for each class type (e.g. request the
forkdirectly instead of fishing it out usingt8n.fork).- Refactor T8N instantiation in
ExecutionSpecsTransitionToolAt the end, this line
execution-specs/packages/testing/src/execution_testing/client_clis/clis/execution_specs.py
Line 118 in d1e7e6b
should pass
alloc,env,txs,state_fork,state_chainid,trace,trace_memory, etc, directly.