mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-27 00:55:17 +00:00
resolve state transition error log noise
This commit is contained in:
parent
926e6bba22
commit
1a009e3769
@ -90,8 +90,8 @@ func (e *CeremonyDataClockConsensusEngine) handleMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := eg.Wait(); err != nil {
|
if err := eg.Wait(); err != nil {
|
||||||
e.logger.Error("rejecting invalid message", zap.Error(err))
|
e.logger.Debug("rejecting invalid message", zap.Error(err))
|
||||||
return errors.Wrap(err, "execution failed")
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
any := &anypb.Any{}
|
any := &anypb.Any{}
|
||||||
|
@ -710,6 +710,18 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber < join.FrameNumber {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("too recent join"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber-join.FrameNumber > 10 {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("outdated join"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if err = a.applyLobbyJoin(join); err != nil {
|
if err = a.applyLobbyJoin(join); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
@ -747,6 +759,18 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber < seenProverAtt.LastSeenFrame {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("too recent attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber-seenProverAtt.LastSeenFrame > 10 {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("outdated attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
@ -757,6 +781,18 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber < droppedProverAtt.LastSeenFrame {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("too recent attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber-droppedProverAtt.LastSeenFrame > 10 {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("outdated attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
@ -849,6 +885,18 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber < seenProverAtt.LastSeenFrame {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("too recent attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber-seenProverAtt.LastSeenFrame > 10 {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("outdated attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
@ -859,6 +907,18 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber < droppedProverAtt.LastSeenFrame {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("too recent attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber-droppedProverAtt.LastSeenFrame > 10 {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
errors.New("outdated attestation"), "apply transition",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user