-
Notifications
You must be signed in to change notification settings - Fork 4k
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
base: main
Are you sure you want to change the base?
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 Error
// 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 Error
|
||
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 Error
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 Warning
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 Warning
// 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 Warning
// 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 Warning
Description
Closes: #XXXX