go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

cmd: refactor evm tool

Open lightclient opened this issue 1 year ago • 0 comments

Had the idea for a while to refactor cmd/evm. It feels like a lot of it has grown organically to meet demands -> test running, test fill, eof validation, etc.

Unfortunately this had led to several subcommands with little relation beyond a general relationship to the EVM. This makes using the evm command confusing. Both evm run and evm t8n specify their own set of tracing flags (1, 2). Flags like --input are reused for different things between the test runners and disassemblers. eofparse adds --hex which is basically --input but for it's own purposes.

There isn't a coherent story for the set of tools. I think we should either spend a fair bit of work ensuring the flags are meaningful across all subcommands and avoid duplicate behavior, or some of the subcommands should live in their own package. My preference is the latter, because it more accurately represents today's maintenance: t8n is the highest prio and has many external contributions from the testing team. Enforcing and ensuring their changes make sense across evm will slow down everyone involved. The interface for t8n is the most robust and it makes sense for it to be it's own package. eofparse is much newer, but similarly seems like an unrelated project that can live on it's own. Which leaves us with the runner commands and the compilation tools. I opted to delete the compilation tools since they are used much any more and it was suggested we delete them last year.

In summary:

  • move t8n, t9n, and b11r to their own command cmd/t8ntool
  • delete evm compile and evm disasm
  • move evm eofparse to cmd/eofparse

If these changes make sense, I also want to do some work on cmd/evm to improve the interface for logging, running batches of tests, and validating tests against the stateless runner.

--

lightclient avatar Oct 19 '24 15:10 lightclient