From 64b938fc15b5d3d3573d9180bf17ffdde114092d Mon Sep 17 00:00:00 2001 From: amir-blox <83904651+amir-blox@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:21:18 +0300 Subject: [PATCH] Merge v0.0.15 (#263) * first round fix * logging Co-authored-by: Alon Muroch --- ibft/change_round.go | 4 ++-- ibft/event_loop.go | 7 ++++--- ibft/ibft_running_instance.go | 2 +- ibft/sync/speedup/speedup.go | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ibft/change_round.go b/ibft/change_round.go index 2f4b01b028..1986a3d2ce 100644 --- a/ibft/change_round.go +++ b/ibft/change_round.go @@ -86,10 +86,10 @@ func (i *Instance) uponChangeRoundFullQuorum() pipeline.Pipeline { var value []byte if highest != nil { value = highest.PreparedValue - logger.Debug("broadcasting pre-prepare as leader after round change with justified prepare value") + logger.Info("broadcasting pre-prepare as leader after round change with justified prepare value") } else { value = i.State.InputValue.Get() - logger.Debug("broadcasting pre-prepare as leader after round change with input value") + logger.Info("broadcasting pre-prepare as leader after round change with input value") } // send pre-prepare msg diff --git a/ibft/event_loop.go b/ibft/event_loop.go index dcd0f34413..b9131865d4 100644 --- a/ibft/event_loop.go +++ b/ibft/event_loop.go @@ -54,16 +54,17 @@ loop: var wg sync.WaitGroup if queueCnt := i.MsgQueue.MsgCount(msgqueue.IBFTMessageIndexKey(i.State.Lambda.Get(), i.State.SeqNumber.Get(), i.State.Round.Get())); queueCnt > 0 { - i.Logger.Debug("adding ibft message to event queue - waiting for done", zap.Int("queue msg count", queueCnt)) + logger := i.Logger.With(zap.Uint64("round", i.State.Round.Get())) + logger.Debug("adding ibft message to event queue - waiting for done", zap.Int("queue msg count", queueCnt)) wg.Add(1) if added := i.eventQueue.Add(func() { _, err := i.ProcessMessage() if err != nil { - i.Logger.Error("msg pipeline error", zap.Error(err)) + logger.Error("msg pipeline error", zap.Error(err)) } wg.Done() }); !added { - i.Logger.Debug("could not add ibft message to event queue") + logger.Debug("could not add ibft message to event queue") time.Sleep(time.Millisecond * 100) wg.Done() } diff --git a/ibft/ibft_running_instance.go b/ibft/ibft_running_instance.go index 34f8a2ed8e..9069cf970c 100644 --- a/ibft/ibft_running_instance.go +++ b/ibft/ibft_running_instance.go @@ -21,7 +21,7 @@ func (i *ibftImpl) startInstanceWithOptions(instanceOpts *InstanceOptions, value } // catch up if we can - i.fastChangeRoundCatchup(i.currentInstance) + go i.fastChangeRoundCatchup(i.currentInstance) // main instance callback loop var retRes *InstanceResult diff --git a/ibft/sync/speedup/speedup.go b/ibft/sync/speedup/speedup.go index 2f755e40f8..8415d4aa26 100644 --- a/ibft/sync/speedup/speedup.go +++ b/ibft/sync/speedup/speedup.go @@ -59,7 +59,7 @@ func (s *Speedup) Start() ([]*proto.SignedMessage, error) { if err != nil { s.logger.Error("error fetching latest change round", zap.Error(err)) } else if err := s.lastMsgError(msg); err != nil { - s.logger.Error("error fetching latest change round", zap.Error(err)) + s.logger.Debug("could not fetch latest change round", zap.Error(err)) } else { signedMsg := msg.SignedMessages[0] if err := s.msgValidationPipeline.Run(signedMsg); err != nil {