{"record":{"id":"6166cea35356f7a7","repo":"ethereum/go-ethereum","slug":"not-supported-6166ce","errorCode":null,"errorMessage":"not supported","messagePattern":"not supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"trie/trienode/proof.go","lineNumber":73,"sourceCode":"\n\tdb.nodes[keystr] = common.CopyBytes(value)\n\tdb.order = append(db.order, keystr)\n\tdb.dataSize += len(value)\n\n\treturn nil\n}\n\n// Delete removes a node from the set\nfunc (db *ProofSet) Delete(key []byte) error {\n\tdb.lock.Lock()\n\tdefer db.lock.Unlock()\n\n\tdelete(db.nodes, string(key))\n\treturn nil\n}\n\nfunc (db *ProofSet) DeleteRange(start, end []byte) error {\n\tpanic(\"not supported\")\n}\n\n// Get returns a stored node\nfunc (db *ProofSet) Get(key []byte) ([]byte, error) {\n\tdb.lock.RLock()\n\tdefer db.lock.RUnlock()\n\n\tif entry, ok := db.nodes[string(key)]; ok {\n\t\treturn entry, nil\n\t}\n\treturn nil, errors.New(\"not found\")\n}\n\n// Has returns true if the node set contains the given key\nfunc (db *ProofSet) Has(key []byte) (bool, error) {\n\t_, err := db.Get(key)\n\treturn err == nil, nil\n}","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/trie/trienode/proof.go#L55-L91","documentation":"ProofSet is a tiny in-memory map used by trie proof verification (VerifyRange/VerifyProof): it is a read-collecting fake database that only supports Has/Put/Get. DeleteRange panics because a proof verification never bulk-deletes — calling it means the ProofSet was passed to an API that expects a real KeyValueStore writer.","triggerScenarios":"Passing a *trienode.ProofSet as the ethdb.KeyValueWriter parameter of a function that performs range deletions (e.g. compaction helpers, trie iterator pruning, or any code path calling DeleteRange on its supplied database).","commonSituations":"Refactoring geth internals and accidentally routing a write-path database argument to proof verification; custom tools reusing ProofSet as a generic in-memory db; API changes where a proof callback signature gained writer methods.","solutions":["Check the call site: ProofSet must only be given to proof/range-proof verification functions, never to general storage code","Replace the ProofSet with a real memdb (e.g. ethdb.NewMemDatabase) if you genuinely need deletion support","If you forked the verification API and now need DeleteRange, implement it instead of panicking (delete by key range from the map)"],"exampleFix":"// before\nset := trienode.NewProofSet()\ntrydb.Compact(set, start, end) // panics: DeleteRange not supported\n\n// after\nmem := rawdb.NewMemoryDatabase()\ntrydb.Compact(mem, start, end)","handlingStrategy":"validation","validationCode":"// Only hand ProofSet to read-collect verification APIs\nvar _ ethdb.KeyValueReader = (*trienode.ProofSet)(nil) // document the intent\n// before generic calls:\nif _, ok := db.(interface{ DeleteRange([]byte, []byte) error }); ok && !isProofAPI(callee) {\n    db = rawdb.NewMemoryDatabase()\n}","typeGuard":"func isProofSet(db ethdb.Database) bool { _, ok := db.(*trienode.ProofSet); return ok }","tryCatchPattern":null,"preventionTips":["Never pass ProofSet/proof accumulators into compaction or generic write helpers","Grep call sites of DeleteRange and confirm each target is a real store","Keep proof types out of interfaces that include writer methods"],"tags":["triedb","proofset","misuse","panic"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}