-
Notifications
You must be signed in to change notification settings - Fork 757
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
[VM] group opcodes based upon hardfork #798
Conversation
Codecov Report
@@ Coverage Diff @@
## master #798 +/- ##
==========================================
- Coverage 84.49% 84.32% -0.17%
==========================================
Files 19 20 +1
Lines 1245 1238 -7
Branches 246 247 +1
==========================================
- Hits 1052 1044 -8
Misses 125 125
- Partials 68 69 +1
Continue to review full report at Codecov.
|
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 @jochem-brouwer, this looks good!
For later reference: have used this (actually very nice) Ethereum HF history article to check on the correct opcode association (so: Byzantium & Homestead opcode attribution correct, no additional opcodes introduced post-Frontier).
@jochem-brouwer yes, think it makes a lot of sense to move all gas cost params over to Common, also like the suggestion to keep the fee
attribution in the opcodes.ts
file to prevent repeated calls to the Common
library.
Can you open an issue on that? Or - if no one intervenes here and you want to take on this - you might also just directly open a PR, think this is likely (?) relatively undisputed as a change suggestion.
Cool, this article was actually something I was looking for. Thanks @holgerd77 I will open an issue otherwise we/I will forget doing this RE: gas usages to Common. |
Late to the party but this is a good change! We can go one step further and remove the HF check from the opcode handlers in |
I like this, could you open a PR/issue @s1na? |
Closes #543
Some notes: I also have grouped pre-byzantium opcodes (homestead, that's
DELEGATECALL
), buthomestead
is not supported by the VM yet.I have included a very simple test which obviously does not test all cases.
Also per the issue: I think that any gas cost changes should either:
should be read every time from the opcode call from common (think about
SLOAD
,BALANCE
, etc.)if the call price is fixed (
SLOAD
for instance always charges the same amount of gas) then we should use thefee
attribute of the opcode and change this fee if the gas price changes (ideally reading this once from common)I tend to encourage us to use (2) since this does a single call to common for these constant-priced opcodes. (1) keeps calling common every time we use the opcode, though we know the hard fork of the VM is invariant and thus the gas cost is constant in these situations.
I think this gas stuff should be in a different issue?