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

Fix maxTrieLevelInMemory invalid value #1757

Merged
merged 7 commits into from
May 20, 2020

Conversation

BeniaminDrasovean
Copy link
Contributor

Added missing mutex to GetAllLeaves() from trie.
Initialize maxTrieLevelInMemory in all the places in which maxTrieLevelInMemory=0
Return error if maxTrieLevelInMemory is initialized with 0.

@BeniaminDrasovean BeniaminDrasovean self-assigned this May 18, 2020
sasurobert
sasurobert previously approved these changes May 18, 2020
@@ -514,7 +517,9 @@ func (tr *patriciaMerkleTrie) GetSerializedNodes(rootHash []byte, maxBuffToSend

// GetAllLeaves iterates the trie and returns a map that contains all leafNodes information
func (tr *patriciaMerkleTrie) GetAllLeaves() (map[string][]byte, error) {
//TODO: save those leafs into a levelDB struct (cache and storage) and at processing time to get from that structure.
tr.mutOperation.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

RLock / RUnlock ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit d502cca into development May 20, 2020
@LucianMincu LucianMincu deleted the EN-6440-fix-maxTrieLevelInMemory-on-sync branch May 20, 2020 09:24
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