{"record":{"id":"d446afcf2bead391","repo":"ethereum/go-ethereum","slug":"t-invalid-node-v-d446af","errorCode":null,"errorMessage":"%T: invalid node: %v","messagePattern":"%T: invalid node: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"trie/proof.go","lineNumber":82,"sourceCode":"\t\t\tkey = key[1:]\n\t\t\tnodes = append(nodes, n)\n\t\tcase hashNode:\n\t\t\t// Retrieve the specified node from the underlying node reader.\n\t\t\t// trie.resolveAndTrack is not used since in that function the\n\t\t\t// loaded blob will be tracked, while it's not required here since\n\t\t\t// all loaded nodes won't be linked to trie at all and track nodes\n\t\t\t// may lead to out-of-memory issue.\n\t\t\tblob, err := t.reader.Node(prefix, common.BytesToHash(n))\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"Unhandled trie error in Trie.Prove\", \"err\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// The raw-blob format nodes are loaded either from the\n\t\t\t// clean cache or the database, they are all in their own\n\t\t\t// copy and safe to use unsafe decoder.\n\t\t\ttn = mustDecodeNodeUnsafe(n, blob)\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"%T: invalid node: %v\", tn, tn))\n\t\t}\n\t}\n\thasher := newHasher(false)\n\tdefer returnHasherToPool(hasher)\n\n\tfor i, n := range nodes {\n\t\tenc := hasher.proofHash(n)\n\t\tif len(enc) >= 32 || i == 0 {\n\t\t\tproofDb.Put(crypto.Keccak256(enc), enc)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Prove constructs a merkle proof for key. The result contains all encoded nodes\n// on the path to the value at key. The value itself is also included in the last\n// node and can be retrieved by verifying the proof.\n//","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/trie/proof.go#L64-L100","documentation":"Error \"%T: invalid node: %v\" thrown in ethereum/go-ethereum.","triggerScenarios":"Proof generation encountering a trie node that is neither a shortNode, fullNode, hashNode, nor raw blob — typically a sign of corrupted state data.","commonSituations":"Corrupted chaindata after an unclean shutdown, disk failure, or manual database manipulation.","solutions":["This panic indicates trie database corruption or an unexpected node encoding. Re-sync or restore the state database from a known-good snapshot.","Ensure the node data passed to proofHash/mustDecodeNodeUnsafe was loaded intact from the database; check for disk corruption or a partial write."],"exampleFix":"// If the node store is corrupt, remove the ancient/chaindata state and resync:\n// geth removedb  (then re-sync from peers or a snapshot)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}