Skip to content

Commit

Permalink
fix data race (#12517)
Browse files Browse the repository at this point in the history
Co-authored-by: shota.silagadze <[email protected]>
  • Loading branch information
shotasilagadze and shotasilagadzetaal authored Oct 28, 2024
1 parent 26c3173 commit 6916ff6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cl/beacon/handler/duties_proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func (a *ApiHandler) getDutiesProposer(w http.ResponseWriter, r *http.Request) (
wg := sync.WaitGroup{}

for slot := expectedSlot; slot < expectedSlot+a.beaconChainCfg.SlotsPerEpoch; slot++ {
var proposerIndex uint64
// Lets do proposer index computation
mixPosition := (epoch + a.beaconChainCfg.EpochsPerHistoricalVector - a.beaconChainCfg.MinSeedLookahead - 1) %
a.beaconChainCfg.EpochsPerHistoricalVector
Expand Down Expand Up @@ -124,7 +123,7 @@ func (a *ApiHandler) getDutiesProposer(w http.ResponseWriter, r *http.Request) (
// Do it in parallel
go func(i, slot uint64, indicies []uint64, seedArray [32]byte) {
defer wg.Done()
proposerIndex, err = shuffling2.ComputeProposerIndex(state.BeaconState, indices, seedArray)
proposerIndex, err := shuffling2.ComputeProposerIndex(state.BeaconState, indices, seedArray)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 6916ff6

Please sign in to comment.