-
Notifications
You must be signed in to change notification settings - Fork 13
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
avoid BASIC_DATA branch edit for free in existent accounts #513
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,6 +397,9 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { | |
|
||
if msg.To != nil { | ||
st.evm.Accesses.TouchTxTarget(targetAddr.Bytes(), msg.Value.Sign() != 0) | ||
if !st.state.Exist(*targetAddr) { | ||
st.evm.Accesses.TouchCodeHash(targetAddr.Bytes(), true, nil, false) | ||
} | ||
Comment on lines
399
to
+402
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out that the logic I made yesterday reg CODEHASH being immutable (before 7702) was fine. But this free CODEHASH write we did before is also giving for free a BRANCH_EDIT unconditionally. This means that for existing addresses, the unconditional free write-event on CODEHASH made writes in BASIC_DATA cheaper (since CODEHASH got that for free, which attempted to be a simplification but is wrong). |
||
|
||
// ensure the code size ends up in the access witness | ||
st.evm.StateDB.GetCodeSize(*targetAddr) | ||
|
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.
Reverting this to the way it was pre-yesterday PR. (Still keeping the renaming since it was a useful change).