Skip to content

benchmark: add 0-param opcodes coverage#1698

Merged
jsign merged 15 commits into
mainfrom
jsign-0-param-opcodes
Jun 2, 2025
Merged

benchmark: add 0-param opcodes coverage#1698
jsign merged 15 commits into
mainfrom
jsign-0-param-opcodes

Conversation

@jsign

@jsign jsign commented Jun 2, 2025

Copy link
Copy Markdown
Collaborator

This PR adds coverage for many 0-param opcodes.

Cycles:

tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_GAS]-1      927313344
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_TIMESTAMP]-1        945280386
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_GASLIMIT]-1 945298712
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_NUMBER]-1   945298968
tests/zkevm/test_worst_compute.py::test_worst_callvalue[fork_Cancun-blockchain_test_from_state_test-from_origin_False-non_zero_value_True]-1    983444990
tests/zkevm/test_worst_compute.py::test_worst_callvalue[fork_Cancun-blockchain_test_from_state_test-from_origin_False-non_zero_value_False]-1   983643412
tests/zkevm/test_worst_compute.py::test_worst_returndatasize[fork_Cancun-blockchain_test_from_state_test-return_data_style_ReturnDataStyle.IDENTITY-non_zero_size_True]-1      999200881
tests/zkevm/test_worst_compute.py::test_worst_returndatasize[fork_Cancun-blockchain_test_from_state_test-return_data_style_ReturnDataStyle.REVERT-non_zero_size_False]-1       999224296
tests/zkevm/test_worst_compute.py::test_worst_returndatasize[fork_Cancun-blockchain_test_from_state_test-return_data_style_ReturnDataStyle.RETURN-non_zero_size_False]-1       999224436
tests/zkevm/test_worst_compute.py::test_worst_returndatasize[fork_Cancun-blockchain_test_from_state_test-return_data_style_ReturnDataStyle.IDENTITY-non_zero_size_False]-1     999243170
tests/zkevm/test_worst_compute.py::test_worst_returndatasize[fork_Cancun-blockchain_test_from_state_test-return_data_style_ReturnDataStyle.REVERT-non_zero_size_True]-1        999255038
tests/zkevm/test_worst_compute.py::test_worst_returndatasize[fork_Cancun-blockchain_test_from_state_test-return_data_style_ReturnDataStyle.RETURN-non_zero_size_True]-1        999255252
tests/zkevm/test_worst_compute.py::test_worst_callvalue[fork_Cancun-blockchain_test_from_state_test-from_origin_True-non_zero_value_False]-1    999255426
tests/zkevm/test_worst_compute.py::test_worst_callvalue[fork_Cancun-blockchain_test_from_state_test-from_origin_True-non_zero_value_True]-1     999255815
tests/zkevm/test_worst_compute.py::test_worst_msize[fork_Cancun-blockchain_test_from_state_test-mem_size_1000000]-1     1003494103
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_BASEFEE]-1  1008247999
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_CHAINID]-1  1008248041
tests/zkevm/test_worst_compute.py::test_worst_calldatasize[fork_Cancun-blockchain_test_from_state_test-calldata_length_10000]-1 1016269218
tests/zkevm/test_worst_compute.py::test_worst_calldatasize[fork_Cancun-blockchain_test_from_state_test-calldata_length_1000]-1  1017146773
tests/zkevm/test_worst_compute.py::test_worst_calldatasize[fork_Cancun-blockchain_test_from_state_test-calldata_length_0]-1     1017240664
tests/zkevm/test_worst_compute.py::test_worst_msize[fork_Cancun-blockchain_test_from_state_test-mem_size_100000]-1      1061373497
tests/zkevm/test_worst_compute.py::test_worst_msize[fork_Cancun-blockchain_test_from_state_test-mem_size_0]-1   1062172501
tests/zkevm/test_worst_compute.py::test_worst_msize[fork_Cancun-blockchain_test_from_state_test-mem_size_1]-1   1062172990
tests/zkevm/test_worst_compute.py::test_worst_msize[fork_Cancun-blockchain_test_from_state_test-mem_size_1000]-1        1062191325
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_GASPRICE]-1 1098175506
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_CODESIZE]-1 1125153539
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_BLOBBASEFEE]-1      1161106202
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_ADDRESS]-1  1394917237
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_COINBASE]-1 1394917330
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_ORIGIN]-1   1394917381
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_CALLER]-1   1394935861
tests/zkevm/test_worst_compute.py::test_worst_zero_param[fork_Cancun-blockchain_test_from_state_test-opcode_PREVRANDAO]-1       1898529166

