{"record":{"id":"d150904a52e6ffb9","repo":"ethereum/go-ethereum","slug":"node-x-v","errorCode":null,"errorMessage":"node %x: %v","messagePattern":"node %x: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"trie/node.go","lineNumber":130,"sourceCode":"\t}\n\treturn resp + fmt.Sprintf(\"\\n%s] \", ind)\n}\n\nfunc (n *shortNode) fstring(ind string) string {\n\treturn fmt.Sprintf(\"{%x: %v} \", n.Key, n.Val.fstring(ind+\"  \"))\n}\nfunc (n hashNode) fstring(ind string) string {\n\treturn fmt.Sprintf(\"<%x> \", []byte(n))\n}\nfunc (n valueNode) fstring(ind string) string {\n\treturn fmt.Sprintf(\"%x \", []byte(n))\n}\n\n// mustDecodeNode is a wrapper of decodeNode and panic if any error is encountered.\nfunc mustDecodeNode(hash, buf []byte) node {\n\tn, err := decodeNode(hash, buf)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"node %x: %v\", hash, err))\n\t}\n\treturn n\n}\n\n// mustDecodeNodeUnsafe is a wrapper of decodeNodeUnsafe and panic if any error is\n// encountered.\nfunc mustDecodeNodeUnsafe(hash, buf []byte) node {\n\tn, err := decodeNodeUnsafe(hash, buf)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"node %x: %v\", hash, err))\n\t}\n\treturn n\n}\n\n// decodeNode parses the RLP encoding of a trie node. It will deep-copy the passed\n// byte slice for decoding, so it's safe to modify the byte slice afterwards. The-\n// decode performance of this function is not optimal, but it is suitable for most\n// scenarios with low performance requirements and hard to determine whether the","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/trie/node.go#L112-L148","documentation":"mustDecodeNode panics when decodeNode fails to RLP-decode a trie node blob, embedding the node hash and the decode error in the message. It is used on the hot path where node bytes are trusted; a decode failure means the stored bytes for that hash are not a valid trie node — typically database corruption or wrong-network data.","triggerScenarios":"Loading a trie node from the database whose stored blob is malformed, truncated, or belongs to a different encoding scheme; opening a database written by incompatible software; disk-level corruption or partial writes.","commonSituations":"Crash during a database write leaving partial nodes; mixing chain data from different node versions or forks; corrupted datadir after disk failure; restoring from a bad backup; snapshot files that do not match the trie root.","solutions":["Run the node's database integrity checks and inspect the reported node hash in the logs.","If corruption is confirmed, resync the chain data (or restore the datadir from a good backup/archive).","Ensure all writers/readers of the database run the same (compatible) software version.","Check disk health (dmesg/SMART) if corruption appears spontaneous."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"trie node decode failed: %v\", r) // message contains node hash\n    }\n}()\ntr, err := trie.New(root, db)","preventionTips":["Convert panics to errors with recover at API boundaries; the panic text contains the failing node hash for diagnosis.","Keep datadir on reliable storage and stop the node cleanly to avoid partial node writes.","Never mix databases between incompatible software versions; resync when node encodings change."],"tags":["trie","rlp","decoding","corruption","database","panic","go"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}