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

improve: remove sharedpool from miner #2172

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

zzzckck
Copy link
Collaborator

@zzzckck zzzckck commented Jan 19, 2024

Description

SharedPool was introduced since v1.1.9, but it has a potential bug and is no longer supported since hertzFix.

This PR is to remove the sharedPool code in miner module, which was introduced in this PR #818 and is useless now.

It has no impact to the current logic, but just code improve

Rationale

NA

Example

NA

Changes

NA

@@ -1022,11 +1022,6 @@ func (bc *BlockChain) SnapSyncCommitHead(hash common.Hash) error {
return nil
}

// StateAtWithSharedPool returns a new mutable state based on a particular point in time with sharedStorage
func (bc *BlockChain) StateAtWithSharedPool(root common.Hash) (*state.StateDB, error) {
return state.NewWithSharedPool(root, bc.stateCache, bc.snaps)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the NewWithSharedPool used in the InsertChain function need to be removed?

statedb, err := state.NewWithSharedPool(parent.Root, bc.stateCache, bc.snaps)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Does the NewWithSharedPool used in the InsertChain function need to be removed?

statedb, err := state.NewWithSharedPool(parent.Root, bc.stateCache, bc.snaps)

I am afraid not, InsertChain needs make sure backward compatibility, like the hertzFix case, so we can not remove the sharedPool logic from InsertChain

@zzzckck zzzckck merged commit bea8f8e into bnb-chain:develop Jan 22, 2024
6 checks passed
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.

4 participants