From 85b4010de50287140c5f84bd8ff42452fdb24933 Mon Sep 17 00:00:00 2001 From: 0xbundler <124862913+0xbundler@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:38:19 +0800 Subject: [PATCH] state/stateobject: debug future; --- trie/trie.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trie/trie.go b/trie/trie.go index 39b1dbd4ca..e97294874b 100644 --- a/trie/trie.go +++ b/trie/trie.go @@ -297,11 +297,14 @@ func (t *Trie) getWithEpoch(origNode node, key []byte, pos int, epoch types.Stat n.flags = t.newFlag() didResolve = true } + if err != nil { + return value, n, didResolve, fmt.Errorf("getWithEpoch err, epoch: %v, node:%v, err: %v", epoch, n.fstring(""), err) + } return value, n, didResolve, err case hashNode: child, err := t.resolveAndTrack(n, key[:pos]) if err != nil { - return nil, n, true, err + return nil, n, true, fmt.Errorf("getWithEpoch err, epoch: %v, node:%v, err: %v", epoch, n.fstring(""), err) } if err = t.resolveEpochMetaAndTrack(child, epoch, key[:pos]); err != nil { @@ -954,6 +957,7 @@ func (t *Trie) deleteWithEpoch(n node, prefix, key []byte, epoch types.StateEpoc // shortNode{..., shortNode{...}}. Since the entry // might not be loaded yet, resolve it just for this // check. + // TODO(0xbundler): if Children[pos] has pruned? fetch from remote? cnode, err := t.resolve(n.Children[pos], append(prefix, byte(pos)), n.GetChildEpoch(pos)) if err != nil { return false, nil, err