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

Removed duplicated code #4643

Conversation

iulianpascalau
Copy link
Contributor

Reasoning behind the pull request

  • removed duplicated code

Proposed changes

  • removed duplicated code

Testing procedure

  • standard system test

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@iulianpascalau iulianpascalau changed the title - removed duplicated code Removed duplicated code Oct 25, 2022
Copy link
Contributor

@bogdan-rosianu bogdan-rosianu left a comment

Choose a reason for hiding this comment

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

diff checked the storer before&after the refactoring. looks good

metaHdrHashNonceUnit, err := storageunit.NewStorageUnitFromConf(
GetCacherFromConfig(psf.generalConfig.MetaHdrNonceHashStorage.Cache),
metaHdrHashNonceUnitConfig)
peerAccountsUnit, err := psf.createTriePruningStorer(psf.generalConfig.PeerAccountsTrieStorage, customDatabaseRemover)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not created correctly for shard. When creating the peersUnit for shard, it needs to have a normal persistersTracker, not a triePersisterTracker. That is because we do not snapshot the peer state for shards, so there is no need to manage the opening and closing of the dbs in a special manner.

@iulianpascalau iulianpascalau merged commit 7d63b9e into fix-meta-custom-db-remover Oct 27, 2022
@iulianpascalau iulianpascalau deleted the fix-meta-custom-db-remover-proper-fix branch October 27, 2022 07:52
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