-
-
Notifications
You must be signed in to change notification settings - Fork 814
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: use new push0 opcode #3361
Conversation
per shanghai fork
@@ -555,13 +556,10 @@ def _height_of(witharg): | |||
o = _compile_to_assembly(code.args[0], withargs, existing_labels, break_dest, height) | |||
o.extend( | |||
[ | |||
"PUSH1", | |||
MemoryPositions.FREE_VAR_SPACE, |
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.
Is this only 0 or 1?
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.
right now FREE_VAR_SPACE is 0, but since it could change, use the PUSH abstraction
@@ -23,7 +23,8 @@ def num_to_bytearray(x): | |||
|
|||
def PUSH(x): |
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.
wonder if this might be better named push_stack
or something clearer, I thought it was an opcode at first
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.
could be -- it is supposed to be an abstraction of the PUSH opcodes
this is waiting on upstream -- py-evm 0.7.0a1 was released with shanghai updates including PUSH0, but a new eth-tester has not been released which results in a dependency conflict when trying to install the new py-evm. |
looks like eth-tester updated on may 12, see https://pypi.org/project/eth-tester/#history |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #3361 +/- ##
==========================================
+ Coverage 89.09% 89.17% +0.08%
==========================================
Files 84 84
Lines 10763 10763
Branches 2452 2452
==========================================
+ Hits 9589 9598 +9
+ Misses 781 771 -10
- Partials 393 394 +1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
per shanghai fork
What I did
implement #3360
note: this looks like it shaves about 1-2% off bytecode for https://github.com/yearn/yearn-vaults-v3/blob/00f0778aa1202cc217174efb6fd50a65c75a3c76/contracts/VaultV3.vy and https://github.com/curvefi/curve-stablecoin/blob/a29fc2e1c395793d4d3966e10cf2431fa179bfe6/contracts/Stableswap.vy.
How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture