ethereum/go-ethereum · error

raw-entry ancestor not found: %x

Error message

raw-entry ancestor not found: %x

What it means

Error "raw-entry ancestor not found: %x" thrown in ethereum/go-ethereum.

Source

Thrown at trie/sync.go:348

	}
	// If database says duplicate, the blob is present for sure.
	// Note we only check the existence with new code scheme, snap
	// sync is expected to run with a fresh new node. Even there
	// exists the code with legacy format, fetch and store with
	// new scheme anyway.
	if rawdb.HasCodeWithPrefix(s.database, hash) {
		return
	}
	// Assemble the new sub-trie sync request
	req := &codeRequest{
		path: path,
		hash: hash,
	}
	// If this sub-trie has a designated parent, link them together
	if parent != (common.Hash{}) {
		ancestor := s.nodeReqs[string(parentPath)] // the parent of codereq can ONLY be nodereq
		if ancestor == nil {
			panic(fmt.Sprintf("raw-entry ancestor not found: %x", parent))
		}
		ancestor.deps++
		req.parents = append(req.parents, ancestor)
	}
	s.scheduleCodeRequest(req)
}

// Missing retrieves the known missing nodes from the trie for retrieval. To aid
// both eth/6x style fast sync and snap/1x style state sync, the paths of trie
// nodes are returned too, as well as separate hash list for codes.
func (s *Sync) Missing(max int) ([]string, []common.Hash, []common.Hash) {
	var (
		nodePaths  []string
		nodeHashes []common.Hash
		codeHashes []common.Hash
	)
	for !s.queue.Empty() && (max == 0 || len(nodeHashes)+len(codeHashes) < max) {
		// Retrieve the next item in line

View on GitHub (pinned to 6bb0588ad8)

Solutions

  1. The code/raw-entry request's parent node request was never scheduled. Ensure the owning sub-trie/node request is registered before adding code requests that reference it as parent.

Example fix

// Register the node request first, then the code request:
sync.AddSubTrie(path, hash, root, nil)
sync.AddCodeEntry(codePath, codeHash, parentHash)

When it happens

Trigger: trie.Sync scheduling a raw code entry whose parent path is absent from the node request table.

Common situations: State sync scheduling bytecode requests for contracts in sub-tries that were not scheduled first.


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