{"record":{"id":"e96e72dbe40123ea","repo":"ethereum/go-ethereum","slug":"not-implemented-e96e72","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"trie/iterator.go","lineNumber":673,"sourceCode":"\nfunc (it *differenceIterator) LeafBlob() []byte {\n\treturn it.b.LeafBlob()\n}\n\nfunc (it *differenceIterator) LeafProof() [][]byte {\n\treturn it.b.LeafProof()\n}\n\nfunc (it *differenceIterator) Path() []byte {\n\treturn it.b.Path()\n}\n\nfunc (it *differenceIterator) NodeBlob() []byte {\n\treturn it.b.NodeBlob()\n}\n\nfunc (it *differenceIterator) AddResolver(resolver NodeResolver) {\n\tpanic(\"not implemented\")\n}\n\nfunc (it *differenceIterator) Next(bool) bool {\n\t// Invariants:\n\t// - We always advance at least one element in b.\n\t// - At the start of this function, a's path is lexically greater than b's.\n\tif !it.b.Next(true) {\n\t\treturn false\n\t}\n\tit.count++\n\n\tif it.eof {\n\t\t// a has reached eof, so we just return all elements from b\n\t\treturn true\n\t}\n\n\tfor {\n\t\tswitch compareNodes(it.a, it.b) {","sourceCodeStart":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/trie/iterator.go#L655-L691","documentation":"The difference iterator ( NewDifferenceIterator) does not support attaching a node resolver, so AddResolver panics with 'not implemented'. This iterator wraps two iterators and only exposes pass-through operations; node resolution is not wired through the wrapper.","triggerScenarios":"Calling NewDifferenceIterator(...).AddResolver(db) or passing a difference iterator to generic code that installs a resolver (e.g. witness builders or iterators over remote databases).","commonSituations":"Reusable traversal utilities that always call AddResolver to enable lazy node loading; running witness/proof collection over a trie difference; code that worked with plain iterators but was switched to difference iteration.","solutions":["Attach the resolver to the underlying iterators before wrapping them in the difference iterator.","Type-switch on the iterator and skip AddResolver for difference iterators.","Contribute an implementation upstream if your workflow requires it."],"exampleFix":"// before\nit := trie.NewDifferenceIterator(a, b)\nit.AddResolver(resolver) // panic\n\n// after\na.AddResolver(resolver)\nb.AddResolver(resolver)\nit := trie.NewDifferenceIterator(a, b)","handlingStrategy":"type-guard","validationCode":"a.AddResolver(resolver) // attach to sources before wrapping\nb.AddResolver(resolver)\nit := trie.NewDifferenceIterator(a, b)","typeGuard":"func addResolverSafe(it trie.NodeIterator, r trie.NodeResolver) {\n    if _, isDiff := it.(*trie.DifferenceIterator); isDiff {\n        return // AddResolver panics: not implemented\n    }\n    it.AddResolver(r)\n}","tryCatchPattern":null,"preventionTips":["Install resolvers on source iterators before wrapping them in difference/union iterators.","Keep a list of iterator kinds that support AddResolver when writing generic traversal code.","Check the codebase for 'not implemented' panics before relying on optional iterator APIs."],"tags":["trie","iterator","not-implemented","unsupported-operation","panic","go"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}