-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
params, core/vm: Istanbul EIP-1108 gas costs implementation #19904
params, core/vm: Istanbul EIP-1108 gas costs implementation #19904
Conversation
Although I think there's fairly little overlap. |
Ah! Thanks for pointing that out, I must have missed it when I rummaged to see if there was anything fork-related for Istanbul (maybe because it was at a higher level). I'll spend some cycles looking at it as well and see how it might affect my approach here. |
In my PR, what I've done for those cases that change value over time, is the opposite of what you did in this PR.
So instead of having |
Mmm, fair. I took this approach because it seemed like it would be easier over the long term to understand what the “current” value was... But of course the value doesn’t become current until the hardfork. I’ll make that change, thanks! |
Ok, I have a rebased version here that swaps to the |
Please rebase |
c57c836
to
ea7b4df
Compare
IstanbulBlock, used to determine if the config IsIstanbul, is currently left nil until an actual block is chosen.
Old gas costs for elliptic curve operations are given the PreIstanbul prefix, while current gas costs retain the unprefixed names. The actual precompile implementations are the same, so they are factored out into common functions that are called by the pre-Istanbul and current precompile structs. Finally, an Istanbul precompile list is added that references the new precompile structs, which in turn reference the new gas costs.
ea7b4df
to
8dca6f1
Compare
Ok, rebased. Had a few tripups with conflicts, sorry. Let me know what you think! |
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've pushed a tiny commit on top to move the declared fork field in the chain config to it's correct chronological position. I also reordered the bn256 precompile cost constants to follow Martin's previous scheme (it it easier to understand the changes if they are enumerated one after the other vs. in fork batches).
Thank you very much for the PR, clean and elegant. LGTM
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.
LGTM
Thanks y’all, and thanks for the tweaks @karalabe... Definitely got my fork ordering mixed up 🤦♂️ |
This PR implements the gas cost adjustments in EIP-1108. Commit messages outline how this is done; currently the Istanbul block is
nil
in all cases, and precompiles are not hooked up to the tracerisPrecompiled
check. It's not immediately clear where Istanbul should be switched to “on” before the relevant block, basically, so this PR adds the plumbing and switching on it, but doesn't activate it anywhere.Opening this a touch early as to see whether this direction makes sense (it is based it on feedback from last year's #17644 from @ngrinkevich), or if there's a different approach worth pursuing.