mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
Use Eth2 type CommitteeIndex (#8477)
* Use types.CommitteeIndex * Go fmt * Update validator pkg * Fix e2e * Happy fuzz tests * Sync with upstream ethereumapi * Go mod tidy Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
4
beacon-chain/cache/committee.go
vendored
4
beacon-chain/cache/committee.go
vendored
@@ -56,7 +56,7 @@ func NewCommitteesCache() *CommitteeCache {
|
||||
|
||||
// Committee fetches the shuffled indices by slot and committee index. Every list of indices
|
||||
// represent one committee. Returns true if the list exists with slot and committee index. Otherwise returns false, nil.
|
||||
func (c *CommitteeCache) Committee(slot types.Slot, seed [32]byte, index uint64) ([]uint64, error) {
|
||||
func (c *CommitteeCache) Committee(slot types.Slot, seed [32]byte, index types.CommitteeIndex) ([]uint64, error) {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
|
||||
@@ -82,7 +82,7 @@ func (c *CommitteeCache) Committee(slot types.Slot, seed [32]byte, index uint64)
|
||||
committeeCountPerSlot = item.CommitteeCount / uint64(params.BeaconConfig().SlotsPerEpoch)
|
||||
}
|
||||
|
||||
indexOffSet := index + uint64(slot.ModSlot(params.BeaconConfig().SlotsPerEpoch).Mul(committeeCountPerSlot))
|
||||
indexOffSet := uint64(index) + uint64(slot.ModSlot(params.BeaconConfig().SlotsPerEpoch).Mul(committeeCountPerSlot))
|
||||
start, end := startEndIndices(item, indexOffSet)
|
||||
|
||||
if end > uint64(len(item.ShuffledIndices)) || end < start {
|
||||
|
||||
Reference in New Issue
Block a user