-
Notifications
You must be signed in to change notification settings - Fork 62
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
add log deepcopy #449
add log deepcopy #449
Conversation
Could you describe the purpose of this PR? |
This is from an auditing ticket. The statedb.go Copy was copying references for self.logs which is []*type.Log. The DeepCopy will create new instance of Log objects so now the copy is independent from the original. |
core/types/log.go
Outdated
copy(l.Topics, src.Topics) | ||
l.Data = make([]byte, len(src.Data)) | ||
copy(l.Data, src.Data) | ||
} |
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 function DeepCopy
can be eliminated as last comment.
Our current file |
There are too many commits. Please rebase on the latest dev-upgrade branch, then push -f to your branch. |
implement "deep copy" as go-ethereum
I'm still working on it, please be patient. |
Good point! Let me do it in a separate PR. Let's make this PR's scope only about the auditing topic. |
Proposed changes
The statedb.go Copy was copying references for self.logs which is []*type.Log. The DeepCopy will create new instance of Log objects so now the copy is independent from the original.
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅
in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅
in the boxes that applyStateDB
Checklist
Put an
✅
in the boxes once you have confirmed below actions (or provide reasons on not doing so) that