Skip to content

Commit

Permalink
Debug Rounds fetch (#1255)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Jayashsatolia403 and Hitenjain14 authored Sep 19, 2023
1 parent f1fc7d1 commit 496da42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions code/go/0chain.net/blobbercore/challenge/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 5 additions & 1 deletion code/go/0chain.net/blobbercore/challenge/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 496da42

Please sign in to comment.