-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: objstore #25340
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
feat: objstore #25340
Conversation
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
fix and add test
// TODO overflow-safe math? | ||
gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostPerByte*types.Gas(len(key)), types.GasReadPerByteDesc) | ||
gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostPerByte*types.Gas(len(value)), types.GasReadPerByteDesc) | ||
gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostPerByte*types.Gas(gs.valueLen(value)), types.GasReadPerByteDesc) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32
// TODO overflow-safe math? | ||
gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(len(key)), types.GasWritePerByteDesc) | ||
gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(len(value)), types.GasWritePerByteDesc) | ||
gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(gs.valueLen(value)), types.GasWritePerByteDesc) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32
|
||
gi.gasMeter.ConsumeGas(gi.gasConfig.ReadCostPerByte*types.Gas(len(key)), types.GasValuePerByteDesc) | ||
gi.gasMeter.ConsumeGas(gi.gasConfig.ReadCostPerByte*types.Gas(len(value)), types.GasValuePerByteDesc) | ||
gi.gasMeter.ConsumeGas(gi.gasConfig.ReadCostPerByte*types.Gas(gi.valueLen(value)), types.GasValuePerByteDesc) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32
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
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
// 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
// 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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25340 +/- ##
===========================================
+ Coverage 52.88% 67.55% +14.67%
===========================================
Files 797 852 +55
Lines 64903 68603 +3700
===========================================
+ Hits 34322 46344 +12022
+ Misses 30581 22259 -8322
🚀 New features to boost your workflow:
|
Description
Closes: #XXXX