mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-25 08:05:17 +00:00
alter permissiveness of latent tests and aggressiveness in validation to validate/negate hypothesis
This commit is contained in:
parent
58456c1057
commit
838815882e
@ -176,12 +176,6 @@ func (e *MasterClockConsensusEngine) handleSelfTestReport(
|
|||||||
timestamp := binary.BigEndian.Uint64(proof[:8])
|
timestamp := binary.BigEndian.Uint64(proof[:8])
|
||||||
proof = proof[8:]
|
proof = proof[8:]
|
||||||
|
|
||||||
// Ignore outdated reports, give 3 minutes + proof time for propagation
|
|
||||||
// delay
|
|
||||||
if int64(timestamp) < (time.Now().UnixMilli() - (480 * 1000)) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
challenge := binary.BigEndian.AppendUint64([]byte{}, report.MasterHeadFrame)
|
challenge := binary.BigEndian.AppendUint64([]byte{}, report.MasterHeadFrame)
|
||||||
challenge = append(challenge, peerID...)
|
challenge = append(challenge, peerID...)
|
||||||
|
|
||||||
|
@ -491,25 +491,27 @@ type verifyChallenge struct {
|
|||||||
func (e *MasterClockConsensusEngine) performVerifyTest(
|
func (e *MasterClockConsensusEngine) performVerifyTest(
|
||||||
challenge verifyChallenge,
|
challenge verifyChallenge,
|
||||||
) {
|
) {
|
||||||
if !e.frameProver.VerifyChallengeProof(
|
go func() {
|
||||||
challenge.challenge,
|
if !e.frameProver.VerifyChallengeProof(
|
||||||
challenge.timestamp,
|
challenge.challenge,
|
||||||
challenge.difficultyMetric,
|
challenge.timestamp,
|
||||||
challenge.proofs,
|
challenge.difficultyMetric,
|
||||||
) {
|
challenge.proofs,
|
||||||
e.logger.Warn(
|
) {
|
||||||
"received invalid proof from peer",
|
e.logger.Warn(
|
||||||
zap.String("peer_id", peer.ID(challenge.peerID).String()),
|
"received invalid proof from peer",
|
||||||
)
|
zap.String("peer_id", peer.ID(challenge.peerID).String()),
|
||||||
e.pubSub.SetPeerScore(challenge.peerID, -1000)
|
)
|
||||||
} else {
|
e.pubSub.SetPeerScore(challenge.peerID, -1000)
|
||||||
e.logger.Debug(
|
} else {
|
||||||
"received valid proof from peer",
|
e.logger.Debug(
|
||||||
zap.String("peer_id", peer.ID(challenge.peerID).String()),
|
"received valid proof from peer",
|
||||||
)
|
zap.String("peer_id", peer.ID(challenge.peerID).String()),
|
||||||
info := e.peerInfoManager.GetPeerInfo(challenge.peerID)
|
)
|
||||||
info.LastSeen = time.Now().UnixMilli()
|
info := e.peerInfoManager.GetPeerInfo(challenge.peerID)
|
||||||
}
|
info.LastSeen = time.Now().UnixMilli()
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *MasterClockConsensusEngine) performBandwidthTest(peerID []byte) {
|
func (e *MasterClockConsensusEngine) performBandwidthTest(peerID []byte) {
|
||||||
|
Loading…
Reference in New Issue
Block a user