Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions giga/deps/store/cachekv.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,7 @@ func (store *Store) Write() {
}
}

// Mark all entries as clean (not dirty) instead of clearing the cache.
// This is important because the parent store (commitment.Store) doesn't make
// writes immediately visible until Commit(). By keeping the cache populated
// with clean entries, subsequent reads will still hit the cache instead of
// falling through to the parent which can't read uncommitted data.
store.cache.Range(func(key, value any) bool {
cv := value.(*types.CValue)
// Replace with a clean (non-dirty) version of the same value
store.cache.Store(key, types.NewCValue(cv.Value(), false))
return true
})
// Clear the deleted map since those deletes have been sent to parent
store.cache = &sync.Map{}
store.deleted = &sync.Map{}
}

Expand Down
Loading