-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
core/vm: clean up EVM environmental structure #31061
base: master
Are you sure you want to change the base?
Conversation
I will setup a full sync to ensure nothing is broken. As the changes touch very core part. |
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.
In general LGTM, a great idea and makes stuff a lot cleaner, there was just two things that I wanted to talk about before merging (not really related to this PR, just the code in general)
c.Code = code | ||
c.CodeHash = hash | ||
c.CodeAddr = addr |
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.
This was never used, right? weird...
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 know... At least it's not used now
27d3025
to
5893f07
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
For everyone else reviewing this, we slightly change the behavior with this.
Previously a contract created by CREATE2 would cache the jumpdest analysis for the initcode, while a contracted created by CREATE would not. Now both contracts will NOT cache the jumpdest analysis for initcode. Since it is very unlikely for two initcodes to be exactly the same, and in the case of an attack its very easy to circumvent this, its better not to bloat the memory with unusable jumpdest analyses
This PR does a few things including:
ContractRef
interfacevm.AccountRef
which implementsContractRef
interfacejumpDests
struct in EVM for sharing between call frames