Skip to content

Commit

Permalink
fix(native): switch to using log.debug for the majority of traces
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk-3 committed Dec 18, 2024
1 parent e262bbd commit fe5f443
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions fhevm-engine/fhevm-go-native/fhevm/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@ func (dbApi *EvmStorageComputationStore) InsertComputationBatch(evmStorage Chain
// We create buckets, how many blocks in the future user wants
// his ciphertexts to be evaluated

// Get the current process ID
log := logger("evm_store")
log.Info("Processing computations", "count", len(computations))

buckets := make(map[int64][]*ComputationToInsert)
// index the buckets
Expand All @@ -665,7 +665,7 @@ func (dbApi *EvmStorageComputationStore) InsertComputationBatch(evmStorage Chain
}

if len(buckets) != 0 {
log.Info("New buckets added", "buckets", len(buckets))
log.Debug("New buckets added", "buckets", len(buckets))
}

// collect all their keys and sort because golang doesn't traverse map
Expand Down Expand Up @@ -743,7 +743,7 @@ func (dbApi *EvmStorageComputationStore) InsertComputationBatch(evmStorage Chain
ctsStorage.queue = append(ctsStorage.queue, comp)
ctsStorage.enqueuedCiphertext[string(comp.OutputHandle)] = true

log.Info("Add bucket to Cache",
log.Debug("Add computation to Cache",
"commit block", queueBlockNumber,
"handle", comp.Handle(),
"cache length", len(ctsStorage.queue))
Expand Down Expand Up @@ -871,7 +871,7 @@ func (executorApi *ApiImpl) flushFheResultsToState(blockNumber int64, api ChainS
metadata := bytesToMetadata(api.GetState(executorApi.contractStorageAddress, ctAddr.metadata))
outputHandle := api.GetState(executorApi.contractStorageAddress, ctAddr.outputHandle)

log.Info("Reset computation LateCommit queue", "block number", blockNumber,
log.Debug("Reset computation LateCommit queue", "block number", blockNumber,
"handle", outputHandle.TerminalString())

handlesToMaterialize = append(handlesToMaterialize, outputHandle)
Expand Down Expand Up @@ -1038,7 +1038,7 @@ func executorWorkerThread(impl *ApiImpl) {

err := executorProcessPendingComputations(impl)
if err != nil {
log.Error("Failed to execute", "executor_err", fmt.Sprintf("%v", err))
log.Error("Failed to compute", "error", err.Error())
}
}
}
Expand All @@ -1057,7 +1057,7 @@ func executorProcessPendingComputations(impl *ApiImpl) error {
defer func() {
if availableCts > 0 {
duration := time.Since(startTime).Milliseconds()
fmt.Printf("executor computations completed in %dms\n", duration)
log.Debug("Computations completed", "duration", duration)
}
}()

Expand Down Expand Up @@ -1087,7 +1087,7 @@ func executorProcessPendingComputations(impl *ApiImpl) error {

ctToBlockIndex := make(map[string]int64)
for block, compute := range impl.cache.ciphertextsToCompute {
log.Info("Processing block",
log.Debug("Processing block",
"commit block", block, "computations", len(compute.queue))

for _, ct := range compute.queue {
Expand Down Expand Up @@ -1122,19 +1122,19 @@ func executorProcessPendingComputations(impl *ApiImpl) error {
}

request.Computations = append(request.Computations, comp)
log.Info("Add operation", "op", comp.Operation, "handle", ct.Handle())
log.Debug("Add operation", "op", comp.Operation, "handle", ct.Handle())

ctToBlockIndex[string(ct.OutputHandle)] = block
}
}

log.Info("Sending request",
log.Info("Sending grpc request",
"computations", len(request.Computations),
"compressed ciphertexts", len(request.CompressedCiphertexts))

if len(request.Computations) != 0 {
for _, compCt := range request.CompressedCiphertexts {
log.Info("Request with compressed ciphertext", "handle", common.BytesToHash(compCt.Handle).TerminalString(),
log.Debug("Request with compressed ciphertext", "handle", common.BytesToHash(compCt.Handle).TerminalString(),
"compCt len", len(compCt.Serialization))
}
}
Expand Down Expand Up @@ -1169,7 +1169,7 @@ func executorProcessPendingComputations(impl *ApiImpl) error {

blockData.materializedCiphertexts[string(ct.Handle)] = ct.Serialization

log.Info("Result block data", "block", common.BytesToHash(ct.Handle).TerminalString())
log.Debug("Response ciphertext", "handle", common.BytesToHash(ct.Handle).TerminalString(), "len", len(ct.Serialization))
}

// reset map of the queue
Expand Down

0 comments on commit fe5f443

Please sign in to comment.