Skip to content

Instantly share code, notes, and snippets.

@thanethomson
Created August 18, 2023 13:34
Show Gist options
  • Save thanethomson/ad3fb91847a4cb84e281a4322e971667 to your computer and use it in GitHub Desktop.
Save thanethomson/ad3fb91847a4cb84e281a4322e971667 to your computer and use it in GitHub Desktop.
gopls trace logs for incorrect rename problem
[Trace - 09:33:22.850 AM] Sending request 'initialize - (0)'.
Params: {"processId":1312106,"clientInfo":{"name":"Visual Studio Code","version":"1.81.1"},"locale":"en","rootPath":"/home/thane/work/informal/cometbft","rootUri":"file:///home/thane/work/informal/cometbft","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["location.range"]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"didChangeConfiguration":{"dynamicRegistration":true},"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true},"inlineValue":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true},"insertTextMode":2,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode"]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true,"foldingRangeKind":{"valueSet":["comment","imports","region"]},"foldingRange":{"collapsedText":false}},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false,"serverCancelSupport":true,"augmentsSyntaxTokens":true},"linkedEditingRange":{"dynamicRegistration":true},"typeHierarchy":{"dynamicRegistration":true},"inlineValue":{"dynamicRegistration":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":false}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"},"positionEncodings":["utf-16"]},"notebookDocument":{"synchronization":{"dynamicRegistration":true,"executionSummarySupport":true}}},"initializationOptions":{"formatting.gofumpt":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"},"trace":"verbose","workspaceFolders":[{"uri":"file:///home/thane/work/informal/cometbft","name":"cometbft"}]}
[Trace - 09:33:22.852 AM] Received response 'initialize - (0)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"selectionRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.edit_go_directive","gopls.fetch_vulncheck_result","gopls.gc_details","gopls.generate","gopls.go_get_package","gopls.list_imports","gopls.list_known_packages","gopls.mem_stats","gopls.regenerate_cgo","gopls.remove_dependency","gopls.reset_go_mod_diagnostics","gopls.run_go_work_command","gopls.run_govulncheck","gopls.run_tests","gopls.start_debugging","gopls.start_profile","gopls.stop_profile","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor","gopls.workspace_stats"]},"callHierarchyProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]},"range":true,"full":true},"inlayHintProvider":{},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{\"GoVersion\":\"go1.21.0\",\"Path\":\"golang.org/x/tools/gopls\",\"Main\":{\"Path\":\"golang.org/x/tools/gopls\",\"Version\":\"v0.13.2\",\"Sum\":\"h1:Pyvx6MKvatbX3zzZmdGiFRfQZl0ohPlt2sFxO/5j6Ro=\",\"Replace\":null},\"Deps\":[{\"Path\":\"github.com/BurntSushi/toml\",\"Version\":\"v1.2.1\",\"Sum\":\"h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=\",\"Replace\":null},{\"Path\":\"github.com/google/go-cmp\",\"Version\":\"v0.5.9\",\"Sum\":\"h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=\",\"Replace\":null},{\"Path\":\"github.com/sergi/go-diff\",\"Version\":\"v1.1.0\",\"Sum\":\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\",\"Replace\":null},{\"Path\":\"golang.org/x/exp\",\"Version\":\"v0.0.0-20220722155223-a9213eeb770e\",\"Sum\":\"h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=\",\"Replace\":null},{\"Path\":\"golang.org/x/exp/typeparams\",\"Version\":\"v0.0.0-20221212164502-fae10dda9338\",\"Sum\":\"h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=\",\"Replace\":null},{\"Path\":\"golang.org/x/mod\",\"Version\":\"v0.12.0\",\"Sum\":\"h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=\",\"Replace\":null},{\"Path\":\"golang.org/x/sync\",\"Version\":\"v0.3.0\",\"Sum\":\"h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=\",\"Replace\":null},{\"Path\":\"golang.org/x/sys\",\"Version\":\"v0.10.0\",\"Sum\":\"h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=\",\"Replace\":null},{\"Path\":\"golang.org/x/text\",\"Version\":\"v0.11.0\",\"Sum\":\"h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=\",\"Replace\":null},{\"Path\":\"golang.org/x/tools\",\"Version\":\"v0.11.2-0.20230810185051-cc6b5804b8cf\",\"Sum\":\"h1:Oush7UwPamr2/iNeNFBuNFj89YyHn0YY69EKDdvANnk=\",\"Replace\":null},{\"Path\":\"golang.org/x/vuln\",\"Version\":\"v0.0.0-20230110180137-6ad3e3d07815\",\"Sum\":\"h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU=\",\"Replace\":null},{\"Path\":\"honnef.co/go/tools\",\"Version\":\"v0.4.2\",\"Sum\":\"h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc=\",\"Replace\":null},{\"Path\":\"mvdan.cc/gofumpt\",\"Version\":\"v0.4.0\",\"Sum\":\"h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=\",\"Replace\":null},{\"Path\":\"mvdan.cc/xurls/v2\",\"Version\":\"v2.4.0\",\"Sum\":\"h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=\",\"Replace\":null}],\"Settings\":[{\"Key\":\"-buildmode\",\"Value\":\"exe\"},{\"Key\":\"-compiler\",\"Value\":\"gc\"},{\"Key\":\"DefaultGODEBUG\",\"Value\":\"panicnil=1\"},{\"Key\":\"CGO_ENABLED\",\"Value\":\"1\"},{\"Key\":\"CGO_CFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_CPPFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_CXXFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_LDFLAGS\",\"Value\":\"\"},{\"Key\":\"GOARCH\",\"Value\":\"amd64\"},{\"Key\":\"GOOS\",\"Value\":\"linux\"},{\"Key\":\"GOAMD64\",\"Value\":\"v1\"}],\"Version\":\"v0.13.2\"}"}}
[Trace - 09:33:22.853 AM] Sending notification 'initialized'.
Params: {}
[Trace - 09:33:22.853 AM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"8412593888844104124"}
[Trace - 09:33:22.871 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","languageId":"go","version":1,"text":"package state\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/cometbft/cometbft/config\"\n\t\"github.com/cometbft/cometbft/libs/log\"\n\t\"github.com/cometbft/cometbft/libs/service\"\n)\n\nvar (\n\tAppRetainHeightKey = []byte(\"AppRetainHeightKey\")\n\tCompanionBlockRetainHeightKey = []byte(\"DCBlockRetainHeightKey\")\n\tABCIResultsRetainHeightKey = []byte(\"ABCIResRetainHeightKey\")\n)\n\n// Pruner is a service that reads the retain heights for blocks, state and ABCI\n// results from the database and prunes the corresponding data based on the\n// minimum retain height set. The service sleeps between each run based on the\n// configured pruner interval, and re-evaluates the retain height.\ntype Pruner struct {\n\tservice.BaseService\n\tlogger log.Logger\n\n\tmtx sync.Mutex\n\t// Must the pruner respect the retain heights set by the data companion?\n\tdcEnabled bool\n\tdcInitBlockRetainHeight int64\n\tdcInitBlockResultsRetainHeight int64\n\t// DB to which we save the retain heights\n\tbs BlockStore\n\t// State store to prune state from\n\tstateStore Store\n\n\tinterval time.Duration\n\n\tobserver PrunerObserver\n\n\tmetrics *Metrics\n}\n\ntype prunerConfig struct {\n\tdcEnabled bool\n\tdcInitBlockRetainHeight int64\n\tdcInitBlockResultsRetainHeight int64\n\tinterval time.Duration\n\tobserver PrunerObserver\n\tmetrics *Metrics\n}\n\nfunc defaultPrunerConfig() *prunerConfig {\n\treturn &prunerConfig{\n\t\tdcEnabled: false,\n\t\tinterval: config.DefaultPruningInterval,\n\t\tobserver: &NoopPrunerObserver{},\n\t\tmetrics: NopMetrics(),\n\t}\n}\n\ntype PrunerOption func(*prunerConfig)\n\n// WithPrunerCompanionEnabled indicates to the pruner that it must respect the\n// retain heights set by the data companion. By default, if this option is not\n// supplied, the pruner will ignore any retain heights set by the data\n// companion.\nfunc WithPrunerCompanionEnabled(initBlockRetainHeight, initBlockResultsRetainHeight int64) PrunerOption {\n\treturn func(p *prunerConfig) {\n\t\tp.dcEnabled = true\n\t\tp.dcInitBlockRetainHeight = initBlockRetainHeight\n\t\tp.dcInitBlockResultsRetainHeight = initBlockResultsRetainHeight\n\t}\n}\n\n// WithPrunerInterval allows control over the interval between each run of the\n// pruner.\nfunc WithPrunerInterval(t time.Duration) PrunerOption {\n\treturn func(p *prunerConfig) { p.interval = t }\n}\n\nfunc WithPrunerObserver(obs PrunerObserver) PrunerOption {\n\treturn func(p *prunerConfig) { p.observer = obs }\n}\n\nfunc WithPrunerMetrics(metrics *Metrics) PrunerOption {\n\treturn func(p *prunerConfig) {\n\t\tp.metrics = metrics\n\t}\n}\n\nfunc NewPruner(stateStore Store, bs BlockStore, logger log.Logger, options ...PrunerOption) *Pruner {\n\tcfg := defaultPrunerConfig()\n\tfor _, opt := range options {\n\t\topt(cfg)\n\t}\n\tp := &Pruner{\n\t\tdcEnabled: cfg.dcEnabled,\n\t\tdcInitBlockRetainHeight: cfg.dcInitBlockRetainHeight,\n\t\tdcInitBlockResultsRetainHeight: cfg.dcInitBlockResultsRetainHeight,\n\t\tbs: bs,\n\t\tstateStore: stateStore,\n\t\tlogger: logger,\n\t\tinterval: cfg.interval,\n\t\tobserver: cfg.observer,\n\t\tmetrics: cfg.metrics,\n\t}\n\tp.BaseService = *service.NewBaseService(logger, \"Pruner\", p)\n\treturn p\n}\n\nfunc (p *Pruner) SetObserver(obs PrunerObserver) {\n\tp.observer = obs\n}\n\nfunc (p *Pruner) OnStart() error {\n\tgo p.pruneBlocksRoutine()\n\tgo p.pruneABCIResRoutine()\n\tp.observer.PrunerStarted(p.interval)\n\treturn nil\n}\n\n// SetApplicationBlockRetainHeight sets the application block retain height\n// with some basic checks on the requested height.\n//\n// If a higher retain height is already set, we cannot accept the requested\n// height because the blocks might have been pruned.\n//\n// If the data companion has already set a retain height to a higher value we\n// also cannot accept the requested height as the blocks might have been\n// pruned.\nfunc (p *Pruner) SetApplicationBlockRetainHeight(height int64) error {\n\t// Ensure that all requests to set retain heights via the application are\n\t// serialized.\n\tp.mtx.Lock()\n\tdefer p.mtx.Unlock()\n\n\tif !p.checkHeightBound(height) {\n\t\treturn ErrInvalidHeightValue\n\t}\n\tcurrentAppRetainHeight, err := p.stateStore.GetApplicationRetainHeight()\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\treturn err\n\t\t}\n\t\tcurrentAppRetainHeight = height\n\t}\n\tcurrentCompanionRetainHeight, err := p.stateStore.GetCompanionBlockRetainHeight()\n\tcompanionRetainHeightSet := true\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\treturn err\n\t\t}\n\t\tcompanionRetainHeightSet = false\n\t}\n\tif currentAppRetainHeight > height || (companionRetainHeightSet && currentCompanionRetainHeight > height) {\n\t\treturn ErrPrunerCannotLowerRetainHeight\n\t}\n\tif err := p.stateStore.SaveApplicationRetainHeight(height); err != nil {\n\t\treturn err\n\t}\n\tp.metrics.ApplicationBlockRetainHeight.Set(float64(height))\n\treturn nil\n}\n\nfunc (p *Pruner) checkHeightBound(height int64) bool {\n\tif height <= 0 || height < p.bs.Base() || height > p.bs.Height() {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// SetCompanionRetainHeight sets the application retain height with some basic\n// checks on the requested height.\n//\n// If a higher retain height is already set, we cannot accept the requested\n// height because the blocks might have been pruned.\n//\n// If the application has already set a retain height to a higher value we also\n// cannot accept the requested height as the blocks might have been pruned.\nfunc (p *Pruner) SetCompanionRetainHeight(height int64) error {\n\t// Ensure that all requests to set retain heights via the pruner are\n\t// serialized.\n\tp.mtx.Lock()\n\tdefer p.mtx.Unlock()\n\n\tif !p.checkHeightBound(height) {\n\t\treturn ErrInvalidHeightValue\n\t}\n\tcurrentCompanionRetainHeight, err := p.stateStore.GetCompanionBlockRetainHeight()\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\treturn err\n\t\t}\n\t\tcurrentCompanionRetainHeight = height\n\t}\n\tcurrentAppRetainHeight, err := p.stateStore.GetApplicationRetainHeight()\n\tappRetainHeightSet := true\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\treturn err\n\t\t}\n\t\tappRetainHeightSet = false\n\t}\n\tif currentCompanionRetainHeight > height || (appRetainHeightSet && currentAppRetainHeight > height) {\n\t\treturn ErrPrunerCannotLowerRetainHeight\n\t}\n\tif err := p.stateStore.SaveCompanionBlockRetainHeight(height); err != nil {\n\t\treturn err\n\t}\n\tp.metrics.PruningServiceBlockRetainHeight.Set(float64(height))\n\treturn nil\n}\n\n// SetABCIResRetainHeight sets the retain height for ABCI responses.\n//\n// If the application has set the DiscardABCIResponses flag to true, nothing\n// will be pruned.\nfunc (p *Pruner) SetABCIResRetainHeight(height int64) error {\n\t// Ensure that all requests to set retain heights via the pruner are\n\t// serialized.\n\tp.mtx.Lock()\n\tdefer p.mtx.Unlock()\n\n\tif height <= 0 || height > p.bs.Height() {\n\t\treturn ErrInvalidHeightValue\n\t}\n\tcurrentRetainHeight, err := p.stateStore.GetABCIResRetainHeight()\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\treturn err\n\t\t}\n\t\treturn p.stateStore.SaveABCIResRetainHeight(height)\n\t}\n\tif currentRetainHeight > height {\n\t\treturn ErrPrunerCannotLowerRetainHeight\n\t}\n\tif err := p.stateStore.SaveABCIResRetainHeight(height); err != nil {\n\t\treturn err\n\t}\n\tp.metrics.PruningServiceBlockResultsRetainHeight.Set(float64(height))\n\treturn nil\n}\n\n// GetApplicationRetainHeight is a convenience method for accessing the\n// GetApplicationRetainHeight method of the underlying state store.\nfunc (p *Pruner) GetApplicationRetainHeight() (int64, error) {\n\treturn p.stateStore.GetApplicationRetainHeight()\n}\n\n// GetCompanionBlockRetainHeight is a convenience method for accessing the\n// GetCompanionBlockRetainHeight method of the underlying state store.\nfunc (p *Pruner) GetCompanionBlockRetainHeight() (int64, error) {\n\treturn p.stateStore.GetCompanionBlockRetainHeight()\n}\n\n// GetABCIResRetainHeight is a convenience method for accessing the\n// GetABCIResRetainHeight method of the underlying state store.\nfunc (p *Pruner) GetABCIResRetainHeight() (int64, error) {\n\treturn p.stateStore.GetABCIResRetainHeight()\n}\n\nfunc (p *Pruner) pruneABCIResRoutine() {\n\tp.logger.Info(\"Started pruning ABCI results\", \"interval\", p.interval.String())\n\tlastABCIResRetainHeight := int64(0)\n\tfor {\n\t\tselect {\n\t\tcase <-p.Quit():\n\t\t\treturn\n\t\tdefault:\n\t\t\tnewABCIResRetainHeight := p.pruneABCIResToRetainHeight(lastABCIResRetainHeight)\n\t\t\tp.observer.PrunerPrunedABCIRes(&ABCIResponsesPrunedInfo{\n\t\t\t\tFromHeight: lastABCIResRetainHeight,\n\t\t\t\tToHeight: newABCIResRetainHeight - 1,\n\t\t\t})\n\t\t\tlastABCIResRetainHeight = newABCIResRetainHeight\n\t\t\ttime.Sleep(p.interval)\n\t\t}\n\t}\n}\n\nfunc (p *Pruner) pruneBlocksRoutine() {\n\tp.logger.Info(\"Started pruning blocks\", \"interval\", p.interval.String())\n\tlastRetainHeight := int64(0)\n\tfor {\n\t\tselect {\n\t\tcase <-p.Quit():\n\t\t\treturn\n\t\tdefault:\n\t\t\tnewRetainHeight := p.pruneBlocksToRetainHeight(lastRetainHeight)\n\t\t\tp.observer.PrunerPrunedBlocks(&BlocksPrunedInfo{\n\t\t\t\tFromHeight: lastRetainHeight,\n\t\t\t\tToHeight: newRetainHeight - 1,\n\t\t\t})\n\t\t\tlastRetainHeight = newRetainHeight\n\t\t\ttime.Sleep(p.interval)\n\t\t}\n\t}\n}\n\nfunc (p *Pruner) pruneBlocksToRetainHeight(lastRetainHeight int64) int64 {\n\ttargetRetainHeight := p.findMinBlockRetainHeight()\n\tif targetRetainHeight == lastRetainHeight {\n\t\treturn lastRetainHeight\n\t}\n\tpruned, evRetainHeight, err := p.pruneBlocks(targetRetainHeight)\n\t// The new retain height is the current lowest point of the block store\n\t// indicated by Base()\n\tnewRetainHeight := p.bs.Base()\n\tif err != nil {\n\t\tp.logger.Error(\"Failed to prune blocks\", \"err\", err, \"targetRetainHeight\", targetRetainHeight, \"newRetainHeight\", newRetainHeight)\n\t} else if pruned > 0 {\n\t\tp.metrics.BlockStoreBaseHeight.Set(float64(newRetainHeight))\n\t\tp.logger.Debug(\"Pruned blocks\", \"count\", pruned, \"evidenceRetainHeight\", evRetainHeight, \"newRetainHeight\", newRetainHeight)\n\t}\n\treturn newRetainHeight\n}\n\nfunc (p *Pruner) pruneABCIResToRetainHeight(lastRetainHeight int64) int64 {\n\ttargetRetainHeight, err := p.stateStore.GetABCIResRetainHeight()\n\tif err != nil {\n\t\t// ABCI response retain height has not yet been set - do not log any\n\t\t// errors at this time.\n\t\tif errors.Is(err, ErrKeyNotFound) {\n\t\t\treturn 0\n\t\t}\n\t\tp.logger.Error(\"Failed to get ABCI result retain height\", \"err\", err)\n\t\treturn lastRetainHeight\n\t}\n\n\tif lastRetainHeight == targetRetainHeight {\n\t\treturn lastRetainHeight\n\t}\n\n\t// newRetainHeight is the height just after that which we have successfully\n\t// pruned. In case of an error it will be 0, but then it will also be\n\t// ignored.\n\tnumPruned, newRetainHeight, err := p.stateStore.PruneABCIResponses(targetRetainHeight)\n\tif err != nil {\n\t\tp.logger.Error(\"Failed to prune ABCI responses\", \"err\", err, \"targetRetainHeight\", targetRetainHeight)\n\t\treturn lastRetainHeight\n\t}\n\tif numPruned > 0 {\n\t\tp.logger.Info(\"Pruned ABCI responses\", \"heights\", numPruned, \"newRetainHeight\", newRetainHeight)\n\t\tp.metrics.ABCIResultsBaseHeight.Set(float64(newRetainHeight))\n\t}\n\treturn newRetainHeight\n}\n\nfunc (p *Pruner) findMinBlockRetainHeight() int64 {\n\tappRetainHeight, err := p.stateStore.GetApplicationRetainHeight()\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\tp.logger.Error(\"Unexpected error fetching application retain height\", \"err\", err)\n\t\t\treturn 0\n\t\t}\n\t\t// If no application retain height has been set yet, we assume we need\n\t\t// to keep all blocks until the application tells us otherwise.\n\t\tappRetainHeight = 0\n\t}\n\t// We only care about the companion retain height if pruning is configured\n\t// to respect the companion's retain height.\n\tif !p.dcEnabled {\n\t\treturn appRetainHeight\n\t}\n\tdcRetainHeight, err := p.stateStore.GetCompanionBlockRetainHeight()\n\tif err != nil {\n\t\tif !errors.Is(err, ErrKeyNotFound) {\n\t\t\tp.logger.Error(\"Unexpected error fetching data companion retain height\", \"err\", err)\n\t\t\treturn 0\n\t\t}\n\t\t// We have no companion retain height set, but it is enabled, therefore\n\t\t// we cannot discard anything lower than the companion's configured\n\t\t// initial retain height.\n\t\tdcRetainHeight = p.dcInitBlockRetainHeight\n\t}\n\t// If we are here, both heights were set and the companion is enabled, so\n\t// we pick the minimum.\n\tif appRetainHeight < dcRetainHeight {\n\t\treturn appRetainHeight\n\t}\n\treturn dcRetainHeight\n}\n\nfunc (p *Pruner) pruneBlocks(height int64) (uint64, int64, error) {\n\tif height <= 0 {\n\t\treturn 0, 0, ErrInvalidRetainHeight\n\t}\n\n\tbase := p.bs.Base()\n\n\tstate, err := p.stateStore.Load()\n\tif err != nil {\n\t\treturn 0, 0, ErrPrunerFailedToLoadState{Err: err}\n\t}\n\tpruned, evRetainHeight, err := p.bs.PruneBlocks(height, state)\n\tif err != nil {\n\t\treturn 0, 0, ErrFailedToPruneBlocks{Height: height, Err: err}\n\t}\n\tif err := p.stateStore.PruneStates(base, height, evRetainHeight); err != nil {\n\t\treturn 0, 0, ErrFailedToPruneStates{Height: height, Err: err}\n\t}\n\treturn pruned, evRetainHeight, err\n}\n"}}
[Trace - 09:33:22.872 AM] Sending response 'window/workDoneProgress/create - (1)' in 19ms.
Result:
[Trace - 09:33:22.872 AM] Received notification '$/progress'.
Params: {"token":"8412593888844104124","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}
[Trace - 09:33:22.872 AM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///home/thane/work/informal/cometbft","section":"gopls"}]}
[Trace - 09:33:22.879 AM] Sending response 'workspace/configuration - (2)' in 6ms.
Result: [{"formatting.gofumpt":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"}]
[Trace - 09:33:22.888 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/08/18 09:33:22 go info for /home/thane/work/informal/cometbft\n(go dir /home/thane/work/informal/cometbft)\n(go version go version go1.21.0 linux/amd64)\n(valid build configuration = true)\n(build flags: [])\n(selected go env: [GO111MODULE=, GOCACHE=/home/thane/.cache/go-build, GOFLAGS=, GOMODCACHE=/home/thane/go/pkg/mod, GOPATH=/home/thane/go, GOPRIVATE=, GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.21.0/libexec, GOWORK=])\n\n"}
[Info - 09:33:22] 2023/08/18 09:33:22 go info for /home/thane/work/informal/cometbft
(go dir /home/thane/work/informal/cometbft)
(go version go version go1.21.0 linux/amd64)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=, GOCACHE=/home/thane/.cache/go-build, GOFLAGS=, GOMODCACHE=/home/thane/go/pkg/mod, GOPATH=/home/thane/go, GOPRIVATE=, GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.21.0/libexec, GOWORK=])
[Trace - 09:33:22.932 AM] Sending request 'textDocument/inlayHint - (1)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":80,"character":0},"end":{"line":243,"character":0}}}
[Trace - 09:33:22.960 AM] Sending request 'textDocument/documentLink - (2)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:23.068 AM] Sending request 'textDocument/codeAction - (3)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":157,"character":2},"end":{"line":157,"character":2}},"context":{"diagnostics":[],"triggerKind":2}}
[Trace - 09:33:23.068 AM] Sending request 'textDocument/semanticTokens/range - (4)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":110,"character":0},"end":{"line":213,"character":0}}}
[Trace - 09:33:23.090 AM] Sending notification '$/cancelRequest'.
Params: {"id":2}
[Trace - 09:33:23.134 AM] Sending request 'textDocument/documentLink - (5)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:23.164 AM] Sending notification '$/setTrace'.
Params: {"value":"verbose"}
[Trace - 09:33:23.245 AM] Sending request 'textDocument/foldingRange - (6)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:23.246 AM] Sending notification '$/cancelRequest'.
Params: {"id":3}
[Trace - 09:33:23.246 AM] Sending request 'textDocument/codeAction - (7)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":157,"character":2},"end":{"line":157,"character":2}},"context":{"diagnostics":[],"triggerKind":2}}
[Trace - 09:33:23.247 AM] Sending notification '$/cancelRequest'.
Params: {"id":7}
[Trace - 09:33:23.247 AM] Sending request 'textDocument/codeAction - (8)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":157,"character":2},"end":{"line":157,"character":2}},"context":{"diagnostics":[],"triggerKind":2}}
[Trace - 09:33:23.274 AM] Sending notification '$/setTrace'.
Params: {"value":"verbose"}
[Trace - 09:33:23.278 AM] Sending notification '$/setTrace'.
Params: {"value":"verbose"}
[Trace - 09:33:23.279 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/08/18 09:33:23 go/packages.Load #1\n\tsnapshot=0\n\tdirectory=file:///home/thane/work/informal/cometbft\n\tquery=[/home/thane/work/informal/cometbft/... builtin]\n\tpackages=337\n"}
[Info - 09:33:23] 2023/08/18 09:33:23 go/packages.Load #1
snapshot=0
directory=file:///home/thane/work/informal/cometbft
query=[/home/thane/work/informal/cometbft/... builtin]
packages=337
[Trace - 09:33:23.291 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/08/18 09:33:23 go/packages.Load #1: updating metadata for 866 packages\n"}
[Info - 09:33:23] 2023/08/18 09:33:23 go/packages.Load #1: updating metadata for 866 packages
[Trace - 09:33:23.344 AM] Sending request 'textDocument/semanticTokens/full - (9)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:23.367 AM] Received notification '$/progress'.
Params: {"token":"8412593888844104124","value":{"kind":"end","message":"Finished loading packages."}}
[Trace - 09:33:23.370 AM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/jsonrpc/server","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/merkle","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/tests","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/mempool","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/pkg/exec","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/pruning","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/os","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/loadtime/cmd","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/evidence/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/config","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/tempfile","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/internal/test","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server/services","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/progressbar","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/service","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/pkg","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/cmd/cometbft","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/scripts","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/types","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/autofile/cmd","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/block_results/v1","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/scripts/wal2json","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/xchacha20poly1305","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/types/time","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/consensus/types","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/pruning/v1","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/armor","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/statesync","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/p2p","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/cmap","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/sr25519","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/consensus","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/loadtime/cmd/report","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/generator","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/fuzz/tests","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/protoio","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proxy","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/crypto","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/fuzz/mempool","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/flowrate","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/version","kind":7},{"globPattern":"**/*.{go,mod,sum,work}","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/internal","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/pubsub/query/syntax","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/consensus","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/libs","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/node","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/client/local","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/blocksync","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/types","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/client/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/internal/indexer","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/rpc","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/tests/benchmarks/parallel","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/inspect","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/privval","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/cmd","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/test","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/bytes","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/client/http","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server/privileged","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/state","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server/services/versionservice","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/timer","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/p2p/pex","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/mempool","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/cmd/contract_tests","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer/block/kv","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer/sink","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/pubsub/query","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/core","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/fail","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/client/privileged","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/p2p","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/events","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/secp256k1","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/blocksync","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/provider/mock","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/pkg/infra/digitalocean","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/jsonrpc/test","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/bits","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/encoding","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/example/kvstore","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/txindex","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/server","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/tests/benchmarks/simple","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/log","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/pkg/infra/docker","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/scripts/metricsgen/metricsdiff","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proxy/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/strings","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/p2p/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/txindex/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/statesync","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer/sink/psql","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/tmhash","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/core/types","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/rand","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/internal/benchmarking","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/test","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/jsonrpc","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/version","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/math","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/autofile","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/provider","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/loadtime/payload","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/types/errors","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/inspect/rpc","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/node","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/libs/bits","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server/services/pruningservice","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/block/v1","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/scripts/metricsgen","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/block","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/fuzz","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/version","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/tests","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer/block/null","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/tests/benchmarks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/evidence","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/block_results","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/txindex/null","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/internal/rpctrace","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/client","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/store","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/cmd/cometbft/commands","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/scripts/json2wal","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/cli/flags","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/app","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server/services/blockservice","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/provider/http","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/proxy","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/services/version/v1","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/jsonrpc/client","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/batch","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/client/mock","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/p2p/mock","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/internal","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/txindex/kv","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/runner","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/loadtime","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/jsonrpc/types","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/store","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/async","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/cmd/abci-cli","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/privval","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/statesync/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/store/db","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/cmd/cometbft/commands/debug","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/cmd/priv_val_server","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/types","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/state/indexer/block","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/example","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/light/rpc/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/grpc/server/services/blockresultservice","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/sync","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/json","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/clist","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/proto/tendermint/store","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/ed25519","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/loadtime/report","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/types/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/tests/server","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/e2e/pkg/infra","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/crypto/xsalsa20symmetric","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/net","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/cli","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/client","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/cmd","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/client","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/abci/version","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/rpc/client/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/test/loadtime/cmd/load","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/mempool/mocks","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/p2p/conn","kind":7},{"globPattern":"/home/thane/work/informal/cometbft/libs/pubsub","kind":7}]}}]}
[Trace - 09:33:23.383 AM] Sending response 'client/registerCapability - (3)' in 12ms.
Result:
[Trace - 09:33:23.383 AM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}
[Trace - 09:33:23.385 AM] Sending response 'client/registerCapability - (4)' in 2ms.
Result:
[Trace - 09:33:23.400 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","diagnostics":[]}
[Trace - 09:33:23.472 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","version":1,"diagnostics":[]}
[Trace - 09:33:23.480 AM] Received response 'textDocument/inlayHint - (1)' in 548ms.
Result: null
[Error - Received] 09:33:23.481 AM #2 JSON RPC cancelled
[Error - Received] 09:33:23.481 AM #3 JSON RPC cancelled
[Error - Received] 09:33:23.481 AM #4 semantictokens are disabled
[Trace - 09:33:23.485 AM] Sending notification '$/setTrace'.
Params: {"value":"verbose"}
[Trace - 09:33:23.486 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":null}
[Error - 09:33:23] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:23.491 AM] Received response 'textDocument/documentLink - (5)' in 356ms.
Result: [{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":8}},"target":"https://pkg.go.dev/errors"},{"range":{"start":{"line":4,"character":2},"end":{"line":4,"character":6}},"target":"https://pkg.go.dev/sync"},{"range":{"start":{"line":5,"character":2},"end":{"line":5,"character":6}},"target":"https://pkg.go.dev/time"},{"range":{"start":{"line":7,"character":2},"end":{"line":7,"character":37}},"target":"https://pkg.go.dev/github.com/cometbft/cometbft/config"},{"range":{"start":{"line":8,"character":2},"end":{"line":8,"character":39}},"target":"https://pkg.go.dev/github.com/cometbft/cometbft/libs/log"},{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":43}},"target":"https://pkg.go.dev/github.com/cometbft/cometbft/libs/service"}]
[Trace - 09:33:23.491 AM] Received response 'textDocument/foldingRange - (6)' in 246ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":9,"endCharacter":44,"kind":"imports"},{"startLine":12,"startCharacter":5,"endLine":15,"endCharacter":65},{"startLine":18,"startCharacter":79,"endLine":21,"endCharacter":66,"kind":"comment"},{"startLine":22,"startCharacter":20,"endLine":40,"endCharacter":17},{"startLine":43,"startCharacter":26,"endLine":49,"endCharacter":40},{"startLine":52,"startCharacter":42,"endLine":58,"endCharacter":2},{"startLine":53,"startCharacter":22,"endLine":57,"endCharacter":25},{"startLine":63,"startCharacter":78,"endLine":66,"endCharacter":13,"kind":"comment"},{"startLine":67,"startCharacter":105,"endLine":72,"endCharacter":2},{"startLine":68,"startCharacter":31,"endLine":71,"endCharacter":65},{"startLine":75,"startCharacter":78,"endLine":76,"endCharacter":10,"kind":"comment"},{"startLine":77,"startCharacter":55,"endLine":78,"endCharacter":48},{"startLine":81,"startCharacter":58,"endLine":82,"endCharacter":50},{"startLine":85,"startCharacter":55,"endLine":88,"endCharacter":2},{"startLine":86,"startCharacter":31,"endLine":87,"endCharacter":21},{"startLine":91,"startCharacter":101,"endLine":108,"endCharacter":9},{"startLine":93,"startCharacter":30,"endLine":94,"endCharacter":10},{"startLine":96,"startCharacter":14,"endLine":105,"endCharacter":45},{"startLine":111,"startCharacter":50,"endLine":112,"endCharacter":17},{"startLine":115,"startCharacter":34,"endLine":119,"endCharacter":11},{"startLine":122,"startCharacter":75,"endLine":130,"endCharacter":10,"kind":"comment"},{"startLine":131,"startCharacter":70,"endLine":162,"endCharacter":11},{"startLine":132,"startCharacter":74,"endLine":133,"endCharacter":15,"kind":"comment"},{"startLine":137,"startCharacter":33,"endLine":138,"endCharacter":30},{"startLine":141,"startCharacter":16,"endLine":145,"endCharacter":33},{"startLine":142,"startCharacter":38,"endLine":143,"endCharacter":13},{"startLine":149,"startCharacter":16,"endLine":153,"endCharacter":34},{"startLine":150,"startCharacter":38,"endLine":151,"endCharacter":13},{"startLine":155,"startCharacter":108,"endLine":156,"endCharacter":41},{"startLine":158,"startCharacter":73,"endLine":159,"endCharacter":12},{"startLine":165,"startCharacter":54,"endLine":169,"endCharacter":12},{"startLine":166,"startCharacter":67,"endLine":167,"endCharacter":14},{"startLine":172,"startCharacter":78,"endLine":179,"endCharacter":75,"kind":"comment"},{"startLine":180,"startCharacter":63,"endLine":211,"endCharacter":11},{"startLine":181,"startCharacter":69,"endLine":182,"endCharacter":15,"kind":"comment"},{"startLine":186,"startCharacter":33,"endLine":187,"endCharacter":30},{"startLine":190,"startCharacter":16,"endLine":194,"endCharacter":39},{"startLine":191,"startCharacter":38,"endLine":192,"endCharacter":13},{"startLine":198,"startCharacter":16,"endLine":202,"endCharacter":28},{"startLine":199,"startCharacter":38,"endLine":200,"endCharacter":13},{"startLine":204,"startCharacter":102,"endLine":205,"endCharacter":41},{"startLine":207,"startCharacter":76,"endLine":208,"endCharacter":12},{"startLine":214,"startCharacter":68,"endLine":217,"endCharacter":18,"kind":"comment"},{"startLine":218,"startCharacter":61,"endLine":241,"endCharacter":11},{"startLine":219,"startCharacter":69,"endLine":220,"endCharacter":15,"kind":"comment"},{"startLine":224,"startCharacter":43,"endLine":225,"endCharacter":30},{"startLine":228,"startCharacter":16,"endLine":232,"endCharacter":53},{"startLine":229,"startCharacter":38,"endLine":230,"endCharacter":13},{"startLine":234,"startCharacter":34,"endLine":235,"endCharacter":41},{"startLine":237,"startCharacter":69,"endLine":238,"endCharacter":12},{"startLine":244,"startCharacter":71,"endLine":245,"endCharacter":67,"kind":"comment"},{"startLine":246,"startCharacter":62,"endLine":247,"endCharacter":49},{"startLine":250,"startCharacter":74,"endLine":251,"endCharacter":70,"kind":"comment"},{"startLine":252,"startCharacter":65,"endLine":253,"endCharacter":52},{"startLine":256,"startCharacter":67,"endLine":257,"endCharacter":63,"kind":"comment"},{"startLine":258,"startCharacter":58,"endLine":259,"endCharacter":45},{"startLine":262,"startCharacter":40,"endLine":278,"endCharacter":2},{"startLine":265,"startCharacter":6,"endLine":277,"endCharacter":3},{"startLine":266,"startCharacter":10,"endLine":276,"endCharacter":25},{"startLine":267,"startCharacter":18,"endLine":268,"endCharacter":9},{"startLine":269,"startCharacter":10,"endLine":276,"endCharacter":25},{"startLine":271,"startCharacter":34,"endLine":274,"endCharacter":4},{"startLine":271,"startCharacter":59,"endLine":273,"endCharacter":42},{"startLine":281,"startCharacter":39,"endLine":297,"endCharacter":2},{"startLine":284,"startCharacter":6,"endLine":296,"endCharacter":3},{"startLine":285,"startCharacter":10,"endLine":295,"endCharacter":25},{"startLine":286,"startCharacter":18,"endLine":287,"endCharacter":9},{"startLine":288,"startCharacter":10,"endLine":295,"endCharacter":25},{"startLine":290,"startCharacter":33,"endLine":293,"endCharacter":4},{"startLine":290,"startCharacter":51,"endLine":292,"endCharacter":35},{"startLine":300,"startCharacter":74,"endLine":315,"endCharacter":23},{"startLine":302,"startCharacter":44,"endLine":303,"endCharacter":25},{"startLine":306,"startCharacter":72,"endLine":307,"endCharacter":23,"kind":"comment"},{"startLine":309,"startCharacter":16,"endLine":310,"endCharacter":132},{"startLine":311,"startCharacter":23,"endLine":313,"endCharacter":126},{"startLine":318,"startCharacter":75,"endLine":346,"endCharacter":23},{"startLine":320,"startCharacter":16,"endLine":327,"endCharacter":25},{"startLine":321,"startCharacter":70,"endLine":322,"endCharacter":25,"kind":"comment"},{"startLine":323,"startCharacter":37,"endLine":324,"endCharacter":11},{"startLine":330,"startCharacter":44,"endLine":331,"endCharacter":25},{"startLine":334,"startCharacter":76,"endLine":336,"endCharacter":12,"kind":"comment"},{"startLine":338,"startCharacter":16,"endLine":340,"endCharacter":25},{"startLine":342,"startCharacter":19,"endLine":344,"endCharacter":63},{"startLine":349,"startCharacter":51,"endLine":381,"endCharacter":22},{"startLine":351,"startCharacter":16,"endLine":358,"endCharacter":21},{"startLine":352,"startCharacter":38,"endLine":354,"endCharacter":11},{"startLine":356,"startCharacter":72,"endLine":357,"endCharacter":65,"kind":"comment"},{"startLine":360,"startCharacter":75,"endLine":361,"endCharacter":45,"kind":"comment"},{"startLine":362,"startCharacter":18,"endLine":363,"endCharacter":24},{"startLine":366,"startCharacter":16,"endLine":374,"endCharacter":44},{"startLine":367,"startCharacter":38,"endLine":369,"endCharacter":11},{"startLine":371,"startCharacter":73,"endLine":373,"endCharacter":27,"kind":"comment"},{"startLine":376,"startCharacter":74,"endLine":377,"endCharacter":24,"kind":"comment"},{"startLine":378,"startCharacter":38,"endLine":379,"endCharacter":24},{"startLine":384,"startCharacter":67,"endLine":402,"endCharacter":35},{"startLine":385,"startCharacter":17,"endLine":386,"endCharacter":37},{"startLine":392,"startCharacter":16,"endLine":393,"endCharacter":51},{"startLine":396,"startCharacter":16,"endLine":397,"endCharacter":63},{"startLine":399,"startCharacter":79,"endLine":400,"endCharacter":63}]
[Error - Received] 09:33:23.491 AM #7 JSON RPC cancelled
[Trace - 09:33:23.560 AM] Sending request 'textDocument/codeLens - (10)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:23.565 AM] Received response 'textDocument/codeAction - (8)' in 317ms.
Result: null
[Error - Received] 09:33:23.565 AM #9 semantictokens are disabled
[Trace - 09:33:23.565 AM] Received request 'workspace/configuration - (5)'.
Params: {"items":[{"section":"gopls"}]}
[Error - 09:33:23] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:23.567 AM] Sending response 'workspace/configuration - (5)' in 1ms.
Result: [{"formatting.gofumpt":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"}]
[Trace - 09:33:23.567 AM] Received request 'workspace/configuration - (6)'.
Params: {"items":[{"scopeUri":"file:///home/thane/work/informal/cometbft","section":"gopls"}]}
[Trace - 09:33:23.568 AM] Sending response 'workspace/configuration - (6)' in 0ms.
Result: [{"formatting.gofumpt":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"}]
[Trace - 09:33:23.568 AM] Received response 'textDocument/codeLens - (10)' in 8ms.
Result: null
[Trace - 09:33:23.798 AM] Sending notification '$/setTrace'.
Params: {"value":"verbose"}
[Trace - 09:33:23.798 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":null}
[Trace - 09:33:23.798 AM] Received request 'workspace/configuration - (7)'.
Params: {"items":[{"section":"gopls"}]}
[Trace - 09:33:23.799 AM] Sending response 'workspace/configuration - (7)' in 1ms.
Result: [{"formatting.gofumpt":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"}]
[Trace - 09:33:23.799 AM] Received request 'workspace/configuration - (8)'.
Params: {"items":[{"scopeUri":"file:///home/thane/work/informal/cometbft","section":"gopls"}]}
[Trace - 09:33:23.800 AM] Sending response 'workspace/configuration - (8)' in 0ms.
Result: [{"formatting.gofumpt":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"}]
[Trace - 09:33:24.762 AM] Sending request 'textDocument/codeAction - (11)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":157,"character":2},"end":{"line":157,"character":2}},"context":{"diagnostics":[],"triggerKind":2}}
[Trace - 09:33:24.764 AM] Received response 'textDocument/codeAction - (11)' in 2ms.
Result: null
[Trace - 09:33:24.766 AM] Sending request 'textDocument/documentSymbol - (12)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:24.766 AM] Received response 'textDocument/documentSymbol - (12)' in 0ms.
Result: [{"name":"AppRetainHeightKey","kind":13,"range":{"start":{"line":13,"character":1},"end":{"line":13,"character":61}},"selectionRange":{"start":{"line":13,"character":1},"end":{"line":13,"character":19}}},{"name":"CompanionBlockRetainHeightKey","kind":13,"range":{"start":{"line":14,"character":1},"end":{"line":14,"character":65}},"selectionRange":{"start":{"line":14,"character":1},"end":{"line":14,"character":30}}},{"name":"ABCIResultsRetainHeightKey","kind":13,"range":{"start":{"line":15,"character":1},"end":{"line":15,"character":65}},"selectionRange":{"start":{"line":15,"character":1},"end":{"line":15,"character":27}}},{"name":"Pruner","detail":"struct{...}","kind":23,"range":{"start":{"line":22,"character":5},"end":{"line":41,"character":1}},"selectionRange":{"start":{"line":22,"character":5},"end":{"line":22,"character":11}},"children":[{"name":"BaseService","detail":"service.BaseService","kind":8,"range":{"start":{"line":23,"character":1},"end":{"line":23,"character":20}},"selectionRange":{"start":{"line":23,"character":9},"end":{"line":23,"character":20}}},{"name":"logger","detail":"log.Logger","kind":8,"range":{"start":{"line":24,"character":1},"end":{"line":24,"character":18}},"selectionRange":{"start":{"line":24,"character":1},"end":{"line":24,"character":7}}},{"name":"mtx","detail":"sync.Mutex","kind":8,"range":{"start":{"line":26,"character":1},"end":{"line":26,"character":15}},"selectionRange":{"start":{"line":26,"character":1},"end":{"line":26,"character":4}}},{"name":"dcEnabled","detail":"bool","kind":8,"range":{"start":{"line":28,"character":1},"end":{"line":28,"character":36}},"selectionRange":{"start":{"line":28,"character":1},"end":{"line":28,"character":10}}},{"name":"dcInitBlockRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":29,"character":1},"end":{"line":29,"character":37}},"selectionRange":{"start":{"line":29,"character":1},"end":{"line":29,"character":24}}},{"name":"dcInitBlockResultsRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":30,"character":1},"end":{"line":30,"character":37}},"selectionRange":{"start":{"line":30,"character":1},"end":{"line":30,"character":31}}},{"name":"bs","detail":"BlockStore","kind":8,"range":{"start":{"line":32,"character":1},"end":{"line":32,"character":14}},"selectionRange":{"start":{"line":32,"character":1},"end":{"line":32,"character":3}}},{"name":"stateStore","detail":"Store","kind":8,"range":{"start":{"line":34,"character":1},"end":{"line":34,"character":17}},"selectionRange":{"start":{"line":34,"character":1},"end":{"line":34,"character":11}}},{"name":"interval","detail":"time.Duration","kind":8,"range":{"start":{"line":36,"character":1},"end":{"line":36,"character":23}},"selectionRange":{"start":{"line":36,"character":1},"end":{"line":36,"character":9}}},{"name":"observer","detail":"PrunerObserver","kind":8,"range":{"start":{"line":38,"character":1},"end":{"line":38,"character":24}},"selectionRange":{"start":{"line":38,"character":1},"end":{"line":38,"character":9}}},{"name":"metrics","detail":"*Metrics","kind":8,"range":{"start":{"line":40,"character":1},"end":{"line":40,"character":17}},"selectionRange":{"start":{"line":40,"character":1},"end":{"line":40,"character":8}}}]},{"name":"prunerConfig","detail":"struct{...}","kind":23,"range":{"start":{"line":43,"character":5},"end":{"line":50,"character":1}},"selectionRange":{"start":{"line":43,"character":5},"end":{"line":43,"character":17}},"children":[{"name":"dcEnabled","detail":"bool","kind":8,"range":{"start":{"line":44,"character":1},"end":{"line":44,"character":36}},"selectionRange":{"start":{"line":44,"character":1},"end":{"line":44,"character":10}}},{"name":"dcInitBlockRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":45,"character":1},"end":{"line":45,"character":37}},"selectionRange":{"start":{"line":45,"character":1},"end":{"line":45,"character":24}}},{"name":"dcInitBlockResultsRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":46,"character":1},"end":{"line":46,"character":37}},"selectionRange":{"start":{"line":46,"character":1},"end":{"line":46,"character":31}}},{"name":"interval","detail":"time.Duration","kind":8,"range":{"start":{"line":47,"character":1},"end":{"line":47,"character":45}},"selectionRange":{"start":{"line":47,"character":1},"end":{"line":47,"character":9}}},{"name":"observer","detail":"PrunerObserver","kind":8,"range":{"start":{"line":48,"character":1},"end":{"line":48,"character":46}},"selectionRange":{"start":{"line":48,"character":1},"end":{"line":48,"character":9}}},{"name":"metrics","detail":"*Metrics","kind":8,"range":{"start":{"line":49,"character":1},"end":{"line":49,"character":40}},"selectionRange":{"start":{"line":49,"character":1},"end":{"line":49,"character":8}}}]},{"name":"defaultPrunerConfig","detail":"func() *prunerConfig","kind":12,"range":{"start":{"line":52,"character":0},"end":{"line":59,"character":1}},"selectionRange":{"start":{"line":52,"character":5},"end":{"line":52,"character":24}}},{"name":"PrunerOption","detail":"func(*prunerConfig)","kind":12,"range":{"start":{"line":61,"character":5},"end":{"line":61,"character":37}},"selectionRange":{"start":{"line":61,"character":5},"end":{"line":61,"character":17}}},{"name":"WithPrunerCompanionEnabled","detail":"func(initBlockRetainHeight, initBlockResultsRetainHeight int64) PrunerOption","kind":12,"range":{"start":{"line":67,"character":0},"end":{"line":73,"character":1}},"selectionRange":{"start":{"line":67,"character":5},"end":{"line":67,"character":31}}},{"name":"WithPrunerInterval","detail":"func(t time.Duration) PrunerOption","kind":12,"range":{"start":{"line":77,"character":0},"end":{"line":79,"character":1}},"selectionRange":{"start":{"line":77,"character":5},"end":{"line":77,"character":23}}},{"name":"WithPrunerObserver","detail":"func(obs PrunerObserver) PrunerOption","kind":12,"range":{"start":{"line":81,"character":0},"end":{"line":83,"character":1}},"selectionRange":{"start":{"line":81,"character":5},"end":{"line":81,"character":23}}},{"name":"WithPrunerMetrics","detail":"func(metrics *Metrics) PrunerOption","kind":12,"range":{"start":{"line":85,"character":0},"end":{"line":89,"character":1}},"selectionRange":{"start":{"line":85,"character":5},"end":{"line":85,"character":22}}},{"name":"NewPruner","detail":"func(stateStore Store, bs BlockStore, logger log.Logger, options ...PrunerOption) *Pruner","kind":12,"range":{"start":{"line":91,"character":0},"end":{"line":109,"character":1}},"selectionRange":{"start":{"line":91,"character":5},"end":{"line":91,"character":14}}},{"name":"(*Pruner).SetObserver","detail":"func(obs PrunerObserver)","kind":6,"range":{"start":{"line":111,"character":0},"end":{"line":113,"character":1}},"selectionRange":{"start":{"line":111,"character":17},"end":{"line":111,"character":28}}},{"name":"(*Pruner).OnStart","detail":"func() error","kind":6,"range":{"start":{"line":115,"character":0},"end":{"line":120,"character":1}},"selectionRange":{"start":{"line":115,"character":17},"end":{"line":115,"character":24}}},{"name":"(*Pruner).SetApplicationBlockRetainHeight","detail":"func(height int64) error","kind":6,"range":{"start":{"line":131,"character":0},"end":{"line":163,"character":1}},"selectionRange":{"start":{"line":131,"character":17},"end":{"line":131,"character":48}}},{"name":"(*Pruner).checkHeightBound","detail":"func(height int64) bool","kind":6,"range":{"start":{"line":165,"character":0},"end":{"line":170,"character":1}},"selectionRange":{"start":{"line":165,"character":17},"end":{"line":165,"character":33}}},{"name":"(*Pruner).SetCompanionRetainHeight","detail":"func(height int64) error","kind":6,"range":{"start":{"line":180,"character":0},"end":{"line":212,"character":1}},"selectionRange":{"start":{"line":180,"character":17},"end":{"line":180,"character":41}}},{"name":"(*Pruner).SetABCIResRetainHeight","detail":"func(height int64) error","kind":6,"range":{"start":{"line":218,"character":0},"end":{"line":242,"character":1}},"selectionRange":{"start":{"line":218,"character":17},"end":{"line":218,"character":39}}},{"name":"(*Pruner).GetApplicationRetainHeight","detail":"func() (int64, error)","kind":6,"range":{"start":{"line":246,"character":0},"end":{"line":248,"character":1}},"selectionRange":{"start":{"line":246,"character":17},"end":{"line":246,"character":43}}},{"name":"(*Pruner).GetCompanionBlockRetainHeight","detail":"func() (int64, error)","kind":6,"range":{"start":{"line":252,"character":0},"end":{"line":254,"character":1}},"selectionRange":{"start":{"line":252,"character":17},"end":{"line":252,"character":46}}},{"name":"(*Pruner).GetABCIResRetainHeight","detail":"func() (int64, error)","kind":6,"range":{"start":{"line":258,"character":0},"end":{"line":260,"character":1}},"selectionRange":{"start":{"line":258,"character":17},"end":{"line":258,"character":39}}},{"name":"(*Pruner).pruneABCIResRoutine","detail":"func()","kind":6,"range":{"start":{"line":262,"character":0},"end":{"line":279,"character":1}},"selectionRange":{"start":{"line":262,"character":17},"end":{"line":262,"character":36}}},{"name":"(*Pruner).pruneBlocksRoutine","detail":"func()","kind":6,"range":{"start":{"line":281,"character":0},"end":{"line":298,"character":1}},"selectionRange":{"start":{"line":281,"character":17},"end":{"line":281,"character":35}}},{"name":"(*Pruner).pruneBlocksToRetainHeight","detail":"func(lastRetainHeight int64) int64","kind":6,"range":{"start":{"line":300,"character":0},"end":{"line":316,"character":1}},"selectionRange":{"start":{"line":300,"character":17},"end":{"line":300,"character":42}}},{"name":"(*Pruner).pruneABCIResToRetainHeight","detail":"func(lastRetainHeight int64) int64","kind":6,"range":{"start":{"line":318,"character":0},"end":{"line":347,"character":1}},"selectionRange":{"start":{"line":318,"character":17},"end":{"line":318,"character":43}}},{"name":"(*Pruner).findMinBlockRetainHeight","detail":"func() int64","kind":6,"range":{"start":{"line":349,"character":0},"end":{"line":382,"character":1}},"selectionRange":{"start":{"line":349,"character":17},"end":{"line":349,"character":41}}},{"name":"(*Pruner).pruneBlocks","detail":"func(height int64) (uint64, int64, error)","kind":6,"range":{"start":{"line":384,"character":0},"end":{"line":403,"character":1}},"selectionRange":{"start":{"line":384,"character":17},"end":{"line":384,"character":28}}}]
[Trace - 09:33:27.431 AM] Sending request 'textDocument/inlayHint - (13)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":85,"character":0},"end":{"line":248,"character":1}}}
[Trace - 09:33:27.433 AM] Received response 'textDocument/inlayHint - (13)' in 1ms.
Result: null
[Trace - 09:33:27.477 AM] Sending request 'textDocument/inlayHint - (14)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":88,"character":0},"end":{"line":251,"character":13}}}
[Trace - 09:33:27.477 AM] Received response 'textDocument/inlayHint - (14)' in 0ms.
Result: null
[Trace - 09:33:27.586 AM] Sending request 'textDocument/semanticTokens/range - (15)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":118,"character":0},"end":{"line":221,"character":13}}}
[Error - Received] 09:33:27.586 AM #15 semantictokens are disabled
[Error - 09:33:27] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:28.172 AM] Sending request 'textDocument/inlayHint - (16)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":91,"character":0},"end":{"line":253,"character":0}}}
[Trace - 09:33:28.173 AM] Received response 'textDocument/inlayHint - (16)' in 0ms.
Result: null
[Trace - 09:33:28.287 AM] Sending request 'textDocument/semanticTokens/range - (17)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":121,"character":0},"end":{"line":223,"character":0}}}
[Error - Received] 09:33:28.287 AM #17 semantictokens are disabled
[Error - 09:33:28] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:28.666 AM] Sending request 'textDocument/inlayHint - (18)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":96,"character":0},"end":{"line":259,"character":38}}}
[Trace - 09:33:28.666 AM] Received response 'textDocument/inlayHint - (18)' in 0ms.
Result: null
[Trace - 09:33:28.779 AM] Sending request 'textDocument/semanticTokens/range - (19)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":126,"character":0},"end":{"line":229,"character":38}}}
[Error - Received] 09:33:28.780 AM #19 semantictokens are disabled
[Error - 09:33:28] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:29.423 AM] Sending request 'textDocument/hover - (20)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"position":{"line":180,"character":27}}
[Trace - 09:33:29.424 AM] Received response 'textDocument/hover - (20)' in 1ms.
Result: {"contents":{"kind":"markdown","value":"```go\nfunc (*Pruner).SetCompanionRetainHeight(height int64) error\n```\n\nSetCompanionRetainHeight sets the application retain height with some basic checks on the requested height.\n\nIf a higher retain height is already set, we cannot accept the requested height because the blocks might have been pruned.\n\nIf the application has already set a retain height to a higher value we also cannot accept the requested height as the blocks might have been pruned.\n\n\n[`(state.Pruner).SetCompanionRetainHeight` on pkg.go.dev](https://pkg.go.dev/github.com/cometbft/cometbft/state#Pruner.SetCompanionRetainHeight)"},"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":41}}}
[Trace - 09:33:29.652 AM] Sending request 'textDocument/hover - (21)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"position":{"line":181,"character":23}}
[Trace - 09:33:29.652 AM] Received response 'textDocument/hover - (21)' in 0ms.
Result: null
[Trace - 09:33:29.824 AM] Sending request 'textDocument/hover - (22)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"position":{"line":180,"character":26}}
[Trace - 09:33:29.825 AM] Received response 'textDocument/hover - (22)' in 1ms.
Result: {"contents":{"kind":"markdown","value":"```go\nfunc (*Pruner).SetCompanionRetainHeight(height int64) error\n```\n\nSetCompanionRetainHeight sets the application retain height with some basic checks on the requested height.\n\nIf a higher retain height is already set, we cannot accept the requested height because the blocks might have been pruned.\n\nIf the application has already set a retain height to a higher value we also cannot accept the requested height as the blocks might have been pruned.\n\n\n[`(state.Pruner).SetCompanionRetainHeight` on pkg.go.dev](https://pkg.go.dev/github.com/cometbft/cometbft/state#Pruner.SetCompanionRetainHeight)"},"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":41}}}
[Trace - 09:33:29.870 AM] Sending request 'textDocument/documentHighlight - (23)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"position":{"line":180,"character":26}}
[Trace - 09:33:29.870 AM] Received response 'textDocument/documentHighlight - (23)' in 0ms.
Result: [{"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":41}},"kind":1}]
[Trace - 09:33:30.130 AM] Sending request 'textDocument/codeAction - (24)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":180,"character":26},"end":{"line":180,"character":26}},"context":{"diagnostics":[],"triggerKind":2}}
[Trace - 09:33:30.133 AM] Received response 'textDocument/codeAction - (24)' in 3ms.
Result: null
[Trace - 09:33:32.014 AM] Sending request 'textDocument/prepareRename - (25)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"position":{"line":180,"character":26}}
[Trace - 09:33:32.014 AM] Received response 'textDocument/prepareRename - (25)' in 0ms.
Result: {"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":41}},"placeholder":"SetCompanionRetainHeight"}
[Trace - 09:33:36.333 AM] Sending request 'textDocument/rename - (26)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"position":{"line":180,"character":26},"newName":"SetCompanionBlockRetainHeight"}
[Trace - 09:33:36.494 AM] Received response 'textDocument/rename - (26)' in 161ms.
Result: {"documentChanges":[{"textDocument":{"version":1,"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"edits":[{"range":{"start":{"line":137,"character":7},"end":{"line":137,"character":23}},"newText":"SetCompanionBlockRetainHeight"},{"range":{"start":{"line":165,"character":17},"end":{"line":165,"character":33}},"newText":"SetCompanionBlockRetainHeight"},{"range":{"start":{"line":172,"character":3},"end":{"line":172,"character":27}},"newText":"SetCompanionBlockRetainHeight"},{"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":41}},"newText":"SetCompanionBlockRetainHeight"},{"range":{"start":{"line":186,"character":7},"end":{"line":186,"character":23}},"newText":"SetCompanionBlockRetainHeight"}]},{"textDocument":{"version":0,"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"},"edits":[{"range":{"start":{"line":304,"character":14},"end":{"line":304,"character":38}},"newText":"SetCompanionBlockRetainHeight"}]}]}
[Trace - 09:33:36.511 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","languageId":"go","version":1,"text":"package state_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\n\tdbm \"github.com/cometbft/cometbft-db\"\n\n\tabci \"github.com/cometbft/cometbft/abci/types\"\n\t\"github.com/cometbft/cometbft/crypto\"\n\t\"github.com/cometbft/cometbft/crypto/ed25519\"\n\t\"github.com/cometbft/cometbft/internal/test\"\n\t\"github.com/cometbft/cometbft/libs/log\"\n\tcmtrand \"github.com/cometbft/cometbft/libs/rand\"\n\tcmtstate \"github.com/cometbft/cometbft/proto/tendermint/state\"\n\tsm \"github.com/cometbft/cometbft/state\"\n\t\"github.com/cometbft/cometbft/store\"\n\t\"github.com/cometbft/cometbft/types\"\n)\n\nfunc TestStoreLoadValidators(t *testing.T) {\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tval, _ := types.RandValidator(true, 10)\n\tvals := types.NewValidatorSet([]*types.Validator{val})\n\n\t// 1) LoadValidators loads validators using a height where they were last changed\n\terr := sm.SaveValidatorsInfo(stateDB, 1, 1, vals)\n\trequire.NoError(t, err)\n\terr = sm.SaveValidatorsInfo(stateDB, 2, 1, vals)\n\trequire.NoError(t, err)\n\tloadedVals, err := stateStore.LoadValidators(2)\n\trequire.NoError(t, err)\n\tassert.NotZero(t, loadedVals.Size())\n\n\t// 2) LoadValidators loads validators using a checkpoint height\n\n\terr = sm.SaveValidatorsInfo(stateDB, sm.ValSetCheckpointInterval, 1, vals)\n\trequire.NoError(t, err)\n\n\tloadedVals, err = stateStore.LoadValidators(sm.ValSetCheckpointInterval)\n\trequire.NoError(t, err)\n\tassert.NotZero(t, loadedVals.Size())\n}\n\nfunc BenchmarkLoadValidators(b *testing.B) {\n\tconst valSetSize = 100\n\n\tconfig := test.ResetTestRoot(\"state_\")\n\tdefer os.RemoveAll(config.RootDir)\n\tdbType := dbm.BackendType(config.DBBackend)\n\tstateDB, err := dbm.NewDB(\"state\", dbType, config.DBDir())\n\trequire.NoError(b, err)\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tstate, err := stateStore.LoadFromDBOrGenesisFile(config.GenesisFile())\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\n\tstate.Validators = genValSet(valSetSize)\n\tstate.NextValidators = state.Validators.CopyIncrementProposerPriority(1)\n\terr = stateStore.Save(state)\n\trequire.NoError(b, err)\n\n\tfor i := 10; i < 10000000000; i *= 10 { // 10, 100, 1000, ...\n\t\ti := i\n\t\tif err := sm.SaveValidatorsInfo(stateDB,\n\t\t\tint64(i), state.LastHeightValidatorsChanged, state.NextValidators); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\n\t\tb.Run(fmt.Sprintf(\"height=%d\", i), func(b *testing.B) {\n\t\t\tfor n := 0; n < b.N; n++ {\n\t\t\t\t_, err := stateStore.LoadValidators(int64(i))\n\t\t\t\tif err != nil {\n\t\t\t\t\tb.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPruneStates(t *testing.T) {\n\ttestcases := map[string]struct {\n\t\tmakeHeights int64\n\t\tpruneFrom int64\n\t\tpruneTo int64\n\t\tevidenceThresholdHeight int64\n\t\texpectErr bool\n\t\texpectVals []int64\n\t\texpectParams []int64\n\t\texpectABCI []int64\n\t}{\n\t\t\"error on pruning from 0\": {100, 0, 5, 100, true, nil, nil, nil},\n\t\t\"error when from > to\": {100, 3, 2, 2, true, nil, nil, nil},\n\t\t\"error when from == to\": {100, 3, 3, 3, true, nil, nil, nil},\n\t\t\"error when to does not exist\": {100, 1, 101, 101, true, nil, nil, nil},\n\t\t\"prune all\": {100, 1, 100, 100, false, []int64{93, 100}, []int64{95, 100}, []int64{100}},\n\t\t\"prune some\": {\n\t\t\t10, 2, 8, 8, false,\n\t\t\t[]int64{1, 3, 8, 9, 10},\n\t\t\t[]int64{1, 5, 8, 9, 10},\n\t\t\t[]int64{1, 8, 9, 10},\n\t\t},\n\t\t\"prune across checkpoint\": {\n\t\t\t100001, 1, 100001, 100001, false,\n\t\t\t[]int64{99993, 100000, 100001},\n\t\t\t[]int64{99995, 100001},\n\t\t\t[]int64{100001},\n\t\t},\n\t\t\"prune when evidence height < height\": {20, 1, 18, 17, false, []int64{13, 17, 18, 19, 20}, []int64{15, 18, 19, 20}, []int64{18, 19, 20}},\n\t}\n\tfor name, tc := range testcases {\n\t\ttc := tc\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tdb := dbm.NewMemDB()\n\t\t\tstateStore := sm.NewStore(db, sm.StoreOptions{\n\t\t\t\tDiscardABCIResponses: false,\n\t\t\t})\n\t\t\tpk := ed25519.GenPrivKey().PubKey()\n\n\t\t\t// Generate a bunch of state data. Validators change for heights ending with 3, and\n\t\t\t// parameters when ending with 5.\n\t\t\tvalidator := &types.Validator{Address: cmtrand.Bytes(crypto.AddressSize), VotingPower: 100, PubKey: pk}\n\t\t\tvalidatorSet := &types.ValidatorSet{\n\t\t\t\tValidators: []*types.Validator{validator},\n\t\t\t\tProposer: validator,\n\t\t\t}\n\t\t\tvalsChanged := int64(0)\n\t\t\tparamsChanged := int64(0)\n\n\t\t\tfor h := int64(1); h <= tc.makeHeights; h++ {\n\t\t\t\tif valsChanged == 0 || h%10 == 2 {\n\t\t\t\t\tvalsChanged = h + 1 // Have to add 1, since NextValidators is what's stored\n\t\t\t\t}\n\t\t\t\tif paramsChanged == 0 || h%10 == 5 {\n\t\t\t\t\tparamsChanged = h\n\t\t\t\t}\n\n\t\t\t\tstate := sm.State{\n\t\t\t\t\tInitialHeight: 1,\n\t\t\t\t\tLastBlockHeight: h - 1,\n\t\t\t\t\tValidators: validatorSet,\n\t\t\t\t\tNextValidators: validatorSet,\n\t\t\t\t\tConsensusParams: types.ConsensusParams{\n\t\t\t\t\t\tBlock: types.BlockParams{MaxBytes: 10e6},\n\t\t\t\t\t},\n\t\t\t\t\tLastHeightValidatorsChanged: valsChanged,\n\t\t\t\t\tLastHeightConsensusParamsChanged: paramsChanged,\n\t\t\t\t}\n\n\t\t\t\tif state.LastBlockHeight >= 1 {\n\t\t\t\t\tstate.LastValidators = state.Validators\n\t\t\t\t}\n\n\t\t\t\terr := stateStore.Save(state)\n\t\t\t\trequire.NoError(t, err)\n\n\t\t\t\terr = stateStore.SaveFinalizeBlockResponse(h, &abci.ResponseFinalizeBlock{\n\t\t\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t\t\t{Data: []byte{1}},\n\t\t\t\t\t\t{Data: []byte{2}},\n\t\t\t\t\t\t{Data: []byte{3}},\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\trequire.NoError(t, err)\n\t\t\t}\n\n\t\t\t// Test assertions\n\t\t\terr := stateStore.PruneStates(tc.pruneFrom, tc.pruneTo, tc.evidenceThresholdHeight)\n\t\t\tif tc.expectErr {\n\t\t\t\trequire.Error(t, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\trequire.NoError(t, err)\n\n\t\t\texpectVals := sliceToMap(tc.expectVals)\n\t\t\texpectParams := sliceToMap(tc.expectParams)\n\t\t\texpectABCI := sliceToMap(tc.expectABCI)\n\n\t\t\tfor h := int64(1); h <= tc.makeHeights; h++ {\n\t\t\t\tvals, err := stateStore.LoadValidators(h)\n\t\t\t\tif expectVals[h] {\n\t\t\t\t\trequire.NoError(t, err, \"validators height %v\", h)\n\t\t\t\t\trequire.NotNil(t, vals)\n\t\t\t\t} else {\n\t\t\t\t\trequire.Error(t, err, \"validators height %v\", h)\n\t\t\t\t\trequire.Equal(t, sm.ErrNoValSetForHeight{Height: h}, err)\n\t\t\t\t}\n\n\t\t\t\tparams, err := stateStore.LoadConsensusParams(h)\n\t\t\t\tif expectParams[h] {\n\t\t\t\t\trequire.NoError(t, err, \"params height %v\", h)\n\t\t\t\t\trequire.NotEmpty(t, params)\n\t\t\t\t} else {\n\t\t\t\t\trequire.Error(t, err, \"params height %v\", h)\n\t\t\t\t\trequire.Empty(t, params)\n\t\t\t\t}\n\n\t\t\t\tabci, err := stateStore.LoadFinalizeBlockResponse(h)\n\t\t\t\tif expectABCI[h] {\n\t\t\t\t\trequire.NoError(t, err, \"abci height %v\", h)\n\t\t\t\t\trequire.NotNil(t, abci)\n\t\t\t\t} else {\n\t\t\t\t\trequire.Error(t, err, \"abci height %v\", h)\n\t\t\t\t\trequire.Equal(t, sm.ErrNoABCIResponsesForHeight{Height: h}, err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestTxResultsHash(t *testing.T) {\n\ttxResults := []*abci.ExecTxResult{\n\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t}\n\n\troot := sm.TxResultsHash(txResults)\n\n\t// root should be Merkle tree root of ExecTxResult responses\n\tresults := types.NewResults(txResults)\n\tassert.Equal(t, root, results.Hash())\n\n\t// test we can prove first ExecTxResult\n\tproof := results.ProveResult(0)\n\tbz, err := results[0].Marshal()\n\trequire.NoError(t, err)\n\tassert.NoError(t, proof.Verify(root, bz))\n}\n\nfunc sliceToMap(s []int64) map[int64]bool {\n\tm := make(map[int64]bool, len(s))\n\tfor _, i := range s {\n\t\tm[i] = true\n\t}\n\treturn m\n}\n\nfunc makeStateAndBlockStore() (sm.State, *store.BlockStore, func(), sm.Store) {\n\tconfig := test.ResetTestRoot(\"blockchain_reactor_test\")\n\tblockDB := dbm.NewMemDB()\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tstate, err := stateStore.LoadFromDBOrGenesisFile(config.GenesisFile())\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"error constructing state from genesis file: %w\", err))\n\t}\n\treturn state, store.NewBlockStore(blockDB), func() { os.RemoveAll(config.RootDir) }, stateStore\n}\n\nfunc fillStore(t *testing.T, height int64, stateStore sm.Store, bs *store.BlockStore, state sm.State, response1 *abci.ResponseFinalizeBlock) {\n\tif response1 != nil {\n\t\tfor h := int64(1); h <= height; h++ {\n\t\t\terr := stateStore.SaveFinalizeBlockResponse(h, response1)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\t// search for the last finalize block response and check if it has saved.\n\t\tlastResponse, err := stateStore.LoadLastFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the saved response height is the same as the loaded height.\n\t\tassert.Equal(t, lastResponse, response1)\n\t\t// check if the abci response didnt save in the abciresponses.\n\t\tresponses, err := stateStore.LoadFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err, responses)\n\t\trequire.Equal(t, response1, responses)\n\t}\n\tb1 := state.MakeBlock(state.LastBlockHeight+1, test.MakeNTxs(state.LastBlockHeight+1, 10), new(types.Commit), nil, nil)\n\tpartSet, err := b1.MakePartSet(2)\n\trequire.NoError(t, err)\n\tbs.SaveBlock(b1, partSet, &types.Commit{Height: state.LastBlockHeight + 1})\n}\n\nfunc TestSaveRetainHeight(t *testing.T) {\n\tstate, bs, callbackF, stateStore := makeStateAndBlockStore()\n\tdefer callbackF()\n\theight := int64(10)\n\tstate.LastBlockHeight = height - 1\n\n\tfillStore(t, height, stateStore, bs, state, nil)\n\n\tpruner := sm.NewPruner(stateStore, bs, log.TestingLogger())\n\n\t// We should not save a height that is 0\n\terr := pruner.SetApplicationBlockRetainHeight(0)\n\trequire.Error(t, err)\n\n\t// We should not save a height above the blockstore's height\n\terr = pruner.SetApplicationBlockRetainHeight(11)\n\trequire.Error(t, err)\n\n\terr = pruner.SetApplicationBlockRetainHeight(10)\n\trequire.NoError(t, err)\n\n\terr = pruner.SetCompanionRetainHeight(10)\n\trequire.NoError(t, err)\n}\n\nfunc TestMinRetainHeight(t *testing.T) {\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tpruner := sm.NewPruner(stateStore, nil, log.TestingLogger())\n\tminHeight := pruner.FindMinRetainHeight()\n\trequire.Equal(t, minHeight, int64(0))\n\n\terr := stateStore.SaveApplicationRetainHeight(10)\n\trequire.NoError(t, err)\n\tminHeight = pruner.FindMinRetainHeight()\n\trequire.Equal(t, minHeight, int64(10))\n\n\terr = stateStore.SaveCompanionBlockRetainHeight(11)\n\trequire.NoError(t, err)\n\tminHeight = pruner.FindMinRetainHeight()\n\trequire.Equal(t, minHeight, int64(10))\n}\n\nfunc TestABCIResPruningStandalone(t *testing.T) {\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\n\tresponses, err := stateStore.LoadFinalizeBlockResponse(1)\n\trequire.Error(t, err)\n\trequire.Nil(t, responses)\n\t// stub the abciresponses.\n\tresponse1 := &abci.ResponseFinalizeBlock{\n\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t\t},\n\t}\n\t_, bs, callbackF, stateStore := makeStateAndBlockStore()\n\tdefer callbackF()\n\n\tfor height := int64(1); height <= 10; height++ {\n\t\terr := stateStore.SaveFinalizeBlockResponse(height, response1)\n\t\trequire.NoError(t, err)\n\t}\n\tpruner := sm.NewPruner(stateStore, bs, log.TestingLogger())\n\n\tretainHeight := int64(2)\n\terr = stateStore.SaveABCIResRetainHeight(retainHeight)\n\trequire.NoError(t, err)\n\tabciResRetainHeight, err := stateStore.GetABCIResRetainHeight()\n\trequire.NoError(t, err)\n\trequire.Equal(t, retainHeight, abciResRetainHeight)\n\tnewRetainHeight := pruner.PruneABCIResToRetainHeight(0)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\t_, err = stateStore.LoadFinalizeBlockResponse(1)\n\trequire.Error(t, err)\n\n\tfor h := retainHeight; h <= 10; h++ {\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(h)\n\t\trequire.NoError(t, err)\n\t}\n\n\t// This should not have any impact because the retain height is still 2 and we will not prune blocks to 3\n\tnewRetainHeight = pruner.PruneABCIResToRetainHeight(3)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\tretainHeight = 3\n\terr = stateStore.SaveABCIResRetainHeight(retainHeight)\n\trequire.NoError(t, err)\n\tnewRetainHeight = pruner.PruneABCIResToRetainHeight(2)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\t_, err = stateStore.LoadFinalizeBlockResponse(2)\n\trequire.Error(t, err)\n\tfor h := retainHeight; h <= 10; h++ {\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(h)\n\t\trequire.NoError(t, err)\n\t}\n\n\tretainHeight = 10\n\terr = stateStore.SaveABCIResRetainHeight(retainHeight)\n\trequire.NoError(t, err)\n\tnewRetainHeight = pruner.PruneABCIResToRetainHeight(2)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\tfor h := int64(0); h < 10; h++ {\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(h)\n\t\trequire.Error(t, err)\n\t}\n\t_, err = stateStore.LoadFinalizeBlockResponse(10)\n\trequire.NoError(t, err)\n}\n\ntype prunerObserver struct {\n\tsm.NoopPrunerObserver\n\tprunedABCIResInfoCh chan *sm.ABCIResponsesPrunedInfo\n\tprunedBlocksResInfoCh chan *sm.BlocksPrunedInfo\n}\n\nfunc newPrunerObserver(infoChCap int) *prunerObserver {\n\treturn &prunerObserver{\n\t\tprunedABCIResInfoCh: make(chan *sm.ABCIResponsesPrunedInfo, infoChCap),\n\t\tprunedBlocksResInfoCh: make(chan *sm.BlocksPrunedInfo, infoChCap),\n\t}\n}\n\nfunc (o *prunerObserver) PrunerPrunedABCIRes(info *sm.ABCIResponsesPrunedInfo) {\n\to.prunedABCIResInfoCh <- info\n}\n\nfunc (o *prunerObserver) PrunerPrunedBlocks(info *sm.BlocksPrunedInfo) {\n\to.prunedBlocksResInfoCh <- info\n}\n\nfunc TestFinalizeBlockResponsePruning(t *testing.T) {\n\tt.Run(\"Persisting responses\", func(t *testing.T) {\n\t\tstateDB := dbm.NewMemDB()\n\t\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\t\tDiscardABCIResponses: false,\n\t\t})\n\t\tresponses, err := stateStore.LoadFinalizeBlockResponse(1)\n\t\trequire.Error(t, err)\n\t\trequire.Nil(t, responses)\n\t\t// stub the abciresponses.\n\t\tresponse1 := &abci.ResponseFinalizeBlock{\n\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t\t\t},\n\t\t}\n\t\tstate, bs, callbackF, stateStore := makeStateAndBlockStore()\n\t\tdefer callbackF()\n\t\theight := int64(10)\n\t\tstate.LastBlockHeight = height - 1\n\n\t\tfillStore(t, height, stateStore, bs, state, response1)\n\n\t\tobs := newPrunerObserver(1)\n\t\tpruner := sm.NewPruner(\n\t\t\tstateStore,\n\t\t\tbs,\n\t\t\tlog.TestingLogger(),\n\t\t\tsm.WithPrunerInterval(1*time.Second),\n\t\t\tsm.WithPrunerObserver(obs),\n\t\t)\n\n\t\t// Check that we have written a finalize block result at height 'height - 1'\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height - 1)\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, pruner.SetABCIResRetainHeight(height))\n\t\trequire.NoError(t, pruner.Start())\n\n\t\tselect {\n\t\tcase info := <-obs.prunedABCIResInfoCh:\n\t\t\trequire.Equal(t, height-1, info.ToHeight)\n\t\t\tt.Log(\"Done pruning ABCI results \")\n\t\tcase <-time.After(5 * time.Second):\n\t\t\trequire.Fail(t, \"timed out waiting for pruning run to complete\")\n\t\t}\n\n\t\t// Check that the response at height h - 1 has been deleted\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height - 1)\n\t\trequire.Error(t, err)\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err)\n\t})\n}\n\nfunc TestLastFinalizeBlockResponses(t *testing.T) {\n\t// create an empty state store.\n\tt.Run(\"Not persisting responses\", func(t *testing.T) {\n\t\tstateDB := dbm.NewMemDB()\n\t\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\t\tDiscardABCIResponses: false,\n\t\t})\n\t\tresponses, err := stateStore.LoadFinalizeBlockResponse(1)\n\t\trequire.Error(t, err)\n\t\trequire.Nil(t, responses)\n\t\t// stub the abciresponses.\n\t\tresponse1 := &abci.ResponseFinalizeBlock{\n\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t\t\t},\n\t\t}\n\t\t// create new db and state store and set discard abciresponses to false.\n\t\tstateDB = dbm.NewMemDB()\n\t\tstateStore = sm.NewStore(stateDB, sm.StoreOptions{DiscardABCIResponses: false})\n\t\theight := int64(10)\n\t\t// save the last abci response.\n\t\terr = stateStore.SaveFinalizeBlockResponse(height, response1)\n\t\trequire.NoError(t, err)\n\t\t// search for the last finalize block response and check if it has saved.\n\t\tlastResponse, err := stateStore.LoadLastFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the saved response height is the same as the loaded height.\n\t\tassert.Equal(t, lastResponse, response1)\n\t\t// use an incorret height to make sure the state store errors.\n\t\t_, err = stateStore.LoadLastFinalizeBlockResponse(height + 1)\n\t\tassert.Error(t, err)\n\t\t// check if the abci response didnt save in the abciresponses.\n\t\tresponses, err = stateStore.LoadFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err, responses)\n\t\trequire.Equal(t, response1, responses)\n\t})\n\n\tt.Run(\"persisting responses\", func(t *testing.T) {\n\t\tstateDB := dbm.NewMemDB()\n\t\theight := int64(10)\n\t\t// stub the second abciresponse.\n\t\tresponse2 := &abci.ResponseFinalizeBlock{\n\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t{Code: 44, Data: []byte(\"Hello again\"), Log: \"????\"},\n\t\t\t},\n\t\t}\n\t\t// create a new statestore with the responses on.\n\t\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\t\tDiscardABCIResponses: true,\n\t\t})\n\t\t// save an additional response.\n\t\terr := stateStore.SaveFinalizeBlockResponse(height+1, response2)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the response saved by calling the last response.\n\t\tlastResponse2, err := stateStore.LoadLastFinalizeBlockResponse(height + 1)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the saved response height is the same as the loaded height.\n\t\tassert.Equal(t, response2, lastResponse2)\n\t\t// should error as we are no longer saving the response.\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height + 1)\n\t\tassert.Equal(t, sm.ErrFinalizeBlockResponsesNotPersisted, err)\n\t})\n}\n\nfunc TestFinalizeBlockRecoveryUsingLegacyABCIResponses(t *testing.T) {\n\tvar (\n\t\theight int64 = 10\n\t\tlastABCIResponseKey = []byte(\"lastABCIResponseKey\")\n\t\tmemDB = dbm.NewMemDB()\n\t\tcp = types.DefaultConsensusParams().ToProto()\n\t\tlegacyResp = cmtstate.ABCIResponsesInfo{\n\t\t\tLegacyAbciResponses: &cmtstate.LegacyABCIResponses{\n\t\t\t\tBeginBlock: &cmtstate.ResponseBeginBlock{\n\t\t\t\t\tEvents: []abci.Event{{\n\t\t\t\t\t\tType: \"begin_block\",\n\t\t\t\t\t\tAttributes: []abci.EventAttribute{{\n\t\t\t\t\t\t\tKey: \"key\",\n\t\t\t\t\t\t\tValue: \"value\",\n\t\t\t\t\t\t}},\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t\tDeliverTxs: []*abci.ExecTxResult{{\n\t\t\t\t\tEvents: []abci.Event{{\n\t\t\t\t\t\tType: \"tx\",\n\t\t\t\t\t\tAttributes: []abci.EventAttribute{{\n\t\t\t\t\t\t\tKey: \"key\",\n\t\t\t\t\t\t\tValue: \"value\",\n\t\t\t\t\t\t}},\n\t\t\t\t\t}},\n\t\t\t\t}},\n\t\t\t\tEndBlock: &cmtstate.ResponseEndBlock{\n\t\t\t\t\tConsensusParamUpdates: &cp,\n\t\t\t\t},\n\t\t\t},\n\t\t\tHeight: height,\n\t\t}\n\t)\n\tbz, err := legacyResp.Marshal()\n\trequire.NoError(t, err)\n\t// should keep this in parity with state/store.go\n\trequire.NoError(t, memDB.Set(lastABCIResponseKey, bz))\n\tstateStore := sm.NewStore(memDB, sm.StoreOptions{DiscardABCIResponses: false})\n\tresp, err := stateStore.LoadLastFinalizeBlockResponse(height)\n\trequire.NoError(t, err)\n\trequire.Equal(t, resp.ConsensusParamUpdates, &cp)\n\trequire.Equal(t, resp.Events, legacyResp.LegacyAbciResponses.BeginBlock.Events)\n\trequire.Equal(t, resp.TxResults[0], legacyResp.LegacyAbciResponses.DeliverTxs[0])\n}\n"}}
[Trace - 09:33:36.514 AM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","version":2},"contentChanges":[{"range":{"start":{"line":304,"character":14},"end":{"line":304,"character":38}},"rangeLength":24,"text":"SetCompanionBlockRetainHeight"}]}
[Trace - 09:33:36.519 AM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","version":2},"contentChanges":[{"range":{"start":{"line":186,"character":18},"end":{"line":186,"character":23}},"rangeLength":5,"text":""},{"range":{"start":{"line":186,"character":12},"end":{"line":186,"character":12}},"rangeLength":0,"text":"Retain"},{"range":{"start":{"line":186,"character":10},"end":{"line":186,"character":10}},"rangeLength":0,"text":"tCompanionBlo"},{"range":{"start":{"line":186,"character":7},"end":{"line":186,"character":9}},"rangeLength":2,"text":"S"},{"range":{"start":{"line":180,"character":29},"end":{"line":180,"character":29}},"rangeLength":0,"text":"Block"},{"range":{"start":{"line":172,"character":15},"end":{"line":172,"character":15}},"rangeLength":0,"text":"Block"},{"range":{"start":{"line":165,"character":28},"end":{"line":165,"character":33}},"rangeLength":5,"text":""},{"range":{"start":{"line":165,"character":22},"end":{"line":165,"character":22}},"rangeLength":0,"text":"Retain"},{"range":{"start":{"line":165,"character":20},"end":{"line":165,"character":20}},"rangeLength":0,"text":"tCompanionBlo"},{"range":{"start":{"line":165,"character":17},"end":{"line":165,"character":19}},"rangeLength":2,"text":"S"},{"range":{"start":{"line":137,"character":18},"end":{"line":137,"character":23}},"rangeLength":5,"text":""},{"range":{"start":{"line":137,"character":12},"end":{"line":137,"character":12}},"rangeLength":0,"text":"Retain"},{"range":{"start":{"line":137,"character":10},"end":{"line":137,"character":10}},"rangeLength":0,"text":"tCompanionBlo"},{"range":{"start":{"line":137,"character":7},"end":{"line":137,"character":9}},"rangeLength":2,"text":"S"}]}
[Trace - 09:33:36.523 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","version":1,"diagnostics":[]}
[Trace - 09:33:36.525 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","version":2,"diagnostics":[]}
[Trace - 09:33:36.554 AM] Sending request 'textDocument/documentSymbol - (27)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"}}
[Trace - 09:33:36.554 AM] Received response 'textDocument/documentSymbol - (27)' in 0ms.
Result: [{"name":"TestStoreLoadValidators","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":25,"character":0},"end":{"line":50,"character":1}},"selectionRange":{"start":{"line":25,"character":5},"end":{"line":25,"character":28}}},{"name":"BenchmarkLoadValidators","detail":"func(b *testing.B)","kind":12,"range":{"start":{"line":52,"character":0},"end":{"line":89,"character":1}},"selectionRange":{"start":{"line":52,"character":5},"end":{"line":52,"character":28}}},{"name":"TestPruneStates","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":91,"character":0},"end":{"line":219,"character":1}},"selectionRange":{"start":{"line":91,"character":5},"end":{"line":91,"character":20}}},{"name":"TestTxResultsHash","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":221,"character":0},"end":{"line":237,"character":1}},"selectionRange":{"start":{"line":221,"character":5},"end":{"line":221,"character":22}}},{"name":"sliceToMap","detail":"func(s []int64) map[int64]bool","kind":12,"range":{"start":{"line":239,"character":0},"end":{"line":245,"character":1}},"selectionRange":{"start":{"line":239,"character":5},"end":{"line":239,"character":15}}},{"name":"makeStateAndBlockStore","detail":"func() (sm.State, *store.BlockStore, func(), sm.Store)","kind":12,"range":{"start":{"line":247,"character":0},"end":{"line":259,"character":1}},"selectionRange":{"start":{"line":247,"character":5},"end":{"line":247,"character":27}}},{"name":"fillStore","detail":"func(t *testing.T, height int64, stateStore sm.Store, bs *store.BlockStore, state sm.State, response1 *abci.ResponseFinalizeBlock)","kind":12,"range":{"start":{"line":261,"character":0},"end":{"line":281,"character":1}},"selectionRange":{"start":{"line":261,"character":5},"end":{"line":261,"character":14}}},{"name":"TestSaveRetainHeight","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":283,"character":0},"end":{"line":306,"character":1}},"selectionRange":{"start":{"line":283,"character":5},"end":{"line":283,"character":25}}},{"name":"TestMinRetainHeight","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":308,"character":0},"end":{"line":326,"character":1}},"selectionRange":{"start":{"line":308,"character":5},"end":{"line":308,"character":24}}},{"name":"TestABCIResPruningStandalone","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":328,"character":0},"end":{"line":398,"character":1}},"selectionRange":{"start":{"line":328,"character":5},"end":{"line":328,"character":33}}},{"name":"prunerObserver","detail":"struct{...}","kind":23,"range":{"start":{"line":400,"character":5},"end":{"line":404,"character":1}},"selectionRange":{"start":{"line":400,"character":5},"end":{"line":400,"character":19}},"children":[{"name":"NoopPrunerObserver","detail":"sm.NoopPrunerObserver","kind":8,"range":{"start":{"line":401,"character":1},"end":{"line":401,"character":22}},"selectionRange":{"start":{"line":401,"character":4},"end":{"line":401,"character":22}}},{"name":"prunedABCIResInfoCh","detail":"chan *sm.ABCIResponsesPrunedInfo","kind":8,"range":{"start":{"line":402,"character":1},"end":{"line":402,"character":55}},"selectionRange":{"start":{"line":402,"character":1},"end":{"line":402,"character":20}}},{"name":"prunedBlocksResInfoCh","detail":"chan *sm.BlocksPrunedInfo","kind":8,"range":{"start":{"line":403,"character":1},"end":{"line":403,"character":48}},"selectionRange":{"start":{"line":403,"character":1},"end":{"line":403,"character":22}}}]},{"name":"newPrunerObserver","detail":"func(infoChCap int) *prunerObserver","kind":12,"range":{"start":{"line":406,"character":0},"end":{"line":411,"character":1}},"selectionRange":{"start":{"line":406,"character":5},"end":{"line":406,"character":22}}},{"name":"(*prunerObserver).PrunerPrunedABCIRes","detail":"func(info *sm.ABCIResponsesPrunedInfo)","kind":6,"range":{"start":{"line":413,"character":0},"end":{"line":415,"character":1}},"selectionRange":{"start":{"line":413,"character":25},"end":{"line":413,"character":44}}},{"name":"(*prunerObserver).PrunerPrunedBlocks","detail":"func(info *sm.BlocksPrunedInfo)","kind":6,"range":{"start":{"line":417,"character":0},"end":{"line":419,"character":1}},"selectionRange":{"start":{"line":417,"character":25},"end":{"line":417,"character":43}}},{"name":"TestFinalizeBlockResponsePruning","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":421,"character":0},"end":{"line":472,"character":1}},"selectionRange":{"start":{"line":421,"character":5},"end":{"line":421,"character":37}}},{"name":"TestLastFinalizeBlockResponses","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":474,"character":0},"end":{"line":536,"character":1}},"selectionRange":{"start":{"line":474,"character":5},"end":{"line":474,"character":35}}},{"name":"TestFinalizeBlockRecoveryUsingLegacyABCIResponses","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":538,"character":0},"end":{"line":581,"character":1}},"selectionRange":{"start":{"line":538,"character":5},"end":{"line":538,"character":54}}}]
[Trace - 09:33:36.556 AM] Sending request 'textDocument/codeAction - (28)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":0,"character":0},"end":{"line":404,"character":0}},"context":{"diagnostics":[],"only":["source.organizeImports"],"triggerKind":2}}
[Trace - 09:33:36.557 AM] Received response 'textDocument/codeAction - (28)' in 1ms.
Result: null
[Trace - 09:33:36.558 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","version":2,"diagnostics":[{"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":46}},"severity":1,"code":"DuplicateMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#DuplicateMethod"},"source":"compiler","message":"method Pruner.SetCompanionBlockRetainHeight already declared at /home/thane/work/informal/cometbft/state/pruner.go:166:18"}]}
[Trace - 09:33:36.565 AM] Sending request 'textDocument/codeAction - (29)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"},"range":{"start":{"line":0,"character":0},"end":{"line":582,"character":0}},"context":{"diagnostics":[],"only":["source.organizeImports"],"triggerKind":2}}
[Trace - 09:33:36.567 AM] Received response 'textDocument/codeAction - (29)' in 2ms.
Result: null
[Trace - 09:33:36.569 AM] Sending request 'workspace/executeCommand - (30)'.
Params: {"command":"gopls.list_imports","arguments":[{"URI":"file:///home/thane/work/informal/cometbft/state/store_test.go"}]}
[Trace - 09:33:36.569 AM] Sending request 'workspace/executeCommand - (31)'.
Params: {"command":"gopls.list_imports","arguments":[{"URI":"file:///home/thane/work/informal/cometbft/state/store_test.go"}]}
[Trace - 09:33:36.569 AM] Sending request 'workspace/executeCommand - (32)'.
Params: {"command":"gopls.list_imports","arguments":[{"URI":"file:///home/thane/work/informal/cometbft/state/store_test.go"}]}
[Trace - 09:33:36.569 AM] Received response 'workspace/executeCommand - (30)' in 0ms.
Result: {"Imports":[{"Path":"fmt","Name":""},{"Path":"os","Name":""},{"Path":"testing","Name":""},{"Path":"time","Name":""},{"Path":"github.com/stretchr/testify/assert","Name":""},{"Path":"github.com/stretchr/testify/require","Name":""},{"Path":"github.com/cometbft/cometbft-db","Name":"dbm"},{"Path":"github.com/cometbft/cometbft/abci/types","Name":"abci"},{"Path":"github.com/cometbft/cometbft/crypto","Name":""},{"Path":"github.com/cometbft/cometbft/crypto/ed25519","Name":""},{"Path":"github.com/cometbft/cometbft/internal/test","Name":""},{"Path":"github.com/cometbft/cometbft/libs/log","Name":""},{"Path":"github.com/cometbft/cometbft/libs/rand","Name":"cmtrand"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state","Name":"cmtstate"},{"Path":"github.com/cometbft/cometbft/state","Name":"sm"},{"Path":"github.com/cometbft/cometbft/store","Name":""},{"Path":"github.com/cometbft/cometbft/types","Name":""}],"PackageImports":[{"Path":"bytes"},{"Path":"context"},{"Path":"crypto/rand"},{"Path":"errors"},{"Path":"fmt"},{"Path":"github.com/cometbft/cometbft-db"},{"Path":"github.com/cometbft/cometbft/abci/client/mocks"},{"Path":"github.com/cometbft/cometbft/abci/types"},{"Path":"github.com/cometbft/cometbft/abci/types/mocks"},{"Path":"github.com/cometbft/cometbft/crypto"},{"Path":"github.com/cometbft/cometbft/crypto/ed25519"},{"Path":"github.com/cometbft/cometbft/crypto/encoding"},{"Path":"github.com/cometbft/cometbft/crypto/tmhash"},{"Path":"github.com/cometbft/cometbft/internal/test"},{"Path":"github.com/cometbft/cometbft/libs/log"},{"Path":"github.com/cometbft/cometbft/libs/rand"},{"Path":"github.com/cometbft/cometbft/mempool/mocks"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/types"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/version"},{"Path":"github.com/cometbft/cometbft/proxy"},{"Path":"github.com/cometbft/cometbft/proxy/mocks"},{"Path":"github.com/cometbft/cometbft/state"},{"Path":"github.com/cometbft/cometbft/state/mocks"},{"Path":"github.com/cometbft/cometbft/store"},{"Path":"github.com/cometbft/cometbft/types"},{"Path":"github.com/cometbft/cometbft/types/errors"},{"Path":"github.com/cometbft/cometbft/types/time"},{"Path":"github.com/cometbft/cometbft/version"},{"Path":"github.com/stretchr/testify/assert"},{"Path":"github.com/stretchr/testify/mock"},{"Path":"github.com/stretchr/testify/require"},{"Path":"math"},{"Path":"math/big"},{"Path":"os"},{"Path":"testing"},{"Path":"time"}]}
[Trace - 09:33:36.569 AM] Received response 'workspace/executeCommand - (31)' in 0ms.
Result: {"Imports":[{"Path":"fmt","Name":""},{"Path":"os","Name":""},{"Path":"testing","Name":""},{"Path":"time","Name":""},{"Path":"github.com/stretchr/testify/assert","Name":""},{"Path":"github.com/stretchr/testify/require","Name":""},{"Path":"github.com/cometbft/cometbft-db","Name":"dbm"},{"Path":"github.com/cometbft/cometbft/abci/types","Name":"abci"},{"Path":"github.com/cometbft/cometbft/crypto","Name":""},{"Path":"github.com/cometbft/cometbft/crypto/ed25519","Name":""},{"Path":"github.com/cometbft/cometbft/internal/test","Name":""},{"Path":"github.com/cometbft/cometbft/libs/log","Name":""},{"Path":"github.com/cometbft/cometbft/libs/rand","Name":"cmtrand"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state","Name":"cmtstate"},{"Path":"github.com/cometbft/cometbft/state","Name":"sm"},{"Path":"github.com/cometbft/cometbft/store","Name":""},{"Path":"github.com/cometbft/cometbft/types","Name":""}],"PackageImports":[{"Path":"bytes"},{"Path":"context"},{"Path":"crypto/rand"},{"Path":"errors"},{"Path":"fmt"},{"Path":"github.com/cometbft/cometbft-db"},{"Path":"github.com/cometbft/cometbft/abci/client/mocks"},{"Path":"github.com/cometbft/cometbft/abci/types"},{"Path":"github.com/cometbft/cometbft/abci/types/mocks"},{"Path":"github.com/cometbft/cometbft/crypto"},{"Path":"github.com/cometbft/cometbft/crypto/ed25519"},{"Path":"github.com/cometbft/cometbft/crypto/encoding"},{"Path":"github.com/cometbft/cometbft/crypto/tmhash"},{"Path":"github.com/cometbft/cometbft/internal/test"},{"Path":"github.com/cometbft/cometbft/libs/log"},{"Path":"github.com/cometbft/cometbft/libs/rand"},{"Path":"github.com/cometbft/cometbft/mempool/mocks"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/types"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/version"},{"Path":"github.com/cometbft/cometbft/proxy"},{"Path":"github.com/cometbft/cometbft/proxy/mocks"},{"Path":"github.com/cometbft/cometbft/state"},{"Path":"github.com/cometbft/cometbft/state/mocks"},{"Path":"github.com/cometbft/cometbft/store"},{"Path":"github.com/cometbft/cometbft/types"},{"Path":"github.com/cometbft/cometbft/types/errors"},{"Path":"github.com/cometbft/cometbft/types/time"},{"Path":"github.com/cometbft/cometbft/version"},{"Path":"github.com/stretchr/testify/assert"},{"Path":"github.com/stretchr/testify/mock"},{"Path":"github.com/stretchr/testify/require"},{"Path":"math"},{"Path":"math/big"},{"Path":"os"},{"Path":"testing"},{"Path":"time"}]}
[Trace - 09:33:36.570 AM] Received response 'workspace/executeCommand - (32)' in 0ms.
Result: {"Imports":[{"Path":"fmt","Name":""},{"Path":"os","Name":""},{"Path":"testing","Name":""},{"Path":"time","Name":""},{"Path":"github.com/stretchr/testify/assert","Name":""},{"Path":"github.com/stretchr/testify/require","Name":""},{"Path":"github.com/cometbft/cometbft-db","Name":"dbm"},{"Path":"github.com/cometbft/cometbft/abci/types","Name":"abci"},{"Path":"github.com/cometbft/cometbft/crypto","Name":""},{"Path":"github.com/cometbft/cometbft/crypto/ed25519","Name":""},{"Path":"github.com/cometbft/cometbft/internal/test","Name":""},{"Path":"github.com/cometbft/cometbft/libs/log","Name":""},{"Path":"github.com/cometbft/cometbft/libs/rand","Name":"cmtrand"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state","Name":"cmtstate"},{"Path":"github.com/cometbft/cometbft/state","Name":"sm"},{"Path":"github.com/cometbft/cometbft/store","Name":""},{"Path":"github.com/cometbft/cometbft/types","Name":""}],"PackageImports":[{"Path":"bytes"},{"Path":"context"},{"Path":"crypto/rand"},{"Path":"errors"},{"Path":"fmt"},{"Path":"github.com/cometbft/cometbft-db"},{"Path":"github.com/cometbft/cometbft/abci/client/mocks"},{"Path":"github.com/cometbft/cometbft/abci/types"},{"Path":"github.com/cometbft/cometbft/abci/types/mocks"},{"Path":"github.com/cometbft/cometbft/crypto"},{"Path":"github.com/cometbft/cometbft/crypto/ed25519"},{"Path":"github.com/cometbft/cometbft/crypto/encoding"},{"Path":"github.com/cometbft/cometbft/crypto/tmhash"},{"Path":"github.com/cometbft/cometbft/internal/test"},{"Path":"github.com/cometbft/cometbft/libs/log"},{"Path":"github.com/cometbft/cometbft/libs/rand"},{"Path":"github.com/cometbft/cometbft/mempool/mocks"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/types"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/version"},{"Path":"github.com/cometbft/cometbft/proxy"},{"Path":"github.com/cometbft/cometbft/proxy/mocks"},{"Path":"github.com/cometbft/cometbft/state"},{"Path":"github.com/cometbft/cometbft/state/mocks"},{"Path":"github.com/cometbft/cometbft/store"},{"Path":"github.com/cometbft/cometbft/types"},{"Path":"github.com/cometbft/cometbft/types/errors"},{"Path":"github.com/cometbft/cometbft/types/time"},{"Path":"github.com/cometbft/cometbft/version"},{"Path":"github.com/stretchr/testify/assert"},{"Path":"github.com/stretchr/testify/mock"},{"Path":"github.com/stretchr/testify/require"},{"Path":"math"},{"Path":"math/big"},{"Path":"os"},{"Path":"testing"},{"Path":"time"}]}
[Trace - 09:33:36.587 AM] Sending request 'textDocument/formatting - (33)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"options":{"tabSize":4,"insertSpaces":false}}
[Trace - 09:33:36.592 AM] Received response 'textDocument/formatting - (33)' in 4ms.
Result: []
[Trace - 09:33:36.595 AM] Sending request 'textDocument/formatting - (34)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"},"options":{"tabSize":4,"insertSpaces":false}}
[Trace - 09:33:36.608 AM] Received response 'textDocument/formatting - (34)' in 12ms.
Result: []
[Trace - 09:33:36.635 AM] Sending notification 'textDocument/didSave'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:36.637 AM] Sending notification 'textDocument/didSave'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"}}
[Trace - 09:33:36.638 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","version":2,"diagnostics":[]}
[Trace - 09:33:36.641 AM] Sending notification 'textDocument/didClose'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"}}
[Trace - 09:33:36.652 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","version":2,"diagnostics":[{"range":{"start":{"line":304,"character":7},"end":{"line":304,"character":47}},"severity":1,"code":"InvalidIfaceAssign","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#InvalidIfaceAssign"},"source":"compiler","message":"cannot use pruner.SetCompanionBlockRetainHeight(10) (value of type bool) as error value in assignment: bool does not implement error (missing method Error)"}]}
[Trace - 09:33:36.667 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","languageId":"go","version":2,"text":"package state_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\n\tdbm \"github.com/cometbft/cometbft-db\"\n\n\tabci \"github.com/cometbft/cometbft/abci/types\"\n\t\"github.com/cometbft/cometbft/crypto\"\n\t\"github.com/cometbft/cometbft/crypto/ed25519\"\n\t\"github.com/cometbft/cometbft/internal/test\"\n\t\"github.com/cometbft/cometbft/libs/log\"\n\tcmtrand \"github.com/cometbft/cometbft/libs/rand\"\n\tcmtstate \"github.com/cometbft/cometbft/proto/tendermint/state\"\n\tsm \"github.com/cometbft/cometbft/state\"\n\t\"github.com/cometbft/cometbft/store\"\n\t\"github.com/cometbft/cometbft/types\"\n)\n\nfunc TestStoreLoadValidators(t *testing.T) {\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tval, _ := types.RandValidator(true, 10)\n\tvals := types.NewValidatorSet([]*types.Validator{val})\n\n\t// 1) LoadValidators loads validators using a height where they were last changed\n\terr := sm.SaveValidatorsInfo(stateDB, 1, 1, vals)\n\trequire.NoError(t, err)\n\terr = sm.SaveValidatorsInfo(stateDB, 2, 1, vals)\n\trequire.NoError(t, err)\n\tloadedVals, err := stateStore.LoadValidators(2)\n\trequire.NoError(t, err)\n\tassert.NotZero(t, loadedVals.Size())\n\n\t// 2) LoadValidators loads validators using a checkpoint height\n\n\terr = sm.SaveValidatorsInfo(stateDB, sm.ValSetCheckpointInterval, 1, vals)\n\trequire.NoError(t, err)\n\n\tloadedVals, err = stateStore.LoadValidators(sm.ValSetCheckpointInterval)\n\trequire.NoError(t, err)\n\tassert.NotZero(t, loadedVals.Size())\n}\n\nfunc BenchmarkLoadValidators(b *testing.B) {\n\tconst valSetSize = 100\n\n\tconfig := test.ResetTestRoot(\"state_\")\n\tdefer os.RemoveAll(config.RootDir)\n\tdbType := dbm.BackendType(config.DBBackend)\n\tstateDB, err := dbm.NewDB(\"state\", dbType, config.DBDir())\n\trequire.NoError(b, err)\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tstate, err := stateStore.LoadFromDBOrGenesisFile(config.GenesisFile())\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\n\tstate.Validators = genValSet(valSetSize)\n\tstate.NextValidators = state.Validators.CopyIncrementProposerPriority(1)\n\terr = stateStore.Save(state)\n\trequire.NoError(b, err)\n\n\tfor i := 10; i < 10000000000; i *= 10 { // 10, 100, 1000, ...\n\t\ti := i\n\t\tif err := sm.SaveValidatorsInfo(stateDB,\n\t\t\tint64(i), state.LastHeightValidatorsChanged, state.NextValidators); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\n\t\tb.Run(fmt.Sprintf(\"height=%d\", i), func(b *testing.B) {\n\t\t\tfor n := 0; n < b.N; n++ {\n\t\t\t\t_, err := stateStore.LoadValidators(int64(i))\n\t\t\t\tif err != nil {\n\t\t\t\t\tb.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPruneStates(t *testing.T) {\n\ttestcases := map[string]struct {\n\t\tmakeHeights int64\n\t\tpruneFrom int64\n\t\tpruneTo int64\n\t\tevidenceThresholdHeight int64\n\t\texpectErr bool\n\t\texpectVals []int64\n\t\texpectParams []int64\n\t\texpectABCI []int64\n\t}{\n\t\t\"error on pruning from 0\": {100, 0, 5, 100, true, nil, nil, nil},\n\t\t\"error when from > to\": {100, 3, 2, 2, true, nil, nil, nil},\n\t\t\"error when from == to\": {100, 3, 3, 3, true, nil, nil, nil},\n\t\t\"error when to does not exist\": {100, 1, 101, 101, true, nil, nil, nil},\n\t\t\"prune all\": {100, 1, 100, 100, false, []int64{93, 100}, []int64{95, 100}, []int64{100}},\n\t\t\"prune some\": {\n\t\t\t10, 2, 8, 8, false,\n\t\t\t[]int64{1, 3, 8, 9, 10},\n\t\t\t[]int64{1, 5, 8, 9, 10},\n\t\t\t[]int64{1, 8, 9, 10},\n\t\t},\n\t\t\"prune across checkpoint\": {\n\t\t\t100001, 1, 100001, 100001, false,\n\t\t\t[]int64{99993, 100000, 100001},\n\t\t\t[]int64{99995, 100001},\n\t\t\t[]int64{100001},\n\t\t},\n\t\t\"prune when evidence height < height\": {20, 1, 18, 17, false, []int64{13, 17, 18, 19, 20}, []int64{15, 18, 19, 20}, []int64{18, 19, 20}},\n\t}\n\tfor name, tc := range testcases {\n\t\ttc := tc\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tdb := dbm.NewMemDB()\n\t\t\tstateStore := sm.NewStore(db, sm.StoreOptions{\n\t\t\t\tDiscardABCIResponses: false,\n\t\t\t})\n\t\t\tpk := ed25519.GenPrivKey().PubKey()\n\n\t\t\t// Generate a bunch of state data. Validators change for heights ending with 3, and\n\t\t\t// parameters when ending with 5.\n\t\t\tvalidator := &types.Validator{Address: cmtrand.Bytes(crypto.AddressSize), VotingPower: 100, PubKey: pk}\n\t\t\tvalidatorSet := &types.ValidatorSet{\n\t\t\t\tValidators: []*types.Validator{validator},\n\t\t\t\tProposer: validator,\n\t\t\t}\n\t\t\tvalsChanged := int64(0)\n\t\t\tparamsChanged := int64(0)\n\n\t\t\tfor h := int64(1); h <= tc.makeHeights; h++ {\n\t\t\t\tif valsChanged == 0 || h%10 == 2 {\n\t\t\t\t\tvalsChanged = h + 1 // Have to add 1, since NextValidators is what's stored\n\t\t\t\t}\n\t\t\t\tif paramsChanged == 0 || h%10 == 5 {\n\t\t\t\t\tparamsChanged = h\n\t\t\t\t}\n\n\t\t\t\tstate := sm.State{\n\t\t\t\t\tInitialHeight: 1,\n\t\t\t\t\tLastBlockHeight: h - 1,\n\t\t\t\t\tValidators: validatorSet,\n\t\t\t\t\tNextValidators: validatorSet,\n\t\t\t\t\tConsensusParams: types.ConsensusParams{\n\t\t\t\t\t\tBlock: types.BlockParams{MaxBytes: 10e6},\n\t\t\t\t\t},\n\t\t\t\t\tLastHeightValidatorsChanged: valsChanged,\n\t\t\t\t\tLastHeightConsensusParamsChanged: paramsChanged,\n\t\t\t\t}\n\n\t\t\t\tif state.LastBlockHeight >= 1 {\n\t\t\t\t\tstate.LastValidators = state.Validators\n\t\t\t\t}\n\n\t\t\t\terr := stateStore.Save(state)\n\t\t\t\trequire.NoError(t, err)\n\n\t\t\t\terr = stateStore.SaveFinalizeBlockResponse(h, &abci.ResponseFinalizeBlock{\n\t\t\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t\t\t{Data: []byte{1}},\n\t\t\t\t\t\t{Data: []byte{2}},\n\t\t\t\t\t\t{Data: []byte{3}},\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\trequire.NoError(t, err)\n\t\t\t}\n\n\t\t\t// Test assertions\n\t\t\terr := stateStore.PruneStates(tc.pruneFrom, tc.pruneTo, tc.evidenceThresholdHeight)\n\t\t\tif tc.expectErr {\n\t\t\t\trequire.Error(t, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\trequire.NoError(t, err)\n\n\t\t\texpectVals := sliceToMap(tc.expectVals)\n\t\t\texpectParams := sliceToMap(tc.expectParams)\n\t\t\texpectABCI := sliceToMap(tc.expectABCI)\n\n\t\t\tfor h := int64(1); h <= tc.makeHeights; h++ {\n\t\t\t\tvals, err := stateStore.LoadValidators(h)\n\t\t\t\tif expectVals[h] {\n\t\t\t\t\trequire.NoError(t, err, \"validators height %v\", h)\n\t\t\t\t\trequire.NotNil(t, vals)\n\t\t\t\t} else {\n\t\t\t\t\trequire.Error(t, err, \"validators height %v\", h)\n\t\t\t\t\trequire.Equal(t, sm.ErrNoValSetForHeight{Height: h}, err)\n\t\t\t\t}\n\n\t\t\t\tparams, err := stateStore.LoadConsensusParams(h)\n\t\t\t\tif expectParams[h] {\n\t\t\t\t\trequire.NoError(t, err, \"params height %v\", h)\n\t\t\t\t\trequire.NotEmpty(t, params)\n\t\t\t\t} else {\n\t\t\t\t\trequire.Error(t, err, \"params height %v\", h)\n\t\t\t\t\trequire.Empty(t, params)\n\t\t\t\t}\n\n\t\t\t\tabci, err := stateStore.LoadFinalizeBlockResponse(h)\n\t\t\t\tif expectABCI[h] {\n\t\t\t\t\trequire.NoError(t, err, \"abci height %v\", h)\n\t\t\t\t\trequire.NotNil(t, abci)\n\t\t\t\t} else {\n\t\t\t\t\trequire.Error(t, err, \"abci height %v\", h)\n\t\t\t\t\trequire.Equal(t, sm.ErrNoABCIResponsesForHeight{Height: h}, err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestTxResultsHash(t *testing.T) {\n\ttxResults := []*abci.ExecTxResult{\n\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t}\n\n\troot := sm.TxResultsHash(txResults)\n\n\t// root should be Merkle tree root of ExecTxResult responses\n\tresults := types.NewResults(txResults)\n\tassert.Equal(t, root, results.Hash())\n\n\t// test we can prove first ExecTxResult\n\tproof := results.ProveResult(0)\n\tbz, err := results[0].Marshal()\n\trequire.NoError(t, err)\n\tassert.NoError(t, proof.Verify(root, bz))\n}\n\nfunc sliceToMap(s []int64) map[int64]bool {\n\tm := make(map[int64]bool, len(s))\n\tfor _, i := range s {\n\t\tm[i] = true\n\t}\n\treturn m\n}\n\nfunc makeStateAndBlockStore() (sm.State, *store.BlockStore, func(), sm.Store) {\n\tconfig := test.ResetTestRoot(\"blockchain_reactor_test\")\n\tblockDB := dbm.NewMemDB()\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tstate, err := stateStore.LoadFromDBOrGenesisFile(config.GenesisFile())\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"error constructing state from genesis file: %w\", err))\n\t}\n\treturn state, store.NewBlockStore(blockDB), func() { os.RemoveAll(config.RootDir) }, stateStore\n}\n\nfunc fillStore(t *testing.T, height int64, stateStore sm.Store, bs *store.BlockStore, state sm.State, response1 *abci.ResponseFinalizeBlock) {\n\tif response1 != nil {\n\t\tfor h := int64(1); h <= height; h++ {\n\t\t\terr := stateStore.SaveFinalizeBlockResponse(h, response1)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\t// search for the last finalize block response and check if it has saved.\n\t\tlastResponse, err := stateStore.LoadLastFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the saved response height is the same as the loaded height.\n\t\tassert.Equal(t, lastResponse, response1)\n\t\t// check if the abci response didnt save in the abciresponses.\n\t\tresponses, err := stateStore.LoadFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err, responses)\n\t\trequire.Equal(t, response1, responses)\n\t}\n\tb1 := state.MakeBlock(state.LastBlockHeight+1, test.MakeNTxs(state.LastBlockHeight+1, 10), new(types.Commit), nil, nil)\n\tpartSet, err := b1.MakePartSet(2)\n\trequire.NoError(t, err)\n\tbs.SaveBlock(b1, partSet, &types.Commit{Height: state.LastBlockHeight + 1})\n}\n\nfunc TestSaveRetainHeight(t *testing.T) {\n\tstate, bs, callbackF, stateStore := makeStateAndBlockStore()\n\tdefer callbackF()\n\theight := int64(10)\n\tstate.LastBlockHeight = height - 1\n\n\tfillStore(t, height, stateStore, bs, state, nil)\n\n\tpruner := sm.NewPruner(stateStore, bs, log.TestingLogger())\n\n\t// We should not save a height that is 0\n\terr := pruner.SetApplicationBlockRetainHeight(0)\n\trequire.Error(t, err)\n\n\t// We should not save a height above the blockstore's height\n\terr = pruner.SetApplicationBlockRetainHeight(11)\n\trequire.Error(t, err)\n\n\terr = pruner.SetApplicationBlockRetainHeight(10)\n\trequire.NoError(t, err)\n\n\terr = pruner.SetCompanionBlockRetainHeight(10)\n\trequire.NoError(t, err)\n}\n\nfunc TestMinRetainHeight(t *testing.T) {\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\tpruner := sm.NewPruner(stateStore, nil, log.TestingLogger())\n\tminHeight := pruner.FindMinRetainHeight()\n\trequire.Equal(t, minHeight, int64(0))\n\n\terr := stateStore.SaveApplicationRetainHeight(10)\n\trequire.NoError(t, err)\n\tminHeight = pruner.FindMinRetainHeight()\n\trequire.Equal(t, minHeight, int64(10))\n\n\terr = stateStore.SaveCompanionBlockRetainHeight(11)\n\trequire.NoError(t, err)\n\tminHeight = pruner.FindMinRetainHeight()\n\trequire.Equal(t, minHeight, int64(10))\n}\n\nfunc TestABCIResPruningStandalone(t *testing.T) {\n\tstateDB := dbm.NewMemDB()\n\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\tDiscardABCIResponses: false,\n\t})\n\n\tresponses, err := stateStore.LoadFinalizeBlockResponse(1)\n\trequire.Error(t, err)\n\trequire.Nil(t, responses)\n\t// stub the abciresponses.\n\tresponse1 := &abci.ResponseFinalizeBlock{\n\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t\t},\n\t}\n\t_, bs, callbackF, stateStore := makeStateAndBlockStore()\n\tdefer callbackF()\n\n\tfor height := int64(1); height <= 10; height++ {\n\t\terr := stateStore.SaveFinalizeBlockResponse(height, response1)\n\t\trequire.NoError(t, err)\n\t}\n\tpruner := sm.NewPruner(stateStore, bs, log.TestingLogger())\n\n\tretainHeight := int64(2)\n\terr = stateStore.SaveABCIResRetainHeight(retainHeight)\n\trequire.NoError(t, err)\n\tabciResRetainHeight, err := stateStore.GetABCIResRetainHeight()\n\trequire.NoError(t, err)\n\trequire.Equal(t, retainHeight, abciResRetainHeight)\n\tnewRetainHeight := pruner.PruneABCIResToRetainHeight(0)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\t_, err = stateStore.LoadFinalizeBlockResponse(1)\n\trequire.Error(t, err)\n\n\tfor h := retainHeight; h <= 10; h++ {\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(h)\n\t\trequire.NoError(t, err)\n\t}\n\n\t// This should not have any impact because the retain height is still 2 and we will not prune blocks to 3\n\tnewRetainHeight = pruner.PruneABCIResToRetainHeight(3)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\tretainHeight = 3\n\terr = stateStore.SaveABCIResRetainHeight(retainHeight)\n\trequire.NoError(t, err)\n\tnewRetainHeight = pruner.PruneABCIResToRetainHeight(2)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\t_, err = stateStore.LoadFinalizeBlockResponse(2)\n\trequire.Error(t, err)\n\tfor h := retainHeight; h <= 10; h++ {\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(h)\n\t\trequire.NoError(t, err)\n\t}\n\n\tretainHeight = 10\n\terr = stateStore.SaveABCIResRetainHeight(retainHeight)\n\trequire.NoError(t, err)\n\tnewRetainHeight = pruner.PruneABCIResToRetainHeight(2)\n\trequire.Equal(t, retainHeight, newRetainHeight)\n\n\tfor h := int64(0); h < 10; h++ {\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(h)\n\t\trequire.Error(t, err)\n\t}\n\t_, err = stateStore.LoadFinalizeBlockResponse(10)\n\trequire.NoError(t, err)\n}\n\ntype prunerObserver struct {\n\tsm.NoopPrunerObserver\n\tprunedABCIResInfoCh chan *sm.ABCIResponsesPrunedInfo\n\tprunedBlocksResInfoCh chan *sm.BlocksPrunedInfo\n}\n\nfunc newPrunerObserver(infoChCap int) *prunerObserver {\n\treturn &prunerObserver{\n\t\tprunedABCIResInfoCh: make(chan *sm.ABCIResponsesPrunedInfo, infoChCap),\n\t\tprunedBlocksResInfoCh: make(chan *sm.BlocksPrunedInfo, infoChCap),\n\t}\n}\n\nfunc (o *prunerObserver) PrunerPrunedABCIRes(info *sm.ABCIResponsesPrunedInfo) {\n\to.prunedABCIResInfoCh <- info\n}\n\nfunc (o *prunerObserver) PrunerPrunedBlocks(info *sm.BlocksPrunedInfo) {\n\to.prunedBlocksResInfoCh <- info\n}\n\nfunc TestFinalizeBlockResponsePruning(t *testing.T) {\n\tt.Run(\"Persisting responses\", func(t *testing.T) {\n\t\tstateDB := dbm.NewMemDB()\n\t\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\t\tDiscardABCIResponses: false,\n\t\t})\n\t\tresponses, err := stateStore.LoadFinalizeBlockResponse(1)\n\t\trequire.Error(t, err)\n\t\trequire.Nil(t, responses)\n\t\t// stub the abciresponses.\n\t\tresponse1 := &abci.ResponseFinalizeBlock{\n\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t\t\t},\n\t\t}\n\t\tstate, bs, callbackF, stateStore := makeStateAndBlockStore()\n\t\tdefer callbackF()\n\t\theight := int64(10)\n\t\tstate.LastBlockHeight = height - 1\n\n\t\tfillStore(t, height, stateStore, bs, state, response1)\n\n\t\tobs := newPrunerObserver(1)\n\t\tpruner := sm.NewPruner(\n\t\t\tstateStore,\n\t\t\tbs,\n\t\t\tlog.TestingLogger(),\n\t\t\tsm.WithPrunerInterval(1*time.Second),\n\t\t\tsm.WithPrunerObserver(obs),\n\t\t)\n\n\t\t// Check that we have written a finalize block result at height 'height - 1'\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height - 1)\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, pruner.SetABCIResRetainHeight(height))\n\t\trequire.NoError(t, pruner.Start())\n\n\t\tselect {\n\t\tcase info := <-obs.prunedABCIResInfoCh:\n\t\t\trequire.Equal(t, height-1, info.ToHeight)\n\t\t\tt.Log(\"Done pruning ABCI results \")\n\t\tcase <-time.After(5 * time.Second):\n\t\t\trequire.Fail(t, \"timed out waiting for pruning run to complete\")\n\t\t}\n\n\t\t// Check that the response at height h - 1 has been deleted\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height - 1)\n\t\trequire.Error(t, err)\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err)\n\t})\n}\n\nfunc TestLastFinalizeBlockResponses(t *testing.T) {\n\t// create an empty state store.\n\tt.Run(\"Not persisting responses\", func(t *testing.T) {\n\t\tstateDB := dbm.NewMemDB()\n\t\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\t\tDiscardABCIResponses: false,\n\t\t})\n\t\tresponses, err := stateStore.LoadFinalizeBlockResponse(1)\n\t\trequire.Error(t, err)\n\t\trequire.Nil(t, responses)\n\t\t// stub the abciresponses.\n\t\tresponse1 := &abci.ResponseFinalizeBlock{\n\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t{Code: 32, Data: []byte(\"Hello\"), Log: \"Huh?\"},\n\t\t\t},\n\t\t}\n\t\t// create new db and state store and set discard abciresponses to false.\n\t\tstateDB = dbm.NewMemDB()\n\t\tstateStore = sm.NewStore(stateDB, sm.StoreOptions{DiscardABCIResponses: false})\n\t\theight := int64(10)\n\t\t// save the last abci response.\n\t\terr = stateStore.SaveFinalizeBlockResponse(height, response1)\n\t\trequire.NoError(t, err)\n\t\t// search for the last finalize block response and check if it has saved.\n\t\tlastResponse, err := stateStore.LoadLastFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the saved response height is the same as the loaded height.\n\t\tassert.Equal(t, lastResponse, response1)\n\t\t// use an incorret height to make sure the state store errors.\n\t\t_, err = stateStore.LoadLastFinalizeBlockResponse(height + 1)\n\t\tassert.Error(t, err)\n\t\t// check if the abci response didnt save in the abciresponses.\n\t\tresponses, err = stateStore.LoadFinalizeBlockResponse(height)\n\t\trequire.NoError(t, err, responses)\n\t\trequire.Equal(t, response1, responses)\n\t})\n\n\tt.Run(\"persisting responses\", func(t *testing.T) {\n\t\tstateDB := dbm.NewMemDB()\n\t\theight := int64(10)\n\t\t// stub the second abciresponse.\n\t\tresponse2 := &abci.ResponseFinalizeBlock{\n\t\t\tTxResults: []*abci.ExecTxResult{\n\t\t\t\t{Code: 44, Data: []byte(\"Hello again\"), Log: \"????\"},\n\t\t\t},\n\t\t}\n\t\t// create a new statestore with the responses on.\n\t\tstateStore := sm.NewStore(stateDB, sm.StoreOptions{\n\t\t\tDiscardABCIResponses: true,\n\t\t})\n\t\t// save an additional response.\n\t\terr := stateStore.SaveFinalizeBlockResponse(height+1, response2)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the response saved by calling the last response.\n\t\tlastResponse2, err := stateStore.LoadLastFinalizeBlockResponse(height + 1)\n\t\trequire.NoError(t, err)\n\t\t// check to see if the saved response height is the same as the loaded height.\n\t\tassert.Equal(t, response2, lastResponse2)\n\t\t// should error as we are no longer saving the response.\n\t\t_, err = stateStore.LoadFinalizeBlockResponse(height + 1)\n\t\tassert.Equal(t, sm.ErrFinalizeBlockResponsesNotPersisted, err)\n\t})\n}\n\nfunc TestFinalizeBlockRecoveryUsingLegacyABCIResponses(t *testing.T) {\n\tvar (\n\t\theight int64 = 10\n\t\tlastABCIResponseKey = []byte(\"lastABCIResponseKey\")\n\t\tmemDB = dbm.NewMemDB()\n\t\tcp = types.DefaultConsensusParams().ToProto()\n\t\tlegacyResp = cmtstate.ABCIResponsesInfo{\n\t\t\tLegacyAbciResponses: &cmtstate.LegacyABCIResponses{\n\t\t\t\tBeginBlock: &cmtstate.ResponseBeginBlock{\n\t\t\t\t\tEvents: []abci.Event{{\n\t\t\t\t\t\tType: \"begin_block\",\n\t\t\t\t\t\tAttributes: []abci.EventAttribute{{\n\t\t\t\t\t\t\tKey: \"key\",\n\t\t\t\t\t\t\tValue: \"value\",\n\t\t\t\t\t\t}},\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t\tDeliverTxs: []*abci.ExecTxResult{{\n\t\t\t\t\tEvents: []abci.Event{{\n\t\t\t\t\t\tType: \"tx\",\n\t\t\t\t\t\tAttributes: []abci.EventAttribute{{\n\t\t\t\t\t\t\tKey: \"key\",\n\t\t\t\t\t\t\tValue: \"value\",\n\t\t\t\t\t\t}},\n\t\t\t\t\t}},\n\t\t\t\t}},\n\t\t\t\tEndBlock: &cmtstate.ResponseEndBlock{\n\t\t\t\t\tConsensusParamUpdates: &cp,\n\t\t\t\t},\n\t\t\t},\n\t\t\tHeight: height,\n\t\t}\n\t)\n\tbz, err := legacyResp.Marshal()\n\trequire.NoError(t, err)\n\t// should keep this in parity with state/store.go\n\trequire.NoError(t, memDB.Set(lastABCIResponseKey, bz))\n\tstateStore := sm.NewStore(memDB, sm.StoreOptions{DiscardABCIResponses: false})\n\tresp, err := stateStore.LoadLastFinalizeBlockResponse(height)\n\trequire.NoError(t, err)\n\trequire.Equal(t, resp.ConsensusParamUpdates, &cp)\n\trequire.Equal(t, resp.Events, legacyResp.LegacyAbciResponses.BeginBlock.Events)\n\trequire.Equal(t, resp.TxResults[0], legacyResp.LegacyAbciResponses.DeliverTxs[0])\n}\n"}}
[Trace - 09:33:36.668 AM] Sending request 'textDocument/documentSymbol - (35)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"}}
[Trace - 09:33:36.675 AM] Sending request 'textDocument/semanticTokens/range - (36)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":126,"character":0},"end":{"line":229,"character":38}}}
[Trace - 09:33:36.683 AM] Received response 'textDocument/documentSymbol - (35)' in 15ms.
Result: [{"name":"TestStoreLoadValidators","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":25,"character":0},"end":{"line":50,"character":1}},"selectionRange":{"start":{"line":25,"character":5},"end":{"line":25,"character":28}}},{"name":"BenchmarkLoadValidators","detail":"func(b *testing.B)","kind":12,"range":{"start":{"line":52,"character":0},"end":{"line":89,"character":1}},"selectionRange":{"start":{"line":52,"character":5},"end":{"line":52,"character":28}}},{"name":"TestPruneStates","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":91,"character":0},"end":{"line":219,"character":1}},"selectionRange":{"start":{"line":91,"character":5},"end":{"line":91,"character":20}}},{"name":"TestTxResultsHash","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":221,"character":0},"end":{"line":237,"character":1}},"selectionRange":{"start":{"line":221,"character":5},"end":{"line":221,"character":22}}},{"name":"sliceToMap","detail":"func(s []int64) map[int64]bool","kind":12,"range":{"start":{"line":239,"character":0},"end":{"line":245,"character":1}},"selectionRange":{"start":{"line":239,"character":5},"end":{"line":239,"character":15}}},{"name":"makeStateAndBlockStore","detail":"func() (sm.State, *store.BlockStore, func(), sm.Store)","kind":12,"range":{"start":{"line":247,"character":0},"end":{"line":259,"character":1}},"selectionRange":{"start":{"line":247,"character":5},"end":{"line":247,"character":27}}},{"name":"fillStore","detail":"func(t *testing.T, height int64, stateStore sm.Store, bs *store.BlockStore, state sm.State, response1 *abci.ResponseFinalizeBlock)","kind":12,"range":{"start":{"line":261,"character":0},"end":{"line":281,"character":1}},"selectionRange":{"start":{"line":261,"character":5},"end":{"line":261,"character":14}}},{"name":"TestSaveRetainHeight","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":283,"character":0},"end":{"line":306,"character":1}},"selectionRange":{"start":{"line":283,"character":5},"end":{"line":283,"character":25}}},{"name":"TestMinRetainHeight","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":308,"character":0},"end":{"line":326,"character":1}},"selectionRange":{"start":{"line":308,"character":5},"end":{"line":308,"character":24}}},{"name":"TestABCIResPruningStandalone","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":328,"character":0},"end":{"line":398,"character":1}},"selectionRange":{"start":{"line":328,"character":5},"end":{"line":328,"character":33}}},{"name":"prunerObserver","detail":"struct{...}","kind":23,"range":{"start":{"line":400,"character":5},"end":{"line":404,"character":1}},"selectionRange":{"start":{"line":400,"character":5},"end":{"line":400,"character":19}},"children":[{"name":"NoopPrunerObserver","detail":"sm.NoopPrunerObserver","kind":8,"range":{"start":{"line":401,"character":1},"end":{"line":401,"character":22}},"selectionRange":{"start":{"line":401,"character":4},"end":{"line":401,"character":22}}},{"name":"prunedABCIResInfoCh","detail":"chan *sm.ABCIResponsesPrunedInfo","kind":8,"range":{"start":{"line":402,"character":1},"end":{"line":402,"character":55}},"selectionRange":{"start":{"line":402,"character":1},"end":{"line":402,"character":20}}},{"name":"prunedBlocksResInfoCh","detail":"chan *sm.BlocksPrunedInfo","kind":8,"range":{"start":{"line":403,"character":1},"end":{"line":403,"character":48}},"selectionRange":{"start":{"line":403,"character":1},"end":{"line":403,"character":22}}}]},{"name":"newPrunerObserver","detail":"func(infoChCap int) *prunerObserver","kind":12,"range":{"start":{"line":406,"character":0},"end":{"line":411,"character":1}},"selectionRange":{"start":{"line":406,"character":5},"end":{"line":406,"character":22}}},{"name":"(*prunerObserver).PrunerPrunedABCIRes","detail":"func(info *sm.ABCIResponsesPrunedInfo)","kind":6,"range":{"start":{"line":413,"character":0},"end":{"line":415,"character":1}},"selectionRange":{"start":{"line":413,"character":25},"end":{"line":413,"character":44}}},{"name":"(*prunerObserver).PrunerPrunedBlocks","detail":"func(info *sm.BlocksPrunedInfo)","kind":6,"range":{"start":{"line":417,"character":0},"end":{"line":419,"character":1}},"selectionRange":{"start":{"line":417,"character":25},"end":{"line":417,"character":43}}},{"name":"TestFinalizeBlockResponsePruning","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":421,"character":0},"end":{"line":472,"character":1}},"selectionRange":{"start":{"line":421,"character":5},"end":{"line":421,"character":37}}},{"name":"TestLastFinalizeBlockResponses","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":474,"character":0},"end":{"line":536,"character":1}},"selectionRange":{"start":{"line":474,"character":5},"end":{"line":474,"character":35}}},{"name":"TestFinalizeBlockRecoveryUsingLegacyABCIResponses","detail":"func(t *testing.T)","kind":12,"range":{"start":{"line":538,"character":0},"end":{"line":581,"character":1}},"selectionRange":{"start":{"line":538,"character":5},"end":{"line":538,"character":54}}}]
[Trace - 09:33:36.684 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","diagnostics":[{"range":{"start":{"line":304,"character":7},"end":{"line":304,"character":47}},"severity":1,"code":"InvalidIfaceAssign","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#InvalidIfaceAssign"},"source":"compiler","message":"cannot use pruner.SetCompanionBlockRetainHeight(10) (value of type bool) as error value in assignment: bool does not implement error (missing method Error)"}]}
[Error - Received] 09:33:36.685 AM #36 semantictokens are disabled
[Error - 09:33:36] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:36.689 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","version":2,"diagnostics":[{"range":{"start":{"line":304,"character":7},"end":{"line":304,"character":47}},"severity":1,"code":"InvalidIfaceAssign","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#InvalidIfaceAssign"},"source":"compiler","message":"cannot use pruner.SetCompanionBlockRetainHeight(10) (value of type bool) as error value in assignment: bool does not implement error (missing method Error)"}]}
[Trace - 09:33:36.689 AM] Sending notification 'textDocument/didClose'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go"}}
[Trace - 09:33:36.689 AM] Sending request 'workspace/executeCommand - (37)'.
Params: {"command":"gopls.list_imports","arguments":[{"URI":"file:///home/thane/work/informal/cometbft/state/store_test.go"}]}
[Trace - 09:33:36.690 AM] Sending request 'workspace/executeCommand - (38)'.
Params: {"command":"gopls.list_imports","arguments":[{"URI":"file:///home/thane/work/informal/cometbft/state/store_test.go"}]}
[Trace - 09:33:36.691 AM] Sending request 'workspace/executeCommand - (39)'.
Params: {"command":"gopls.list_imports","arguments":[{"URI":"file:///home/thane/work/informal/cometbft/state/store_test.go"}]}
[Trace - 09:33:36.700 AM] Received response 'workspace/executeCommand - (37)' in 10ms.
Result: {"Imports":[{"Path":"fmt","Name":""},{"Path":"os","Name":""},{"Path":"testing","Name":""},{"Path":"time","Name":""},{"Path":"github.com/stretchr/testify/assert","Name":""},{"Path":"github.com/stretchr/testify/require","Name":""},{"Path":"github.com/cometbft/cometbft-db","Name":"dbm"},{"Path":"github.com/cometbft/cometbft/abci/types","Name":"abci"},{"Path":"github.com/cometbft/cometbft/crypto","Name":""},{"Path":"github.com/cometbft/cometbft/crypto/ed25519","Name":""},{"Path":"github.com/cometbft/cometbft/internal/test","Name":""},{"Path":"github.com/cometbft/cometbft/libs/log","Name":""},{"Path":"github.com/cometbft/cometbft/libs/rand","Name":"cmtrand"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state","Name":"cmtstate"},{"Path":"github.com/cometbft/cometbft/state","Name":"sm"},{"Path":"github.com/cometbft/cometbft/store","Name":""},{"Path":"github.com/cometbft/cometbft/types","Name":""}],"PackageImports":[{"Path":"bytes"},{"Path":"context"},{"Path":"crypto/rand"},{"Path":"errors"},{"Path":"fmt"},{"Path":"github.com/cometbft/cometbft-db"},{"Path":"github.com/cometbft/cometbft/abci/client/mocks"},{"Path":"github.com/cometbft/cometbft/abci/types"},{"Path":"github.com/cometbft/cometbft/abci/types/mocks"},{"Path":"github.com/cometbft/cometbft/crypto"},{"Path":"github.com/cometbft/cometbft/crypto/ed25519"},{"Path":"github.com/cometbft/cometbft/crypto/encoding"},{"Path":"github.com/cometbft/cometbft/crypto/tmhash"},{"Path":"github.com/cometbft/cometbft/internal/test"},{"Path":"github.com/cometbft/cometbft/libs/log"},{"Path":"github.com/cometbft/cometbft/libs/rand"},{"Path":"github.com/cometbft/cometbft/mempool/mocks"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/types"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/version"},{"Path":"github.com/cometbft/cometbft/proxy"},{"Path":"github.com/cometbft/cometbft/proxy/mocks"},{"Path":"github.com/cometbft/cometbft/state"},{"Path":"github.com/cometbft/cometbft/state/mocks"},{"Path":"github.com/cometbft/cometbft/store"},{"Path":"github.com/cometbft/cometbft/types"},{"Path":"github.com/cometbft/cometbft/types/errors"},{"Path":"github.com/cometbft/cometbft/types/time"},{"Path":"github.com/cometbft/cometbft/version"},{"Path":"github.com/stretchr/testify/assert"},{"Path":"github.com/stretchr/testify/mock"},{"Path":"github.com/stretchr/testify/require"},{"Path":"math"},{"Path":"math/big"},{"Path":"os"},{"Path":"testing"},{"Path":"time"}]}
[Trace - 09:33:36.701 AM] Received response 'workspace/executeCommand - (38)' in 10ms.
Result: {"Imports":[{"Path":"fmt","Name":""},{"Path":"os","Name":""},{"Path":"testing","Name":""},{"Path":"time","Name":""},{"Path":"github.com/stretchr/testify/assert","Name":""},{"Path":"github.com/stretchr/testify/require","Name":""},{"Path":"github.com/cometbft/cometbft-db","Name":"dbm"},{"Path":"github.com/cometbft/cometbft/abci/types","Name":"abci"},{"Path":"github.com/cometbft/cometbft/crypto","Name":""},{"Path":"github.com/cometbft/cometbft/crypto/ed25519","Name":""},{"Path":"github.com/cometbft/cometbft/internal/test","Name":""},{"Path":"github.com/cometbft/cometbft/libs/log","Name":""},{"Path":"github.com/cometbft/cometbft/libs/rand","Name":"cmtrand"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state","Name":"cmtstate"},{"Path":"github.com/cometbft/cometbft/state","Name":"sm"},{"Path":"github.com/cometbft/cometbft/store","Name":""},{"Path":"github.com/cometbft/cometbft/types","Name":""}],"PackageImports":[{"Path":"bytes"},{"Path":"context"},{"Path":"crypto/rand"},{"Path":"errors"},{"Path":"fmt"},{"Path":"github.com/cometbft/cometbft-db"},{"Path":"github.com/cometbft/cometbft/abci/client/mocks"},{"Path":"github.com/cometbft/cometbft/abci/types"},{"Path":"github.com/cometbft/cometbft/abci/types/mocks"},{"Path":"github.com/cometbft/cometbft/crypto"},{"Path":"github.com/cometbft/cometbft/crypto/ed25519"},{"Path":"github.com/cometbft/cometbft/crypto/encoding"},{"Path":"github.com/cometbft/cometbft/crypto/tmhash"},{"Path":"github.com/cometbft/cometbft/internal/test"},{"Path":"github.com/cometbft/cometbft/libs/log"},{"Path":"github.com/cometbft/cometbft/libs/rand"},{"Path":"github.com/cometbft/cometbft/mempool/mocks"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/types"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/version"},{"Path":"github.com/cometbft/cometbft/proxy"},{"Path":"github.com/cometbft/cometbft/proxy/mocks"},{"Path":"github.com/cometbft/cometbft/state"},{"Path":"github.com/cometbft/cometbft/state/mocks"},{"Path":"github.com/cometbft/cometbft/store"},{"Path":"github.com/cometbft/cometbft/types"},{"Path":"github.com/cometbft/cometbft/types/errors"},{"Path":"github.com/cometbft/cometbft/types/time"},{"Path":"github.com/cometbft/cometbft/version"},{"Path":"github.com/stretchr/testify/assert"},{"Path":"github.com/stretchr/testify/mock"},{"Path":"github.com/stretchr/testify/require"},{"Path":"math"},{"Path":"math/big"},{"Path":"os"},{"Path":"testing"},{"Path":"time"}]}
[Trace - 09:33:36.701 AM] Received response 'workspace/executeCommand - (39)' in 10ms.
Result: {"Imports":[{"Path":"fmt","Name":""},{"Path":"os","Name":""},{"Path":"testing","Name":""},{"Path":"time","Name":""},{"Path":"github.com/stretchr/testify/assert","Name":""},{"Path":"github.com/stretchr/testify/require","Name":""},{"Path":"github.com/cometbft/cometbft-db","Name":"dbm"},{"Path":"github.com/cometbft/cometbft/abci/types","Name":"abci"},{"Path":"github.com/cometbft/cometbft/crypto","Name":""},{"Path":"github.com/cometbft/cometbft/crypto/ed25519","Name":""},{"Path":"github.com/cometbft/cometbft/internal/test","Name":""},{"Path":"github.com/cometbft/cometbft/libs/log","Name":""},{"Path":"github.com/cometbft/cometbft/libs/rand","Name":"cmtrand"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state","Name":"cmtstate"},{"Path":"github.com/cometbft/cometbft/state","Name":"sm"},{"Path":"github.com/cometbft/cometbft/store","Name":""},{"Path":"github.com/cometbft/cometbft/types","Name":""}],"PackageImports":[{"Path":"bytes"},{"Path":"context"},{"Path":"crypto/rand"},{"Path":"errors"},{"Path":"fmt"},{"Path":"github.com/cometbft/cometbft-db"},{"Path":"github.com/cometbft/cometbft/abci/client/mocks"},{"Path":"github.com/cometbft/cometbft/abci/types"},{"Path":"github.com/cometbft/cometbft/abci/types/mocks"},{"Path":"github.com/cometbft/cometbft/crypto"},{"Path":"github.com/cometbft/cometbft/crypto/ed25519"},{"Path":"github.com/cometbft/cometbft/crypto/encoding"},{"Path":"github.com/cometbft/cometbft/crypto/tmhash"},{"Path":"github.com/cometbft/cometbft/internal/test"},{"Path":"github.com/cometbft/cometbft/libs/log"},{"Path":"github.com/cometbft/cometbft/libs/rand"},{"Path":"github.com/cometbft/cometbft/mempool/mocks"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/state"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/types"},{"Path":"github.com/cometbft/cometbft/proto/tendermint/version"},{"Path":"github.com/cometbft/cometbft/proxy"},{"Path":"github.com/cometbft/cometbft/proxy/mocks"},{"Path":"github.com/cometbft/cometbft/state"},{"Path":"github.com/cometbft/cometbft/state/mocks"},{"Path":"github.com/cometbft/cometbft/store"},{"Path":"github.com/cometbft/cometbft/types"},{"Path":"github.com/cometbft/cometbft/types/errors"},{"Path":"github.com/cometbft/cometbft/types/time"},{"Path":"github.com/cometbft/cometbft/version"},{"Path":"github.com/stretchr/testify/assert"},{"Path":"github.com/stretchr/testify/mock"},{"Path":"github.com/stretchr/testify/require"},{"Path":"math"},{"Path":"math/big"},{"Path":"os"},{"Path":"testing"},{"Path":"time"}]}
[Trace - 09:33:36.819 AM] Sending request 'textDocument/foldingRange - (40)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:36.820 AM] Received response 'textDocument/foldingRange - (40)' in 0ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":9,"endCharacter":44,"kind":"imports"},{"startLine":12,"startCharacter":5,"endLine":15,"endCharacter":65},{"startLine":18,"startCharacter":79,"endLine":21,"endCharacter":66,"kind":"comment"},{"startLine":22,"startCharacter":20,"endLine":40,"endCharacter":17},{"startLine":43,"startCharacter":26,"endLine":49,"endCharacter":40},{"startLine":52,"startCharacter":42,"endLine":58,"endCharacter":2},{"startLine":53,"startCharacter":22,"endLine":57,"endCharacter":25},{"startLine":63,"startCharacter":78,"endLine":66,"endCharacter":13,"kind":"comment"},{"startLine":67,"startCharacter":105,"endLine":72,"endCharacter":2},{"startLine":68,"startCharacter":31,"endLine":71,"endCharacter":65},{"startLine":75,"startCharacter":78,"endLine":76,"endCharacter":10,"kind":"comment"},{"startLine":77,"startCharacter":55,"endLine":78,"endCharacter":48},{"startLine":81,"startCharacter":58,"endLine":82,"endCharacter":50},{"startLine":85,"startCharacter":55,"endLine":88,"endCharacter":2},{"startLine":86,"startCharacter":31,"endLine":87,"endCharacter":21},{"startLine":91,"startCharacter":101,"endLine":108,"endCharacter":9},{"startLine":93,"startCharacter":30,"endLine":94,"endCharacter":10},{"startLine":96,"startCharacter":14,"endLine":105,"endCharacter":45},{"startLine":111,"startCharacter":50,"endLine":112,"endCharacter":17},{"startLine":115,"startCharacter":34,"endLine":119,"endCharacter":11},{"startLine":122,"startCharacter":75,"endLine":130,"endCharacter":10,"kind":"comment"},{"startLine":131,"startCharacter":70,"endLine":162,"endCharacter":11},{"startLine":132,"startCharacter":74,"endLine":133,"endCharacter":15,"kind":"comment"},{"startLine":137,"startCharacter":46,"endLine":138,"endCharacter":30},{"startLine":141,"startCharacter":16,"endLine":145,"endCharacter":33},{"startLine":142,"startCharacter":38,"endLine":143,"endCharacter":13},{"startLine":149,"startCharacter":16,"endLine":153,"endCharacter":34},{"startLine":150,"startCharacter":38,"endLine":151,"endCharacter":13},{"startLine":155,"startCharacter":108,"endLine":156,"endCharacter":41},{"startLine":158,"startCharacter":73,"endLine":159,"endCharacter":12},{"startLine":165,"startCharacter":67,"endLine":169,"endCharacter":12},{"startLine":166,"startCharacter":67,"endLine":167,"endCharacter":14},{"startLine":172,"startCharacter":83,"endLine":179,"endCharacter":75,"kind":"comment"},{"startLine":180,"startCharacter":68,"endLine":211,"endCharacter":11},{"startLine":181,"startCharacter":69,"endLine":182,"endCharacter":15,"kind":"comment"},{"startLine":186,"startCharacter":46,"endLine":187,"endCharacter":30},{"startLine":190,"startCharacter":16,"endLine":194,"endCharacter":39},{"startLine":191,"startCharacter":38,"endLine":192,"endCharacter":13},{"startLine":198,"startCharacter":16,"endLine":202,"endCharacter":28},{"startLine":199,"startCharacter":38,"endLine":200,"endCharacter":13},{"startLine":204,"startCharacter":102,"endLine":205,"endCharacter":41},{"startLine":207,"startCharacter":76,"endLine":208,"endCharacter":12},{"startLine":214,"startCharacter":68,"endLine":217,"endCharacter":18,"kind":"comment"},{"startLine":218,"startCharacter":61,"endLine":241,"endCharacter":11},{"startLine":219,"startCharacter":69,"endLine":220,"endCharacter":15,"kind":"comment"},{"startLine":224,"startCharacter":43,"endLine":225,"endCharacter":30},{"startLine":228,"startCharacter":16,"endLine":232,"endCharacter":53},{"startLine":229,"startCharacter":38,"endLine":230,"endCharacter":13},{"startLine":234,"startCharacter":34,"endLine":235,"endCharacter":41},{"startLine":237,"startCharacter":69,"endLine":238,"endCharacter":12},{"startLine":244,"startCharacter":71,"endLine":245,"endCharacter":67,"kind":"comment"},{"startLine":246,"startCharacter":62,"endLine":247,"endCharacter":49},{"startLine":250,"startCharacter":74,"endLine":251,"endCharacter":70,"kind":"comment"},{"startLine":252,"startCharacter":65,"endLine":253,"endCharacter":52},{"startLine":256,"startCharacter":67,"endLine":257,"endCharacter":63,"kind":"comment"},{"startLine":258,"startCharacter":58,"endLine":259,"endCharacter":45},{"startLine":262,"startCharacter":40,"endLine":278,"endCharacter":2},{"startLine":265,"startCharacter":6,"endLine":277,"endCharacter":3},{"startLine":266,"startCharacter":10,"endLine":276,"endCharacter":25},{"startLine":267,"startCharacter":18,"endLine":268,"endCharacter":9},{"startLine":269,"startCharacter":10,"endLine":276,"endCharacter":25},{"startLine":271,"startCharacter":34,"endLine":274,"endCharacter":4},{"startLine":271,"startCharacter":59,"endLine":273,"endCharacter":42},{"startLine":281,"startCharacter":39,"endLine":297,"endCharacter":2},{"startLine":284,"startCharacter":6,"endLine":296,"endCharacter":3},{"startLine":285,"startCharacter":10,"endLine":295,"endCharacter":25},{"startLine":286,"startCharacter":18,"endLine":287,"endCharacter":9},{"startLine":288,"startCharacter":10,"endLine":295,"endCharacter":25},{"startLine":290,"startCharacter":33,"endLine":293,"endCharacter":4},{"startLine":290,"startCharacter":51,"endLine":292,"endCharacter":35},{"startLine":300,"startCharacter":74,"endLine":315,"endCharacter":23},{"startLine":302,"startCharacter":44,"endLine":303,"endCharacter":25},{"startLine":306,"startCharacter":72,"endLine":307,"endCharacter":23,"kind":"comment"},{"startLine":309,"startCharacter":16,"endLine":310,"endCharacter":132},{"startLine":311,"startCharacter":23,"endLine":313,"endCharacter":126},{"startLine":318,"startCharacter":75,"endLine":346,"endCharacter":23},{"startLine":320,"startCharacter":16,"endLine":327,"endCharacter":25},{"startLine":321,"startCharacter":70,"endLine":322,"endCharacter":25,"kind":"comment"},{"startLine":323,"startCharacter":37,"endLine":324,"endCharacter":11},{"startLine":330,"startCharacter":44,"endLine":331,"endCharacter":25},{"startLine":334,"startCharacter":76,"endLine":336,"endCharacter":12,"kind":"comment"},{"startLine":338,"startCharacter":16,"endLine":340,"endCharacter":25},{"startLine":342,"startCharacter":19,"endLine":344,"endCharacter":63},{"startLine":349,"startCharacter":51,"endLine":381,"endCharacter":22},{"startLine":351,"startCharacter":16,"endLine":358,"endCharacter":21},{"startLine":352,"startCharacter":38,"endLine":354,"endCharacter":11},{"startLine":356,"startCharacter":72,"endLine":357,"endCharacter":65,"kind":"comment"},{"startLine":360,"startCharacter":75,"endLine":361,"endCharacter":45,"kind":"comment"},{"startLine":362,"startCharacter":18,"endLine":363,"endCharacter":24},{"startLine":366,"startCharacter":16,"endLine":374,"endCharacter":44},{"startLine":367,"startCharacter":38,"endLine":369,"endCharacter":11},{"startLine":371,"startCharacter":73,"endLine":373,"endCharacter":27,"kind":"comment"},{"startLine":376,"startCharacter":74,"endLine":377,"endCharacter":24,"kind":"comment"},{"startLine":378,"startCharacter":38,"endLine":379,"endCharacter":24},{"startLine":384,"startCharacter":67,"endLine":402,"endCharacter":35},{"startLine":385,"startCharacter":17,"endLine":386,"endCharacter":37},{"startLine":392,"startCharacter":16,"endLine":393,"endCharacter":51},{"startLine":396,"startCharacter":16,"endLine":397,"endCharacter":63},{"startLine":399,"startCharacter":79,"endLine":400,"endCharacter":63}]
[Trace - 09:33:36.845 AM] Sending request 'textDocument/codeAction - (41)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":180,"character":26},"end":{"line":180,"character":26}},"context":{"diagnostics":[{"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":46}},"message":"method Pruner.SetCompanionBlockRetainHeight already declared at /home/thane/work/informal/cometbft/state/pruner.go:166:18","code":"DuplicateMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#DuplicateMethod"},"severity":1,"source":"compiler"}],"triggerKind":2}}
[Trace - 09:33:36.853 AM] Received response 'textDocument/codeAction - (41)' in 8ms.
Result: null
[Trace - 09:33:36.895 AM] Sending request 'textDocument/codeLens - (42)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:36.895 AM] Received response 'textDocument/codeLens - (42)' in 0ms.
Result: null
[Trace - 09:33:36.948 AM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","type":2},{"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","type":2}]}
[Trace - 09:33:36.969 AM] Sending request 'textDocument/semanticTokens/full - (43)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Error - Received] 09:33:36.969 AM #43 semantictokens are disabled
[Error - 09:33:36] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Trace - 09:33:37.045 AM] Sending request 'textDocument/documentSymbol - (44)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:37.045 AM] Received response 'textDocument/documentSymbol - (44)' in 0ms.
Result: [{"name":"AppRetainHeightKey","kind":13,"range":{"start":{"line":13,"character":1},"end":{"line":13,"character":61}},"selectionRange":{"start":{"line":13,"character":1},"end":{"line":13,"character":19}}},{"name":"CompanionBlockRetainHeightKey","kind":13,"range":{"start":{"line":14,"character":1},"end":{"line":14,"character":65}},"selectionRange":{"start":{"line":14,"character":1},"end":{"line":14,"character":30}}},{"name":"ABCIResultsRetainHeightKey","kind":13,"range":{"start":{"line":15,"character":1},"end":{"line":15,"character":65}},"selectionRange":{"start":{"line":15,"character":1},"end":{"line":15,"character":27}}},{"name":"Pruner","detail":"struct{...}","kind":23,"range":{"start":{"line":22,"character":5},"end":{"line":41,"character":1}},"selectionRange":{"start":{"line":22,"character":5},"end":{"line":22,"character":11}},"children":[{"name":"BaseService","detail":"service.BaseService","kind":8,"range":{"start":{"line":23,"character":1},"end":{"line":23,"character":20}},"selectionRange":{"start":{"line":23,"character":9},"end":{"line":23,"character":20}}},{"name":"logger","detail":"log.Logger","kind":8,"range":{"start":{"line":24,"character":1},"end":{"line":24,"character":18}},"selectionRange":{"start":{"line":24,"character":1},"end":{"line":24,"character":7}}},{"name":"mtx","detail":"sync.Mutex","kind":8,"range":{"start":{"line":26,"character":1},"end":{"line":26,"character":15}},"selectionRange":{"start":{"line":26,"character":1},"end":{"line":26,"character":4}}},{"name":"dcEnabled","detail":"bool","kind":8,"range":{"start":{"line":28,"character":1},"end":{"line":28,"character":36}},"selectionRange":{"start":{"line":28,"character":1},"end":{"line":28,"character":10}}},{"name":"dcInitBlockRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":29,"character":1},"end":{"line":29,"character":37}},"selectionRange":{"start":{"line":29,"character":1},"end":{"line":29,"character":24}}},{"name":"dcInitBlockResultsRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":30,"character":1},"end":{"line":30,"character":37}},"selectionRange":{"start":{"line":30,"character":1},"end":{"line":30,"character":31}}},{"name":"bs","detail":"BlockStore","kind":8,"range":{"start":{"line":32,"character":1},"end":{"line":32,"character":14}},"selectionRange":{"start":{"line":32,"character":1},"end":{"line":32,"character":3}}},{"name":"stateStore","detail":"Store","kind":8,"range":{"start":{"line":34,"character":1},"end":{"line":34,"character":17}},"selectionRange":{"start":{"line":34,"character":1},"end":{"line":34,"character":11}}},{"name":"interval","detail":"time.Duration","kind":8,"range":{"start":{"line":36,"character":1},"end":{"line":36,"character":23}},"selectionRange":{"start":{"line":36,"character":1},"end":{"line":36,"character":9}}},{"name":"observer","detail":"PrunerObserver","kind":8,"range":{"start":{"line":38,"character":1},"end":{"line":38,"character":24}},"selectionRange":{"start":{"line":38,"character":1},"end":{"line":38,"character":9}}},{"name":"metrics","detail":"*Metrics","kind":8,"range":{"start":{"line":40,"character":1},"end":{"line":40,"character":17}},"selectionRange":{"start":{"line":40,"character":1},"end":{"line":40,"character":8}}}]},{"name":"prunerConfig","detail":"struct{...}","kind":23,"range":{"start":{"line":43,"character":5},"end":{"line":50,"character":1}},"selectionRange":{"start":{"line":43,"character":5},"end":{"line":43,"character":17}},"children":[{"name":"dcEnabled","detail":"bool","kind":8,"range":{"start":{"line":44,"character":1},"end":{"line":44,"character":36}},"selectionRange":{"start":{"line":44,"character":1},"end":{"line":44,"character":10}}},{"name":"dcInitBlockRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":45,"character":1},"end":{"line":45,"character":37}},"selectionRange":{"start":{"line":45,"character":1},"end":{"line":45,"character":24}}},{"name":"dcInitBlockResultsRetainHeight","detail":"int64","kind":8,"range":{"start":{"line":46,"character":1},"end":{"line":46,"character":37}},"selectionRange":{"start":{"line":46,"character":1},"end":{"line":46,"character":31}}},{"name":"interval","detail":"time.Duration","kind":8,"range":{"start":{"line":47,"character":1},"end":{"line":47,"character":45}},"selectionRange":{"start":{"line":47,"character":1},"end":{"line":47,"character":9}}},{"name":"observer","detail":"PrunerObserver","kind":8,"range":{"start":{"line":48,"character":1},"end":{"line":48,"character":46}},"selectionRange":{"start":{"line":48,"character":1},"end":{"line":48,"character":9}}},{"name":"metrics","detail":"*Metrics","kind":8,"range":{"start":{"line":49,"character":1},"end":{"line":49,"character":40}},"selectionRange":{"start":{"line":49,"character":1},"end":{"line":49,"character":8}}}]},{"name":"defaultPrunerConfig","detail":"func() *prunerConfig","kind":12,"range":{"start":{"line":52,"character":0},"end":{"line":59,"character":1}},"selectionRange":{"start":{"line":52,"character":5},"end":{"line":52,"character":24}}},{"name":"PrunerOption","detail":"func(*prunerConfig)","kind":12,"range":{"start":{"line":61,"character":5},"end":{"line":61,"character":37}},"selectionRange":{"start":{"line":61,"character":5},"end":{"line":61,"character":17}}},{"name":"WithPrunerCompanionEnabled","detail":"func(initBlockRetainHeight, initBlockResultsRetainHeight int64) PrunerOption","kind":12,"range":{"start":{"line":67,"character":0},"end":{"line":73,"character":1}},"selectionRange":{"start":{"line":67,"character":5},"end":{"line":67,"character":31}}},{"name":"WithPrunerInterval","detail":"func(t time.Duration) PrunerOption","kind":12,"range":{"start":{"line":77,"character":0},"end":{"line":79,"character":1}},"selectionRange":{"start":{"line":77,"character":5},"end":{"line":77,"character":23}}},{"name":"WithPrunerObserver","detail":"func(obs PrunerObserver) PrunerOption","kind":12,"range":{"start":{"line":81,"character":0},"end":{"line":83,"character":1}},"selectionRange":{"start":{"line":81,"character":5},"end":{"line":81,"character":23}}},{"name":"WithPrunerMetrics","detail":"func(metrics *Metrics) PrunerOption","kind":12,"range":{"start":{"line":85,"character":0},"end":{"line":89,"character":1}},"selectionRange":{"start":{"line":85,"character":5},"end":{"line":85,"character":22}}},{"name":"NewPruner","detail":"func(stateStore Store, bs BlockStore, logger log.Logger, options ...PrunerOption) *Pruner","kind":12,"range":{"start":{"line":91,"character":0},"end":{"line":109,"character":1}},"selectionRange":{"start":{"line":91,"character":5},"end":{"line":91,"character":14}}},{"name":"(*Pruner).SetObserver","detail":"func(obs PrunerObserver)","kind":6,"range":{"start":{"line":111,"character":0},"end":{"line":113,"character":1}},"selectionRange":{"start":{"line":111,"character":17},"end":{"line":111,"character":28}}},{"name":"(*Pruner).OnStart","detail":"func() error","kind":6,"range":{"start":{"line":115,"character":0},"end":{"line":120,"character":1}},"selectionRange":{"start":{"line":115,"character":17},"end":{"line":115,"character":24}}},{"name":"(*Pruner).SetApplicationBlockRetainHeight","detail":"func(height int64) error","kind":6,"range":{"start":{"line":131,"character":0},"end":{"line":163,"character":1}},"selectionRange":{"start":{"line":131,"character":17},"end":{"line":131,"character":48}}},{"name":"(*Pruner).SetCompanionBlockRetainHeight","detail":"func(height int64) bool","kind":6,"range":{"start":{"line":165,"character":0},"end":{"line":170,"character":1}},"selectionRange":{"start":{"line":165,"character":17},"end":{"line":165,"character":46}}},{"name":"(*Pruner).SetCompanionBlockRetainHeight","detail":"func(height int64) error","kind":6,"range":{"start":{"line":180,"character":0},"end":{"line":212,"character":1}},"selectionRange":{"start":{"line":180,"character":17},"end":{"line":180,"character":46}}},{"name":"(*Pruner).SetABCIResRetainHeight","detail":"func(height int64) error","kind":6,"range":{"start":{"line":218,"character":0},"end":{"line":242,"character":1}},"selectionRange":{"start":{"line":218,"character":17},"end":{"line":218,"character":39}}},{"name":"(*Pruner).GetApplicationRetainHeight","detail":"func() (int64, error)","kind":6,"range":{"start":{"line":246,"character":0},"end":{"line":248,"character":1}},"selectionRange":{"start":{"line":246,"character":17},"end":{"line":246,"character":43}}},{"name":"(*Pruner).GetCompanionBlockRetainHeight","detail":"func() (int64, error)","kind":6,"range":{"start":{"line":252,"character":0},"end":{"line":254,"character":1}},"selectionRange":{"start":{"line":252,"character":17},"end":{"line":252,"character":46}}},{"name":"(*Pruner).GetABCIResRetainHeight","detail":"func() (int64, error)","kind":6,"range":{"start":{"line":258,"character":0},"end":{"line":260,"character":1}},"selectionRange":{"start":{"line":258,"character":17},"end":{"line":258,"character":39}}},{"name":"(*Pruner).pruneABCIResRoutine","detail":"func()","kind":6,"range":{"start":{"line":262,"character":0},"end":{"line":279,"character":1}},"selectionRange":{"start":{"line":262,"character":17},"end":{"line":262,"character":36}}},{"name":"(*Pruner).pruneBlocksRoutine","detail":"func()","kind":6,"range":{"start":{"line":281,"character":0},"end":{"line":298,"character":1}},"selectionRange":{"start":{"line":281,"character":17},"end":{"line":281,"character":35}}},{"name":"(*Pruner).pruneBlocksToRetainHeight","detail":"func(lastRetainHeight int64) int64","kind":6,"range":{"start":{"line":300,"character":0},"end":{"line":316,"character":1}},"selectionRange":{"start":{"line":300,"character":17},"end":{"line":300,"character":42}}},{"name":"(*Pruner).pruneABCIResToRetainHeight","detail":"func(lastRetainHeight int64) int64","kind":6,"range":{"start":{"line":318,"character":0},"end":{"line":347,"character":1}},"selectionRange":{"start":{"line":318,"character":17},"end":{"line":318,"character":43}}},{"name":"(*Pruner).findMinBlockRetainHeight","detail":"func() int64","kind":6,"range":{"start":{"line":349,"character":0},"end":{"line":382,"character":1}},"selectionRange":{"start":{"line":349,"character":17},"end":{"line":349,"character":41}}},{"name":"(*Pruner).pruneBlocks","detail":"func(height int64) (uint64, int64, error)","kind":6,"range":{"start":{"line":384,"character":0},"end":{"line":403,"character":1}},"selectionRange":{"start":{"line":384,"character":17},"end":{"line":384,"character":28}}}]
[Trace - 09:33:37.769 AM] Sending request 'textDocument/inlayHint - (45)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":96,"character":0},"end":{"line":259,"character":38}}}
[Trace - 09:33:37.777 AM] Received response 'textDocument/inlayHint - (45)' in 7ms.
Result: null
[Trace - 09:33:38.020 AM] Sending request 'textDocument/documentLink - (46)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"}}
[Trace - 09:33:38.034 AM] Received response 'textDocument/documentLink - (46)' in 14ms.
Result: [{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":8}},"target":"https://pkg.go.dev/errors"},{"range":{"start":{"line":4,"character":2},"end":{"line":4,"character":6}},"target":"https://pkg.go.dev/sync"},{"range":{"start":{"line":5,"character":2},"end":{"line":5,"character":6}},"target":"https://pkg.go.dev/time"},{"range":{"start":{"line":7,"character":2},"end":{"line":7,"character":37}},"target":"https://pkg.go.dev/github.com/cometbft/cometbft/config"},{"range":{"start":{"line":8,"character":2},"end":{"line":8,"character":39}},"target":"https://pkg.go.dev/github.com/cometbft/cometbft/libs/log"},{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":43}},"target":"https://pkg.go.dev/github.com/cometbft/cometbft/libs/service"}]
[Trace - 09:33:38.157 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/store/store_test.go","diagnostics":[{"range":{"start":{"line":661,"character":14},"end":{"line":661,"character":38}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"pruner.SetCompanionRetainHeight undefined (type *\"github.com/cometbft/cometbft/state\".Pruner has no field or method SetCompanionRetainHeight)"},{"range":{"start":{"line":664,"character":14},"end":{"line":664,"character":38}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"pruner.SetCompanionRetainHeight undefined (type *\"github.com/cometbft/cometbft/state\".Pruner has no field or method SetCompanionRetainHeight)"}]}
[Trace - 09:33:38.157 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/rpc/grpc/server/services/pruningservice/service.go","diagnostics":[{"range":{"start":{"line":42,"character":20},"end":{"line":42,"character":44}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"s.pruner.SetCompanionRetainHeight undefined (type *\"github.com/cometbft/cometbft/state\".Pruner has no field or method SetCompanionRetainHeight)"}]}
[Trace - 09:33:38.157 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go","version":2,"diagnostics":[{"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":46}},"severity":1,"code":"DuplicateMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#DuplicateMethod"},"source":"compiler","message":"method Pruner.SetCompanionBlockRetainHeight already declared at /home/thane/work/informal/cometbft/state/pruner.go:166:18"}]}
[Trace - 09:33:38.157 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///home/thane/work/informal/cometbft/state/store_test.go","diagnostics":[{"range":{"start":{"line":304,"character":7},"end":{"line":304,"character":47}},"severity":1,"code":"InvalidIfaceAssign","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#InvalidIfaceAssign"},"source":"compiler","message":"cannot use pruner.SetCompanionBlockRetainHeight(10) (value of type bool) as error value in assignment: bool does not implement error (missing method Error)"}]}
[Trace - 09:33:38.421 AM] Sending request 'textDocument/codeAction - (47)'.
Params: {"textDocument":{"uri":"file:///home/thane/work/informal/cometbft/state/pruner.go"},"range":{"start":{"line":180,"character":26},"end":{"line":180,"character":26}},"context":{"diagnostics":[{"range":{"start":{"line":180,"character":17},"end":{"line":180,"character":46}},"message":"method Pruner.SetCompanionBlockRetainHeight already declared at /home/thane/work/informal/cometbft/state/pruner.go:166:18","code":"DuplicateMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#DuplicateMethod"},"severity":1,"source":"compiler"}],"triggerKind":2}}
[Trace - 09:33:38.424 AM] Received response 'textDocument/codeAction - (47)' in 2ms.
Result: null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment