From 593be852b2b6a0b4788859a57a9667c0e2089c46 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Wed, 29 Jan 2025 23:14:33 +0100 Subject: [PATCH] add debug logs --- x/proof/keeper/validate_proofs.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x/proof/keeper/validate_proofs.go b/x/proof/keeper/validate_proofs.go index 0e085aafe..3d231d411 100644 --- a/x/proof/keeper/validate_proofs.go +++ b/x/proof/keeper/validate_proofs.go @@ -3,7 +3,6 @@ package keeper import ( "context" "fmt" - "runtime" "sync" sdk "github.com/cosmos/cosmos-sdk/types" @@ -37,7 +36,7 @@ var numCPU int func init() { // Initialize the number of CPU cores available on the machine. - numCPU = runtime.NumCPU() + numCPU = 1 //runtime.NumCPU() } // ValidateSubmittedProofs performs concurrent proof validation, updating claims' @@ -61,8 +60,11 @@ func (k Keeper) ValidateSubmittedProofs(ctx sdk.Context) (numValidProofs, numInv coordinatorMu: &sync.Mutex{}, } + numIteratedProofs := 0 for ; proofIterator.Valid(); proofIterator.Next() { proofBz := proofIterator.Value() + numInvalidProofs++ + logger.Info(fmt.Sprintf("~~~~~validating proof %d", numIteratedProofs)) // Acquire a semaphore to limit the number of goroutines. // This will block if the sem channel is full. @@ -109,6 +111,8 @@ func (k Keeper) validateProof( logger := k.Logger().With("method", "validateProof") + logger.Info("~~~~~start validating proof") + // Decrement the wait group when the goroutine finishes. defer coordinator.wg.Done()