From 6916ff6e4cb7543eae2437d53eb5e1393f4810dc Mon Sep 17 00:00:00 2001 From: Shota Date: Tue, 29 Oct 2024 00:21:04 +0400 Subject: [PATCH] fix data race (#12517) Co-authored-by: shota.silagadze --- cl/beacon/handler/duties_proposer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cl/beacon/handler/duties_proposer.go b/cl/beacon/handler/duties_proposer.go index 9f07370102e..43a6a300130 100644 --- a/cl/beacon/handler/duties_proposer.go +++ b/cl/beacon/handler/duties_proposer.go @@ -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 @@ -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) }