mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
fix(coordinator): concurrent map write (#360)
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
This commit is contained in:
@@ -368,7 +368,7 @@ func (m *Manager) CollectProofs(sess *session) {
|
||||
finished, validRollers := sess.isRollersFinished()
|
||||
|
||||
//When all rollers have finished submitting their tasks, select a winner within rollers with valid proof, and return, terminate the for loop.
|
||||
if finished {
|
||||
if finished && len(validRollers) > 0 {
|
||||
//Select a random index for this slice.
|
||||
randIndex := mathrand.Intn(len(validRollers))
|
||||
_ = validRollers[randIndex]
|
||||
@@ -543,6 +543,8 @@ func (m *Manager) IsRollerIdle(hexPk string) bool {
|
||||
}
|
||||
|
||||
func (m *Manager) addFailedSession(sess *session, errMsg string) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
m.failedSessionInfos[sess.info.ID] = newSessionInfo(sess, types.ProvingTaskFailed, errMsg, true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user