Skip to content

Commit

Permalink
Merge v0.0.15 (#263)
Browse files Browse the repository at this point in the history
* first round fix

* logging

Co-authored-by: Alon Muroch <[email protected]>
  • Loading branch information
amirylm and alonmuroch authored Aug 17, 2021
1 parent 51ef672 commit 64b938f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ibft/change_round.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions ibft/event_loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion ibft/ibft_running_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ibft/sync/speedup/speedup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 64b938f

Please sign in to comment.