-
Notifications
You must be signed in to change notification settings - Fork 189
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
blockchain/vm: vmLog/feePayer/validateSender precompiled contract address mapping #912
Conversation
* assign CodeFormatEVM2 to the new contracts which will be deployed after istanbulCompatible change * keep old precompiled address when calling the contracts deployed before istanbulCompatible change
a7f8791
to
a396405
Compare
@yoomee1313 I don't understand why Istanbul Address is callable when deployment time is Before and call time is After. I think calling Istanbul Address of the contact may not be intended by the contract author. |
I never thought deeply about what I pointed out. Thank you. I checked how geth handled it, and the Istanbul address is callable when the contract is deployed before the istanbul change. Unfortunately, I couldn't find the reason or related documentation about this.
Since this is a new item address, it will not be the case that the author did not intend. |
49b0053
to
0258ade
Compare
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
22e0416
to
dec14d2
Compare
* refactor protocol_params.go * refactor StateDB.GetCodeInfo to StateDB.GetVmVersion to minimize the explosure of codeInfo
dec14d2
to
8fced91
Compare
@aidan-kwon CodeInfo part is refactored. Please take a look. |
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 except for minors
Co-authored-by: Donghwan Aidan Kwon <48199072+aidan-kwon@users.noreply.github.com>
Proposed changes
vmLog/feePayer/validateSender precompiled contracts' address will be changed after the istanbulCompatible change. You can see how the address changes by looking at the yellow highlights in the table below.
However, the vmLog/feePayer/validateSender calling functions that are already in use cannot be used after the change. By this PR, we can still use those functions by utilizing CodeFormat. It is used as an incompatible change version.
Originally, when a smart contract is released, CodeFormatEVM is assigned to that contract. By this PR, CodeFormatEVM2 is assigned to the new contracts which will be deployed after istanbulCompatible change.
The result below shows the success result of calling precompiled contract according to those conditions: node's incompatible change version (constantinople/istanbul), deployment time, and call time.
before
means a contract is deployed or called before the IstanbulCompatible change.after
means a contract is deployed or called after the IstanbulCompatible change.Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...