Skip to content
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

Merged
merged 2 commits into from
Aug 7, 2024
Merged

Conversation

roy-dydx
Copy link

@roy-dydx roy-dydx commented Aug 7, 2024

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.

@roy-dydx roy-dydx merged commit eb1c624 into dydx-fork-v0.50.5 Aug 7, 2024
33 of 37 checks passed
@roy-dydx roy-dydx deleted the roy/revertlocking branch August 7, 2024 21:40
Comment on lines +85 to +98
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

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

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +216 to +229
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

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

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

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}

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

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

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

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

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

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}

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

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}

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

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
Comment on lines +247 to +249
for k := range m {
keys = append(keys, k)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants