diff --git a/node/execution/ceremony/application/ceremony_application.go b/node/execution/ceremony/application/ceremony_application.go index 78a824d..b1c7614 100644 --- a/node/execution/ceremony/application/ceremony_application.go +++ b/node/execution/ceremony/application/ceremony_application.go @@ -884,10 +884,10 @@ func (a *CeremonyApplication) ApplyTransition( maxRounds = maxRounds << 1 } - if a.RoundCount == maxRounds && + if a.RoundCount >= maxRounds && uint64(len(a.TranscriptRoundAdvanceCommits)) == a.RoundCount && len(a.ActiveParticipants) == - len(a.TranscriptRoundAdvanceCommits[a.RoundCount-1].Commits) { + len(a.TranscriptRoundAdvanceCommits[maxRounds-1].Commits) { a.LobbyState = CEREMONY_APPLICATION_STATE_FINALIZING a.FinalCommits = a.TranscriptRoundAdvanceCommits[a.RoundCount-1].Commits a.RoundCount = 0 diff --git a/node/execution/ceremony/application/ceremony_application_in_progress.go b/node/execution/ceremony/application/ceremony_application_in_progress.go index b61e5f3..df38dd5 100644 --- a/node/execution/ceremony/application/ceremony_application_in_progress.go +++ b/node/execution/ceremony/application/ceremony_application_in_progress.go @@ -220,15 +220,15 @@ func (a *CeremonyApplication) applyTranscriptCommit( } } + if maxRounds < a.RoundCount-1 { + return errors.Wrap( + errors.New("round limit exceeded"), + "apply transcript commit", + ) + } + if len(a.TranscriptRoundAdvanceCommits[a.RoundCount-1].Commits) == len(a.ActiveParticipants) { - if maxRounds == - uint64(len(a.TranscriptRoundAdvanceCommits)) { - return errors.Wrap( - errors.New("round limit exceeded"), - "apply transcript commit", - ) - } a.TranscriptRoundAdvanceCommits = append( a.TranscriptRoundAdvanceCommits, &protobufs.CeremonyAdvanceRound{ diff --git a/node/execution/ceremony/ceremony_execution_engine.go b/node/execution/ceremony/ceremony_execution_engine.go index fd8239b..71fc5a2 100644 --- a/node/execution/ceremony/ceremony_execution_engine.go +++ b/node/execution/ceremony/ceremony_execution_engine.go @@ -425,6 +425,7 @@ func (e *CeremonyExecutionEngine) RunWorker() { err := e.connectToActivePeers(app, position) if err != nil { e.logger.Error("error while connecting to peers", zap.Error(err)) + e.publishDroppedParticipant(e.proverPublicKey) continue } } @@ -703,6 +704,14 @@ func (e *CeremonyExecutionEngine) connectToActivePeers( e.pubSub, ) if err != nil { + e.logger.Error( + "could not establish p2p channel", + zap.Binary( + "proving_key", + p.PublicKeySignatureEd448.PublicKey.KeyValue, + ), + zap.Error(err), + ) return errors.Wrap(err, "connect to active peers") } }