-
Notifications
You must be signed in to change notification settings - Fork 12
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
Revert changings to locking store #55
Conversation
for key, store := range stores { | ||
if cms.TracingEnabled() { | ||
tctx := cms.traceContext.Clone().Merge(types.TraceContext{ | ||
storeNameCtxKey: key.Name(), | ||
}) | ||
|
||
store = tracekv.NewStore(store.(types.KVStore), cms.traceWriter, tctx) | ||
} | ||
if kvStoreKey, ok := key.(*types.KVStoreKey); ok && kvStoreKey.IsLocking() { | ||
cms.stores[key] = lockingkv.NewStore(store.(types.KVStore)) | ||
} else { | ||
cms.stores[key] = cachekv.NewStore(store.(types.KVStore)) | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
for k, v := range cms.stores { | ||
stores[k] = v | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
for key, store := range stores { | ||
if lockKeys, ok := storeLocks[key]; ok { | ||
cms2.stores[key] = store.(types.LockingCacheWrapper).CacheWrapWithLocks(lockKeys) | ||
} else { | ||
if cms.TracingEnabled() { | ||
tctx := cms.traceContext.Clone().Merge(types.TraceContext{ | ||
storeNameCtxKey: key.Name(), | ||
}) | ||
|
||
store = tracekv.NewStore(store.(types.KVStore), cms.traceWriter, tctx) | ||
} | ||
cms2.stores[key] = cachekv.NewStore(store.(types.KVStore)) | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
} | ||
|
||
func (s *LockableKV) Iterator(start, end []byte) storetypes.Iterator { | ||
panic("This store does not support iteration.") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
} | ||
|
||
func (s *LockableKV) ReverseIterator(start, end []byte) storetypes.Iterator { | ||
panic("This store does not support iteration.") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
|
||
func (s *LockedKV) Has(key []byte) bool { | ||
if key == nil { | ||
panic("nil key") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
|
||
func (s *LockedKV) Set(key, value []byte) { | ||
if key == nil { | ||
panic("nil key") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
} | ||
|
||
func (s *LockedKV) Iterator(start, end []byte) storetypes.Iterator { | ||
panic("This store does not support iteration.") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
} | ||
|
||
func (s *LockedKV) ReverseIterator(start, end []byte) storetypes.Iterator { | ||
panic("This store does not support iteration.") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
for k := range m { | ||
keys = append(keys, k) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
We don't need to use this for now since we didn't further push down locking. To reduce chance of issues, we will just revert this for now. Can be used in the future with dydxprotocol/v4-chain#1506 if needed.