Close #1651

jsign added 5 commits May 30, 2025 16:46
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
jsign added 2 commits June 2, 2025 11:15
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign

jsign commented Jun 2, 2025

Copy link
Copy Markdown
Collaborator Author

@jochem-brouwer, ready if you want to take a look! :)

@jsign jsign added type:test Type: Add/refactor fw unit tests; no fw or el client test case changes type:feat type: Feature feature:zkevm labels Jun 2, 2025
@jsign jsign requested a review from jochem-brouwer June 2, 2025 14:56
@jsign jsign marked this pull request as ready for review June 2, 2025 14:56

@jochem-brouwer jochem-brouwer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some points, mainly about style, and I think some opcodes are missing (but might be handled by other tests I am not aware of)

Comment thread tests/zkevm/test_worst_compute.py Outdated
Comment thread tests/zkevm/test_worst_compute.py
Comment thread tests/zkevm/test_worst_compute.py Outdated
Comment thread tests/zkevm/test_worst_compute.py
Comment thread tests/zkevm/test_worst_compute.py Outdated
Comment thread tests/zkevm/test_worst_compute.py
jsign and others added 4 commits June 2, 2025 13:03
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign jsign requested a review from jochem-brouwer June 2, 2025 19:22
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign jsign force-pushed the jsign-0-param-opcodes branch from 1d0afcb to e449eff Compare June 2, 2025 19:30

@jochem-brouwer jochem-brouwer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments 😄 Will leave the "move repeated code to helper methods" for indeed a later "big refactor/cleanup" 😄 👍

Comment thread tests/zkevm/test_worst_compute.py Outdated
Comment thread tests/zkevm/test_worst_compute.py Outdated
Comment thread tests/zkevm/test_worst_compute.py Outdated
Comment thread tests/zkevm/test_worst_compute.py Outdated
jsign and others added 2 commits June 2, 2025 17:24
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign jsign requested a review from jochem-brouwer June 2, 2025 20:45
Comment thread tests/zkevm/test_worst_compute.py
Comment thread tests/zkevm/test_worst_compute.py Outdated

@jochem-brouwer jochem-brouwer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two small comments, feel free to address, but will also approve here. LGTM.

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign

jsign commented Jun 2, 2025

Copy link
Copy Markdown
Collaborator Author

I have two small comments, feel free to address, but will also approve here. LGTM.

Thank you! Were addressed. I'll wait for the CI to be green again and merge.

@jsign jsign merged commit 031fb2f into main Jun 2, 2025
26 checks passed
@jsign jsign deleted the jsign-0-param-opcodes branch June 2, 2025 23:57
@spencer-tb spencer-tb changed the title zkevm: add 0-param opcodes coverage benchmark: add 0-param opcodes coverage Jul 1, 2025
kclowes pushed a commit to kclowes/execution-spec-tests that referenced this pull request Oct 20, 2025
* zkevm: add generic zero-param opcodes

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* zkevm: add CALLVALUE coverage

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* add comment

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* zkevm: add RETURNDATASIZE coverage

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* zkevm: add MSIZE coverage & fixes

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* fixes

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* change params

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* Update tests/zkevm/test_worst_compute.py

Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>

* feedback

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* add comment

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* generalize returndata test

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* fix

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* Update tests/zkevm/test_worst_compute.py

Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>

* separate RETURNDATASIZE tests

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* nit

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

---------

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature:benchmark type:feat type: Feature type:test Type: Add/refactor fw unit tests; no fw or el client test case changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Blockchain tests that contain 0-parameter set opcodes that consume the whole block

3 participants