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

[R4R] rm duplicate update/delete on tire #1001

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

qinglin89
Copy link
Contributor

Description

trie.update/trie.delete had been done twice which is redundant
Lock could just be used to protect concurrent access on statedb.snapStorage, not the storage itself.

Rationale

N/A

Example

N/A

Changes

Notable changes:

  • remove redundant code.
  • Unlock earlier.

@@ -412,12 +412,10 @@ func (s *StateObject) updateTrie(db Database) Trie {
s.originStorage[key] = value
var v []byte
if (value == common.Hash{}) {
s.setError(tr.TryDelete(key[:]))
s.db.StorageDeleted += 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StorageDeleted & StorageUpdated were added for storage metrics, but seems no longer used and can be deleted?

Copy link
Contributor

@flywukong flywukong Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate update/delete should cause by error merge action since it has already removed by this pr
https://github.com/bnb-chain/bsc/pull/924/commits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems that some commit might not merged well.

brilliant-lx
brilliant-lx previously approved these changes Jul 19, 2022
Copy link
Collaborator

@brilliant-lx brilliant-lx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

unclezoro
unclezoro previously approved these changes Jul 19, 2022
@qinglin89 qinglin89 changed the base branch from develop_July_200M to develop July 20, 2022 03:40
@qinglin89 qinglin89 dismissed stale reviews from unclezoro and brilliant-lx July 20, 2022 03:40

The base branch was changed.

flywukong
flywukong previously approved these changes Jul 20, 2022
brilliant-lx
brilliant-lx previously approved these changes Jul 20, 2022
Copy link
Collaborator

@brilliant-lx brilliant-lx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

unclezoro
unclezoro previously approved these changes Jul 20, 2022
flywukong
flywukong previously approved these changes Jul 20, 2022
Copy link
Collaborator

@brilliant-lx brilliant-lx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qinglin89 qinglin89 merged commit 71f0caa into bnb-chain:develop Jul 26, 2022
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.

5 participants