-
Notifications
You must be signed in to change notification settings - Fork 414
feat(benchmarks): fix bytecode attack for CALL-like opcodes to work in Osaka #1850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(benchmarks): fix bytecode attack for CALL-like opcodes to work in Osaka #1850
Conversation
b757b8e to
3aa28b0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #1850 +/- ##
===================================================
+ Coverage 82.61% 86.26% +3.64%
===================================================
Files 417 538 +121
Lines 26862 34557 +7695
Branches 2492 3222 +730
===================================================
+ Hits 22193 29809 +7616
+ Misses 4230 4161 -69
- Partials 439 587 +148
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
LouisTsai-Csie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge thanks to the refactor! Leave some comments now but i will add more as i see some failure in execute remote scenario!
3e89a9d to
92bd095
Compare
|
@LouisTsai-Csie, addressed all the review comments. I think you wanted to do some remote tests, so LMK if there is any other blocker. |
LouisTsai-Csie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please help update the base branch to forks/amsterdam and update the blockchain_test fixture to benchmark_test. Also, please check this comment, thanks!!
92bd095 to
416f4d2
Compare
@LouisTsai-Csie, rebased for Reg the |
jochem-brouwer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, looks very good 😄 👍
9325df3 to
ef5b5ea
Compare
3d2eede to
9e161b6
Compare
…or contract deployment
…t transactions with proper offseting to avoid overlap
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
ef5b5ea to
0c73b7b
Compare
|
Rebased again on top of the forced pushed base. |
|
Working good for 100M but failing for our 5M CI check. Not sure what's the best way going forward now. _ test_xcall[fork_Prague-benchmark-gas-value_1M-blockchain_test_engine_x-opcode_CALLCODE] _
[gw4] linux -- Python 3.11.14 /opt/actions-runner/_work/execution-specs/execution-specs/.tox/benchmark/bin/python3
tests/benchmark/compute/instruction/test_system.py:102: in test_xcall
setup_txs = math.ceil(num_contracts / num_contracts_per_tx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E ZeroDivisionError: division by zero |
|
@LouisTsai-Csie, yeah, this is tricky. For Prague they fail, since the But for Osaka, both 1M and 5M fill fine because I think the way I think my conclusion here is (and pushed a commit with this), is if |
LouisTsai-Csie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your explanation and the final fix! LGTM
🗒️ Description
This PR fixes the
test_xcallbenchmarks to work with Osaka.test_xcallhas a CALL-like variant of the bytecode attack exploiting unchunkified code, highly relevant for zkVM worst-cases.I think the solution should feel quite natural — I’ll add some review comments.
I checked this is doing what we want with two independent checks:
For 1. and
--block-gas-limit 30M, my Geth reports accessing ~260MiB of bytecodes were the upper limit is ~280MiB (30M/2600 — but this isn’t accounting for glue opcodes, intrinsic costs of splitting in txs, etc). So this looks fine.For 2. and
--block-gas-limit 30M, I also confirmed it really blows up the guest program witness, which is prob the best ultimate confirmation this is doing what we wanted. i.e: the json-encoded files have ~524MiB size which makes sense since bytes are hex encoded (with other things).🔗 Related Issues or PRs
#1695
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.