-
Notifications
You must be signed in to change notification settings - Fork 396
Description
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
execution-specs/packages/testing/src/execution_testing/client_clis/clis/execution_specs.py
Line 118 in d1e7e6b
| 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.