Skip to content

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

Merged
qinglin89 merged 2 commits intobnb-chain:developfrom
qinglin89:fixupdatetrie
Jul 26, 2022
Merged

[R4R] rm duplicate update/delete on tire#1001
qinglin89 merged 2 commits intobnb-chain:developfrom
qinglin89:fixupdatetrie

Conversation

@qinglin89
Copy link
Copy Markdown
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.

var v []byte
if (value == common.Hash{}) {
s.setError(tr.TryDelete(key[:]))
s.db.StorageDeleted += 1
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

@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