Skip to content

Conversation

@codchen
Copy link
Collaborator

@codchen codchen commented Jan 20, 2026

Describe your changes and provide context

Cosmos cachekv is quite heavy due to its support for iterators. Giga doesn't have any iterator so the implementation can be greatly simplified. To not disrupt existing v2 behavior, this PR introduces the new cachekv as a giga-specific feature.

Notably scheduler.go is forked because it unfortunately accesses cachekv directly.

Testing performed to validate your change

tests & local sei

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 21, 2026, 4:41 AM

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 10.00000% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.79%. Comparing base (4712ec0) to head (ba420a6).

Files with missing lines Patch % Lines
sei-cosmos/store/cachemulti/store.go 0.00% 23 Missing ⚠️
sei-cosmos/types/context.go 0.00% 7 Missing ⚠️
sei-cosmos/storev2/rootmulti/store.go 25.00% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           tony/giga-test-fidelity    #2717      +/-   ##
===========================================================
- Coverage                    44.01%   41.79%   -2.23%     
===========================================================
  Files                         1980     1016     -964     
  Lines                       162724    84538   -78186     
===========================================================
- Hits                         71622    35330   -36292     
+ Misses                       84585    45866   -38719     
+ Partials                      6517     3342    -3175     
Flag Coverage Δ
sei-chain ?
sei-cosmos 37.87% <10.00%> (-0.34%) ⬇️
sei-db 68.72% <ø> (ø)
sei-tendermint 47.25% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/store/rootmulti/store.go 69.48% <100.00%> (ø)
sei-cosmos/store/types/store.go 64.91% <ø> (ø)
sei-cosmos/storev2/rootmulti/store.go 32.17% <25.00%> (-0.13%) ⬇️
sei-cosmos/types/context.go 52.12% <0.00%> (-1.45%) ⬇️
sei-cosmos/store/cachemulti/store.go 8.24% <0.00%> (-2.28%) ⬇️

... and 975 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +216 to +218
for k, s := range cms.gigaStores {
cms.gigaStores[k] = handler(k, s)
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
Comment on lines +134 to +136
for _, store := range cms.gigaStores {
store.(types.CacheKVStore).Write()
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
Comment on lines +85 to +87
for k, v := range cms.gigaStores {
gigaStores[k] = v
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
Comment on lines +62 to +64
for key, store := range gigaStores {
cms.gigaStores[key] = gigacachekv.NewStore(store, key, types.DefaultCacheSizeLimit)
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
Comment on lines +568 to +567
for _, v := range task.VersionStores {
v.WriteToMultiVersionStore()
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
}

func (store *Store) Iterator(start, end []byte) types.Iterator {
panic("unexpected iterator call on cachekv store")

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
Comment on lines +169 to +171
for k := range keyStrs {
res = append(res, k)
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
Comment on lines +137 to +146
go func() {
for {
select {
case <-ctx.Done():
return
case work := <-ch:
work()
}
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine

Spawning a Go routine may be a possible source of non-determinism

import (
"reflect"
"unsafe"

Check notice

Code scanning / CodeQL

Sensitive package import

Certain system packages contain functions which may be a possible source of non-determinism
package store

import (
"reflect"

Check notice

Code scanning / CodeQL

Sensitive package import

Certain system packages contain functions which may be a possible source of non-determinism
@codchen codchen force-pushed the tony/fork-cachekv branch 2 times, most recently from acd60f6 to 39615dc Compare January 21, 2026 04:03
testApp := app.Setup(t, false, false, false)
func MockApp(t *testing.T) (*app.App, sdk.Context) {
accts := utils.NewTestAccounts(1)
testWrapper := app.NewGigaTestWrapper(t, time.Now(), accts[0].PublicKey, false, false)

Check warning

Code scanning / CodeQL

Calling the system time

Calling the system time may be a possible source of non-determinism
@codchen codchen force-pushed the tony/giga-test-fidelity branch from 4712ec0 to a32e86a Compare January 21, 2026 15:33
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.

4 participants