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