-
Notifications
You must be signed in to change notification settings - Fork 790
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
explicitly duplicate bignumbers on stack #733
Conversation
Codecov Report
@@ Coverage Diff @@
## master #733 +/- ##
==========================================
+ Coverage 91.66% 91.71% +0.05%
==========================================
Files 46 46
Lines 2998 3006 +8
Branches 469 468 -1
==========================================
+ Hits 2748 2757 +9
Misses 151 151
+ Partials 99 98 -1
Continue to review full report at Codecov.
|
So what I did is create a minimal EVM code (I put a comment in the test): what it does is to ensure we run into a requirement of the gas stipend (2300 gas) if a nonzero Ether Before we make this call, we To show that this happens, the current value of the stack is |
If this impacts the performance a lot then it might also be possible to fix this in |
} | ||
}) | ||
|
||
|
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, that's great! 😄
Ah, yeah, I see what you mean ("a bit out of place"), lol 😜, but anyhow, doesn't hurt or blow things up either, at least would be my stance here on this.
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.
I don't really see how to make it much compacter either. For now, it seems like only this gas stipend thing messes up the stack as I don't see any other potentially stack-editing operations in opFns
via BN.js i*
arithmetic when glancing over the file.
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, LGTM!
Side note: compared for a very rough performance check (we really should do better here!) against CI run times of a recently submitted VM PR, nothing odd to discover on first sight. |
Yes, I don't think the performance will be impacted a lot by it: stack sizes are at most 32 bytes * 1024 per call frame, so allocating memory of that size should not take a lot of time. |
* explicitly duplicate bignumbers on stack * vm: add test to check for internally editing stack items Co-authored-by: Ev <ev@ethereum.org>
* explicitly duplicate bignumbers on stack * vm: add test to check for internally editing stack items Co-authored-by: Ev <ev@ethereum.org>
* explicitly duplicate bignumbers on stack * vm: add test to check for internally editing stack items Co-authored-by: Ev <ev@ethereum.org>
* explicitly duplicate bignumbers on stack * vm: add test to check for internally editing stack items Co-authored-by: Ev <ev@ethereum.org>
Solves #732