Skip to content

Commit

Permalink
add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne committed Jan 29, 2025
1 parent a66280c commit 593be85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x/proof/keeper/validate_proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package keeper
import (
"context"
"fmt"
"runtime"
"sync"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -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'
Expand All @@ -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.
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 593be85

Please sign in to comment.