From 496da427b892a54c8a035f201ce468c5cf6c35e2 Mon Sep 17 00:00:00 2001 From: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Date: Wed, 20 Sep 2023 01:49:27 +0530 Subject: [PATCH] Debug Rounds fetch (#1255) * Fix * Updated gosdk * Fix * Fix * Fix * Logging * Debug * Fix * Fix * Debug * Debug * Debug * Fix unit tests * Logigng * Updated gosdk * Updated gosdk * Updated gosdk * Updated gosdk * Updated gosdk * Updated gosdk * Updated gosdk * Updated gosdk * Fix * Fix * Updated gosdk * Fix * Fix * log config too * Fix phase locking (#1230) * add logs for 2 phase lock * add update log * add root in log * add update log * use update lock * add log in update repo * use save * use exec * log rows affected * use no key update * use repo update * cleanup * add defer * add defer * Fix * Added logging * Debug * Debug * Added reference to logs * Fix * Fix * Updated gosdk * Use slice instead of ll * Validator last 5 transactions * Fix * Fix * Updated gosdk * Resolved comments * Updated gosdk * Fix * Increase time limit * Increase time limit * Fix * Fix * Fix * Fix * Debug * Debug * Debug * Fix * Fix * Fix * Cleanup logging * Fix * Debug * Fix --------- Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com> --- code/go/0chain.net/blobbercore/challenge/challenge.go | 3 +++ code/go/0chain.net/blobbercore/challenge/worker.go | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/go/0chain.net/blobbercore/challenge/challenge.go b/code/go/0chain.net/blobbercore/challenge/challenge.go index 1de27e9aa..a8abbf2f1 100644 --- a/code/go/0chain.net/blobbercore/challenge/challenge.go +++ b/code/go/0chain.net/blobbercore/challenge/challenge.go @@ -195,6 +195,9 @@ func (c *ChallengeEntity) getCommitTransaction() (*transaction.Transaction, erro currentRound := roundInfo.CurrentRound + int64(float64(roundInfo.LastRoundDiff)*(float64(time.Since(roundInfo.CurrentRoundCaptureTime).Milliseconds())/float64(GetRoundInterval.Milliseconds()))) logging.Logger.Info("[challenge]commit", + zap.Any("ChallengeID", c.ChallengeID), + zap.Any("RoundCreatedAt", c.RoundCreatedAt), + zap.Any("ChallengeCompletionTime", config.StorageSCConfig.ChallengeCompletionTime), zap.Any("currentRound", currentRound), zap.Any("roundInfo.LastRoundDiff", roundInfo.LastRoundDiff), zap.Any("roundInfo.CurrentRound", roundInfo.CurrentRound), diff --git a/code/go/0chain.net/blobbercore/challenge/worker.go b/code/go/0chain.net/blobbercore/challenge/worker.go index 4f1e4026d..50801ed35 100644 --- a/code/go/0chain.net/blobbercore/challenge/worker.go +++ b/code/go/0chain.net/blobbercore/challenge/worker.go @@ -89,7 +89,11 @@ func getRoundWorker(ctx context.Context) { network := zcncore.GetNetwork() currentRound, _ := sdk.GetRoundFromSharders(network.Sharders) - roundInfo.LastRoundDiff = currentRound - roundInfo.CurrentRound + if roundInfo.LastRoundDiff == 0 { + roundInfo.LastRoundDiff = 1000 + } else { + roundInfo.LastRoundDiff = currentRound - roundInfo.CurrentRound + } roundInfo.CurrentRound = currentRound roundInfo.CurrentRoundCaptureTime = time.Now() }