-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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/state: fix statedb.Copy #28094
core/state: fix statedb.Copy #28094
Conversation
} | ||
|
||
func (ch createObjectChange) dirtied() *common.Address { | ||
return ch.account | ||
} | ||
|
||
func (ch createObjectChange) copy() journalEntry { | ||
return createObjectChange{ | ||
account: ch.account, |
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.
You*re copying the pointer here, right?
Please remove me from your mailing list.
…On Tue, Sep 12, 2023, 12:04 AM Marius van der Wijden < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In core/state/journal.go
<#28094 (comment)>
:
> }
func (ch createObjectChange) dirtied() *common.Address {
return ch.account
}
+func (ch createObjectChange) copy() journalEntry {
+ return createObjectChange{
+ account: ch.account,
You*re copying the pointer here, right?
—
Reply to this email directly, view it on GitHub
<#28094 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVDM3FBENGTBNEOORD7F4LTX2ACRPANCNFSM6AAAAAA4UGVHXE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@@ -154,13 +175,18 @@ type ( | |||
|
|||
func (ch createObjectChange) revert(s *StateDB) { | |||
delete(s.stateObjects, *ch.account) | |||
delete(s.stateObjectsDirty, *ch.account) |
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.
It's totally wrong to modify the Dirty map, which is the marker for state commit and is only modified at the transaction boundary. An internal state revert should never touch it.
bd55fb5
to
1ca8f85
Compare
Replaced by #28666 |
Note, this PR is very sensitive by touching very core part, and it's not a big/practical issue, open it here for getting general feedbacks. It's not urge to merge it.