-
Notifications
You must be signed in to change notification settings - Fork 1
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
Version store #9
base: version-store
Are you sure you want to change the base?
Conversation
return nil, err | ||
} | ||
pairs = append(pairs, *pair) | ||
offset += int(size) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
size, n := proto.DecodeVarint(data[offset:]) | ||
offset += n | ||
pair := new(types.StoreKVPair) | ||
if err := proto.Unmarshal(data[offset:offset+int(size)], pair); err != nil { |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
for k, _ := range finishedBlockNums { | ||
if k <= blockNum { | ||
delete(finishedBlockNums, k) | ||
} | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m
936cc90
to
7d1201a
Compare
for _, storeKey := range keys { | ||
exposeStoreKeys = append(exposeStoreKeys, storeKey) | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m
var bytes [8]byte | ||
if _, err = io.ReadFull(f, bytes[:]); err == nil { | ||
size := binary.BigEndian.Uint64(bytes[:]) | ||
if info, err := f.Stat(); err == nil && size+uint64(8) == uint64(info.Size()) { |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
}, | ||
func(blockNum int) bool { | ||
path := GetLocalDataFileName(directory, blockNum) | ||
f, err := os.Open(path) |
Check failure
Code scanning / gosec
Potential file inclusion via variable
f, err := os.Open(path) | ||
if err == nil { | ||
defer func() { | ||
_ = f.Close() |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
instead of sync directly to db
subscribe latest blk via tm, sync historical via http
allow retry if incomplete
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)