-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Labels
Description
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:
execution-spec-tests/src/ethereum_clis/transition_tool.py
Lines 210 to 235 in a15263e
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.
spencer-tb and marioevz