add Reset() for spm and ewl#7803
Merged
ssd04 merged 3 commits intoasync-trie-prunning-triggerfrom Mar 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Reset() support to the state pruning components to allow clearing in-memory pruning state (storage pruning buffer + eviction waiting list), along with test/mocks updates to support the new interface methods.
Changes:
- Extend
state.DBRemoveCacherandstate.StoragePruningManagerinterfaces withReset(). - Implement
Reset()forstoragePruningManager,memoryEvictionWaitingList, and their disabled/test doubles. - Add a unit test validating
storagePruningManager.Reset()clears the pruning buffer and resets the eviction waiting list.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| testscommon/state/storagePruningManagerStub.go | Adds Reset() hook to the pruning manager stub for tests. |
| testscommon/state/evictionWaitingListMock.go | Adds Reset() to the eviction waiting list mock. |
| state/storagePruningManager/storagePruningManager_test.go | Adds coverage for StoragePruningManager.Reset(). |
| state/storagePruningManager/storagePruningManager.go | Implements Reset() to clear pruning buffer and reset eviction waiting list. |
| state/storagePruningManager/evictionWaitingList/memoryEvictionWaitingList.go | Implements Reset() for the in-memory eviction waiting list. |
| state/storagePruningManager/disabled/disabledStoragePruningManager.go | Adds no-op Reset() to the disabled implementation. |
| state/interface.go | Extends interfaces to include Reset(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
state/storagePruningManager/evictionWaitingList/memoryEvictionWaitingList.go
Show resolved
Hide resolved
state/storagePruningManager/evictionWaitingList/memoryEvictionWaitingList.go
Show resolved
Hide resolved
AdoAdoAdo
approved these changes
Mar 26, 2026
ssd04
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?