diff --git a/engine/verification/verifier/engine.go b/engine/verification/verifier/engine.go index b2cd1a140fb..421c9651650 100644 --- a/engine/verification/verifier/engine.go +++ b/engine/verification/verifier/engine.go @@ -163,27 +163,28 @@ func (e *Engine) process(originID flow.Identifier, event interface{}) error { func (e *Engine) verify(ctx context.Context, originID flow.Identifier, vc *verification.VerifiableChunkData) error { // log it first - log := e.log.With().Timestamp(). - Hex("origin", logging.ID(originID)). + log := e.log.With(). Uint64("chunk_index", vc.Chunk.Index). Hex("result_id", logging.Entity(vc.Result)). + Uint64("block_height", vc.Header.Height). + Hex("block_id", vc.Chunk.ChunkBody.BlockID[:]). Logger() log.Info().Msg("verifiable chunk received by verifier engine") // only accept internal calls if originID != e.me.NodeID() { - return fmt.Errorf("invalid remote origin for verify") + return fmt.Errorf("invalid remote origin for verify: %v", originID) } - var err error - // extracts chunk ID ch, ok := vc.Result.Chunks.ByIndex(vc.Chunk.Index) if !ok { return engine.NewInvalidInputErrorf("chunk out of range requested: %v", vc.Chunk.Index) } - log.With().Hex("chunk_id", logging.Entity(ch)).Logger() + log = log.With(). + Hex("chunk_id", logging.Entity(ch)). + Logger() // execute the assigned chunk span, _ := e.tracer.StartSpanFromContext(ctx, trace.VERVerChunkVerify) @@ -200,58 +201,58 @@ func (e *Engine) verify(ctx context.Context, originID flow.Identifier, // if any fault found with the chunk switch chFault := err.(type) { case *chmodels.CFMissingRegisterTouch: - e.log.Warn(). + log.Warn(). Str("chunk_fault_type", "missing_register_touch"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") // still create approvals for this case case *chmodels.CFNonMatchingFinalState: // TODO raise challenge - e.log.Warn(). + log.Warn(). Str("chunk_fault_type", "final_state_mismatch"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFInvalidVerifiableChunk: // TODO raise challenge - e.log.Error(). + log.Error(). Str("chunk_fault_type", "invalid_verifiable_chunk"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFInvalidEventsCollection: // TODO raise challenge - e.log.Error(). + log.Error(). Str("chunk_fault_type", "invalid_event_collection"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFSystemChunkIncludedCollection: - e.log.Error(). + log.Error(). Str("chunk_fault_type", "system_chunk_includes_collection"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFExecutionDataBlockIDMismatch: - e.log.Error(). + log.Error(). Str("chunk_fault_type", "execution_data_block_id_mismatch"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFExecutionDataChunksLengthMismatch: - e.log.Error(). + log.Error(). Str("chunk_fault_type", "execution_data_chunks_count_mismatch"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFExecutionDataInvalidChunkCID: - e.log.Error(). + log.Error(). Str("chunk_fault_type", "execution_data_chunk_cid_mismatch"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk") return nil case *chmodels.CFInvalidExecutionDataID: - e.log.Error(). + log.Error(). Str("chunk_fault_type", "execution_data_root_cid_mismatch"). Str("chunk_fault", chFault.Error()). Msg("chunk fault found, could not verify chunk")