From caea6d6ca871102be532c80a0fdf4c71e88a1781 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 4 Jun 2020 17:16:32 +0300 Subject: [PATCH] mpt: fix extension node cache invalidation It should always be invalidated if something changes in the `next` (below the extension node). Signed-off-by: Evgenii Stratonikov --- pkg/core/mpt/trie.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/mpt/trie.go b/pkg/core/mpt/trie.go index 3c38424c0..08d128d88 100644 --- a/pkg/core/mpt/trie.go +++ b/pkg/core/mpt/trie.go @@ -261,7 +261,6 @@ func (t *Trie) deleteFromExtension(n *ExtensionNode, path []byte) (Node, error) case *ExtensionNode: n.key = append(n.key, nxt.key...) n.next = nxt.next - n.invalidateCache() case *HashNode: if nxt.IsEmpty() { return nxt, nil @@ -269,6 +268,7 @@ func (t *Trie) deleteFromExtension(n *ExtensionNode, path []byte) (Node, error) default: n.next = r } + n.invalidateCache() return n, nil }