{"record":{"id":"1d6f2334820da8e4","repo":"ethereum/go-ethereum","slug":"it-shouldn-t-happen","errorCode":null,"errorMessage":"it shouldn't happen","messagePattern":"it shouldn't happen","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"trie/proof.go","lineNumber":411,"sourceCode":"\t\t\t\t// path(it doesn't belong to the range), keep\n\t\t\t\t// it with the cached hash available.\n\t\t\t\t//}\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tif _, ok := cld.Val.(valueNode); ok {\n\t\t\tfn := parent.(*fullNode)\n\t\t\tfn.Children[key[pos-1]] = nil\n\t\t\treturn nil\n\t\t}\n\t\tcld.flags = nodeFlag{dirty: true}\n\t\treturn unset(cld, cld.Val, key, pos+len(cld.Key), removeLeft)\n\tcase nil:\n\t\t// If the node is nil, then it's a child of the fork point\n\t\t// fullnode(it's a non-existent branch).\n\t\treturn nil\n\tdefault:\n\t\tpanic(\"it shouldn't happen\") // hashNode, valueNode\n\t}\n}\n\n// hasRightElement returns the indicator whether there exists more elements\n// on the right side of the given path. The given path can point to an existent\n// key or a non-existent one. This function has the assumption that the whole\n// path should already be resolved.\nfunc hasRightElement(node node, key []byte) bool {\n\tpos, key := 0, keybytesToHex(key)\n\tfor node != nil {\n\t\tswitch rn := node.(type) {\n\t\tcase *fullNode:\n\t\t\tfor i := key[pos] + 1; i < 16; i++ {\n\t\t\t\tif rn.Children[i] != nil {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode, pos = rn.Children[key[pos]], pos+1","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/trie/proof.go#L393-L429","documentation":"Error \"it shouldn't happen\" thrown in ethereum/go-ethereum.","triggerScenarios":"Internal proof-path manipulation (unset) receiving a node type that should have been resolved earlier.","commonSituations":"Only reachable through corrupted trie structures or a bug in proof handling code.","solutions":["This is a defensive unreachable-code panic in the proof unset path; hitting it means an unexpected node type (hashNode/valueNode) was passed where only full/short nodes are valid. Investigate the trie data for corruption and re-sync if needed."],"exampleFix":"// No user-side fix: this panic guards an internal invariant.\n// If hit, the trie is corrupt — rebuild state via re-sync or snapshot restore.","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-15T22:17:37.221Z"}