-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(forge): account access cheatcode accounts for extcode* and balance opcodes #6545
Conversation
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 looks reasonable.
this mimics the existing opcode handling, tests look good.
pending @Evalir @DaniPopes
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.
Typically, the AccountAccessKinds indicate an EVM context switch. The Extcode*
opcodes breaks this expectation. What do you think about indicating them in the StorageAccess
struct? This way, all extcode*
accesses are grouped under the current context.
How would you modify StorageAccess to accommodate? Could add a new extcode enum to the end and rename it something like StorageOrExtcodeAccess, but imo that just makes the struct more confusing. |
You're right, that would be more confusing. I guess this is fine as-is then. With the |
Update to include balance opcode as well, since that marks the target account as warm. I think that's all of them, for real this time – any I might be missing? |
@Inphi thanks for the ping! This looks good to me, I don't think it will be any trouble for what I'm using it 👌 |
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
Motivation
vm.startStateDiffRecording
should track theBALANCE
andEXTCODE*
family of opcodes, since they affect account warmthCloses #6544
Solution
Adds 4 more values to the
AccountAccessKind
enum and watches for those 4 opcodes as part ofstep
.