mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-11-20 15:15:18 +00:00
fix: handle total distance comparison bug, reduce log noise
This commit is contained in:
parent
ea120d9c31
commit
128ffc020c
@ -451,8 +451,13 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if latestFrame != nil &&
|
||||
dataFrame.FrameNumber > latestFrame.FrameNumber {
|
||||
latestFrame = dataFrame
|
||||
}
|
||||
|
||||
go func() {
|
||||
e.frameChan <- dataFrame
|
||||
e.frameChan <- latestFrame
|
||||
}()
|
||||
|
||||
if bytes.Equal(
|
||||
@ -460,7 +465,7 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() {
|
||||
e.provingKeyAddress,
|
||||
) {
|
||||
var nextFrame *protobufs.ClockFrame
|
||||
if nextFrame, err = e.prove(dataFrame); err != nil {
|
||||
if nextFrame, err = e.prove(latestFrame); err != nil {
|
||||
e.logger.Error("could not prove", zap.Error(err))
|
||||
e.state = consensus.EngineStateCollecting
|
||||
continue
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"math/big"
|
||||
"time"
|
||||
|
||||
"source.quilibrium.com/quilibrium/monorepo/node/config"
|
||||
@ -167,10 +166,7 @@ func (e *CeremonyDataClockConsensusEngine) GetMostAheadPeer() (
|
||||
_, ok := e.uncooperativePeersMap[string(v.peerId)]
|
||||
if v.maxFrame > max &&
|
||||
v.timestamp > config.GetMinimumVersionCutoff().UnixMilli() &&
|
||||
bytes.Compare(v.version, config.GetMinimumVersion()) >= 0 &&
|
||||
new(big.Int).SetBytes(
|
||||
v.totalDistance,
|
||||
).Cmp(e.dataTimeReel.GetTotalDistance()) < 0 && !ok {
|
||||
bytes.Compare(v.version, config.GetMinimumVersion()) >= 0 && !ok {
|
||||
peer = v.peerId
|
||||
max = v.maxFrame
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ func (e *CeremonyExecutionEngine) ProcessMessage(
|
||||
message *protobufs.Message,
|
||||
) ([]*protobufs.Message, error) {
|
||||
if bytes.Equal(address, e.GetSupportedApplications()[0].Address) {
|
||||
e.logger.Info("processing execution message")
|
||||
e.logger.Debug("processing execution message")
|
||||
any := &anypb.Any{}
|
||||
if err := proto.Unmarshal(message.Payload, any); err != nil {
|
||||
return nil, errors.Wrap(err, "process message")
|
||||
|
Loading…
Reference in New Issue
Block a user