Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Sep 12, 2023

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.

}

func (ch createObjectChange) dirtied() *common.Address {
return ch.account
}

func (ch createObjectChange) copy() journalEntry {
return createObjectChange{
account: ch.account,
Copy link
Member

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?

@Subliminers
Copy link

Subliminers commented Sep 12, 2023 via email

@@ -154,13 +175,18 @@ type (

func (ch createObjectChange) revert(s *StateDB) {
delete(s.stateObjects, *ch.account)
delete(s.stateObjectsDirty, *ch.account)
Copy link
Member Author

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.

@rjl493456442
Copy link
Member Author

Replaced by #28666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants