mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
QSP-9 Prevent Casting to Int if Possible (#6349)
* no cast to int * fix up significant casting issues * more casting * even more casting fixes * more casts * fix subnets * back to ints * final touches * broken test fix * add in blocks test fix * unskip * revert bytes fixes * casting fixes * Update beacon-chain/db/kv/state.go * Update beacon-chain/db/kv/blocks.go * fmt * slash: * fix val tests * fix up conf Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
This commit is contained in:
6
beacon-chain/cache/common.go
vendored
6
beacon-chain/cache/common.go
vendored
@@ -8,12 +8,12 @@ import (
|
||||
var (
|
||||
// maxCacheSize is 4x of the epoch length for additional cache padding.
|
||||
// Requests should be only accessing committees within defined epoch length.
|
||||
maxCacheSize = int(4 * params.BeaconConfig().SlotsPerEpoch)
|
||||
maxCacheSize = 4 * params.BeaconConfig().SlotsPerEpoch
|
||||
)
|
||||
|
||||
// trim the FIFO queue to the maxSize.
|
||||
func trim(queue *cache.FIFO, maxSize int) {
|
||||
for s := len(queue.ListKeys()); s > maxSize; s-- {
|
||||
func trim(queue *cache.FIFO, maxSize uint64) {
|
||||
for s := uint64(len(queue.ListKeys())); s > maxSize; s-- {
|
||||
_, err := queue.Pop(popProcessNoopFunc)
|
||||
if err != nil {
|
||||
// popProcessNoopFunc never returns an error, but we handle this anyway to make linter
|
||||
|
||||
Reference in New Issue
Block a user