Skip to content

Commit

Permalink
Apply PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 10, 2023
1 parent d19dd21 commit 233b69b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/runtime/storage/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (s *TrieState) DeleteChildLimit(key []byte, limit *[]byte) (
// If one deletion fails, the child trie and its parent trie are then in
// a bad intermediary state. Take also care of the caching of deleted Merkle
// values within the tries, which is used for online pruning.
// See https://github.com/ChainSafe/gossamer/issues/3032
err = tr.Delete([]byte(k))
if err != nil {
return deleted, allDeleted, fmt.Errorf("deleting from child trie located at key 0x%x: %w", key, err)
Expand Down
3 changes: 1 addition & 2 deletions lib/trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ func (t *Trie) insert(parent *Node, key, value []byte,
}, mutated, nodesCreated, nil
}

// TODO ensure all values have dirty set to true

if parent.Kind() == node.Branch {
newParent, mutated, nodesCreated, err = t.insertInBranch(
parent, key, value, deletedMerkleValues)
Expand Down Expand Up @@ -888,6 +886,7 @@ func (t *Trie) clearPrefixLimitChild(branch *Node, prefix []byte, limit uint32,
if child == nil {
const valuesDeleted, nodesRemoved = 0, 0
// TODO ensure this is the same behaviour as in substrate
// See https://github.com/ChainSafe/gossamer/issues/3033
allDeleted = true
return newParent, valuesDeleted, nodesRemoved, allDeleted, nil
}
Expand Down

0 comments on commit 233b69b

Please sign in to comment.