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

performance: commitTire concurrently during Commit #1948

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

brilliant-lx
Copy link
Collaborator

@brilliant-lx brilliant-lx commented Oct 26, 2023

Description

In StateDB::Commit(), run commmitTrie() concurrently to improve the performance.
Previous commitTrie was changed to be run serially for --pipecommit, but actually, it is ok to run it concurrently.

Rationale

It was broken after v1.3.0 due to a object concurrent access safety, to reenable it

Implementation

the safety was about: StateDB.storages

type StateDB struct {
  ...
  storages       map[common.Hash]map[common.Hash][]byte 
  ...
}

it is used to store the modified KV pair for each address on updateTrie which is called during block validation phase, the key is with Keccak hashed.

@brilliant-lx brilliant-lx changed the title performance: commitTire concurrently performance: commitTire concurrently during Commit Oct 26, 2023
@brilliant-lx
Copy link
Collaborator Author

run full sync for 2 days, it is ok, so merge the PR.

@brilliant-lx brilliant-lx merged commit fd6e7bb into bnb-chain:develop Oct 27, 2023
5 checks passed
@brilliant-lx brilliant-lx deleted the commitTrie branch October 27, 2023 00:55
whw188 pushed a commit to tylerteea/mev-bsc that referenced this pull request Dec 6, 2023
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