Skip to content

Conversation

@Eric-Warehime
Copy link
Contributor

Description

Adds object store and refactors the store types to use generics for code re-use.

This is a preliminary PR which will enable us to integrate BlockSTM into the SDK for parallel transaction processing which requires us to be able to write arbitrary objects to transient stores in order to subsequently accumulate them in the end blocker.

yihuang and others added 30 commits March 27, 2025 16:15
generic interface

generic btree

generic cachekv

generic transient store

support ObjStore

changelog

Update CHANGELOG.md

Signed-off-by: yihuang <[email protected]>

object store key

Apply review suggestions

fix merge conflict

fix snapshot

revert dependers

prefix store support object store (#236)

Problem: snapshot for object store is not skipped (#585)

resolve
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 77.92553% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.46%. Comparing base (9c4af5a) to head (604402a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
store/internal/btreeadaptor.go 20.00% 16 Missing ⚠️
store/cachemulti/store.go 65.11% 15 Missing ⚠️
store/rootmulti/store.go 78.00% 11 Missing ⚠️
store/prefix/store.go 79.06% 9 Missing ⚠️
store/transient/store.go 57.14% 9 Missing ⚠️
store/cachekv/store.go 83.33% 8 Missing ⚠️
store/gaskv/store.go 88.37% 5 Missing ⚠️
runtime/module.go 20.00% 4 Missing ⚠️
store/internal/btree/btree.go 90.00% 2 Missing ⚠️
store/types/store.go 88.23% 2 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #25470       +/-   ##
===========================================
+ Coverage   52.83%   67.46%   +14.62%     
===========================================
  Files         798      853       +55     
  Lines       64955    68701     +3746     
===========================================
+ Hits        34317    46346    +12029     
+ Misses      30638    22355     -8283     
Files with missing lines Coverage Δ
baseapp/baseapp.go 82.23% <100.00%> (+3.25%) ⬆️
contrib/x/group/internal/orm/testsupport.go 62.22% <100.00%> (ø)
runtime/store.go 62.50% <100.00%> (+62.50%) ⬆️
store/listenkv/store.go 96.07% <100.00%> (ø)
store/tracekv/store.go 93.33% <100.00%> (ø)
store/types/utils.go 78.72% <100.00%> (ø)
store/types/validity.go 93.75% <100.00%> (ø)
types/context.go 91.62% <100.00%> (+13.65%) ⬆️
store/cachekv/internal/mergeiterator.go 91.97% <94.11%> (ø)
store/internal/btree/memiterator.go 93.24% <94.11%> (ø)
... and 10 more

... and 351 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

func (cms Store) GetKVStore(key types.StoreKey) types.KVStore {
store, ok := cms.getCacheWrap(key).(types.KVStore)
if !ok {
panic(fmt.Sprintf("store with key %v is not KVStore", key))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
store := types.KVStore(s)
store, ok := s.(types.KVStore)
if !ok {
panic(fmt.Sprintf("store with key %v is not KVStore", key))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
// AssertValidValueGeneric checks if the value is valid(value is not nil and within length limit)
func AssertValidValueGeneric[V any](value V, isZero func(V) bool, valueLen func(V) int) {
if isZero(value) {
panic("value is nil")

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
// AssertValidValueLength checks if the value length is within length limit
func AssertValidValueLength(l int) {
if l > MaxValueLength {
panic(errors.New("value is too large"))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
store = cms.initStore(key, cms.parentStore(key))
}
if key == nil || store == nil {
panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. updating the title to include a ! since this is breaking

@technicallyty technicallyty changed the title feat: Add object store feat!: Add object store Oct 23, 2025
@Eric-Warehime Eric-Warehime added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit d790942 Oct 23, 2025
41 checks passed
@Eric-Warehime Eric-Warehime deleted the technicallyty/object-stores branch October 23, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants