diff --git a/core/state/state_object.go b/core/state/state_object.go index d5979ec837..c8d20392c2 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -800,7 +800,12 @@ func (s *stateObject) fetchExpiredFromRemote(prefixKey []byte, key common.Hash, // if no prefix, query from revive trie, got the newest expired info if resolvePath { - _, err := tr.GetStorage(s.address, key.Bytes()) + val, err := tr.GetStorage(s.address, key.Bytes()) + // TODO(asyukii): temporary fix snap expired, but trie not expire, may investigate more later. + if val != nil { + s.pendingReviveState[string(crypto.Keccak256(key[:]))] = common.BytesToHash(val) + return val, nil + } enErr, ok := err.(*trie.ExpiredNodeError) if !ok { return nil, fmt.Errorf("cannot find expired state from trie, err: %v", err) diff --git a/trie/proof.go b/trie/proof.go index a88ae6eacb..c67b3d6c3b 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -120,7 +120,6 @@ func (t *StateTrie) Prove(key []byte, proofDb ethdb.KeyValueWriter) error { // it. func (t *Trie) traverseNodes(tn node, prefixKey, suffixKey []byte, nodes *[]node, epoch types.StateEpoch, updateEpoch bool) (node, error) { for len(suffixKey) > 0 && tn != nil { - log.Info("traverseNodes loop", "prefix", common.Bytes2Hex(prefixKey), "suffix", common.Bytes2Hex(suffixKey), "n", tn.fstring("")) switch n := tn.(type) { case *shortNode: if len(suffixKey) >= len(n.Key) && bytes.Equal(n.Key, suffixKey[:len(n.Key)]) { diff --git a/trie/trie.go b/trie/trie.go index 27ff3134f4..0fbb8f69ac 100644 --- a/trie/trie.go +++ b/trie/trie.go @@ -1238,8 +1238,8 @@ func (t *Trie) tryRevive(n node, key []byte, targetPrefixKey []byte, nub MPTProo n1 = n1.copy() n1.Val = newnode n1.flags = t.newFlag() - tryUpdateNodeEpoch(nub.n1, t.currentEpoch) - renew, _, err := t.updateChildNodeEpoch(nub.n1, key, pos, t.currentEpoch) + tryUpdateNodeEpoch(n1, t.currentEpoch) + renew, _, err := t.updateChildNodeEpoch(n1, key, pos, t.currentEpoch) if err != nil { return nil, false, fmt.Errorf("update child node epoch while reviving failed, err: %v", err) }