-
Notifications
You must be signed in to change notification settings - Fork 862
[giga] replace cosmos cachekv with Giga's impl #2717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: tony/giga-test-fidelity
Are you sure you want to change the base?
Conversation
09ea3d9 to
eb73ffb
Compare
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| for k, s := range cms.gigaStores { | ||
| cms.gigaStores[k] = handler(k, s) | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| for _, store := range cms.gigaStores { | ||
| store.(types.CacheKVStore).Write() | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| for k, v := range cms.gigaStores { | ||
| gigaStores[k] = v | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| for key, store := range gigaStores { | ||
| cms.gigaStores[key] = gigacachekv.NewStore(store, key, types.DefaultCacheSizeLimit) | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| for _, v := range task.VersionStores { | ||
| v.WriteToMultiVersionStore() | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| } | ||
|
|
||
| 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
| for k := range keyStrs { | ||
| res = append(res, k) | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| go func() { | ||
| for { | ||
| select { | ||
| case <-ctx.Done(): | ||
| return | ||
| case work := <-ch: | ||
| work() | ||
| } | ||
| } | ||
| }() |
Check notice
Code scanning / CodeQL
Spawning a Go routine
|
|
||
| import ( | ||
| "reflect" | ||
| "unsafe" |
Check notice
Code scanning / CodeQL
Sensitive package import
| package store | ||
|
|
||
| import ( | ||
| "reflect" |
Check notice
Code scanning / CodeQL
Sensitive package import
eb73ffb to
c9efbf5
Compare
acd60f6 to
39615dc
Compare
| 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
39615dc to
ba420a6
Compare
4712ec0 to
a32e86a
Compare
ba420a6 to
7996b8e
Compare
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.gois forked because it unfortunately accesses cachekv directly.Testing performed to validate your change
tests & local sei