Skip to content

chore(fill): decide on an "opcode count" t8n interface #1852

@danceratopz

Description

@danceratopz

Motivation: To sanity check tests are executing as intended, in particular benchmark tests. More background here:

One way to verify correct test execution would be to verify in the test framework that the intended opcode count was indeed triggered in the EVM. evmone already has an internal "histogram" feature that does exactly this; we need only enable the interface on the t8n tool.

Here's a proposal for that interface:

Flag, Output and Behavior

--opcode.freq=freq.json

Existing flags can be found here:

args = [
str(self.binary),
"--state.fork",
t8n_data.fork_name,
"--input.alloc",
input_paths["alloc"],
"--input.env",
input_paths["env"],
"--input.txs",
input_paths["txs"],
"--output.basedir",
temp_dir.name,
"--output.result",
output_paths["result"],
"--output.alloc",
output_paths["alloc"],
"--output.body",
output_paths["body"],
"--state.reward",
str(t8n_data.reward),
"--state.chainid",
str(t8n_data.chain_id),
]
if self.trace:
args.append("--trace")

Contents of freq.json

{
  "MSTORE": 1,
  "PUSH1": 4,
  "RETURN": 1
}

If an opcode is omitted, its frequency is zero.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions