ethereum/go-ethereum · error

%T: invalid node: %v

Error message

%T: invalid node: %v

What it means

Error "%T: invalid node: %v" thrown in ethereum/go-ethereum.

Source

Thrown at trie/trie.go:222

		if err == nil && didResolve {
			n.Val = newnode
		}
		return value, n, didResolve, err
	case *fullNode:
		value, newnode, didResolve, err = t.get(n.Children[key[pos]], key, pos+1)
		if err == nil && didResolve {
			n.Children[key[pos]] = newnode
		}
		return value, n, didResolve, err
	case hashNode:
		child, err := t.resolveAndTrack(n, key[:pos])
		if err != nil {
			return nil, n, true, err
		}
		value, newnode, _, err := t.get(child, key, pos)
		return value, newnode, true, err
	default:
		panic(fmt.Sprintf("%T: invalid node: %v", origNode, origNode))
	}
}

// Prefetch attempts to resolve the leaves and intermediate trie nodes
// specified by the key list in parallel. The results are silently
// discarded to simplify the function.
func (t *Trie) Prefetch(keylist [][]byte) error {
	// Short circuit if the trie is already committed and not usable.
	if t.committed {
		return ErrCommitted
	}
	// Resolve the trie nodes sequentially if there are not too many
	// trie nodes in the trie.
	fn, ok := t.root.(*fullNode)
	if !ok || len(keylist) < 16 {
		for _, key := range keylist {
			_, err := t.Get(key)
			if err != nil {

View on GitHub (pinned to 6bb0588ad8)

Solutions

  1. This panic means trie.get encountered an unexpected node type — usually corrupted trie data. Re-sync or restore the state database, and verify the node data loaded from disk is intact.
  2. If reached with healthy data, it is an internal bug: capture the node type (%T) and value (%v) from the panic for the report.

Example fix

// Corrupt state: rebuild it.
// geth removedb && geth --syncmode snap  (or restore from snapshot/backup)

When it happens

Trigger: Trie node resolution (trie.get) receiving a node that is not a shortNode, fullNode, valueNode, or resolvable hashNode.

Common situations: Corrupted chaindata after unclean shutdown, disk errors, or incompatible database modification.


AI-assisted analysis of ethereum/go-ethereum@6bb0588ad8 (2026-08-15). Data as JSON: /api/errors/dbdd494213a1e6b0. Report an issue: GitHub.