@@ -163,27 +163,28 @@ func (e *Engine) process(originID flow.Identifier, event interface{}) error {
163
163
func (e * Engine ) verify (ctx context.Context , originID flow.Identifier ,
164
164
vc * verification.VerifiableChunkData ) error {
165
165
// log it first
166
- log := e .log .With ().Timestamp ().
167
- Hex ("origin" , logging .ID (originID )).
166
+ log := e .log .With ().
168
167
Uint64 ("chunk_index" , vc .Chunk .Index ).
169
168
Hex ("result_id" , logging .Entity (vc .Result )).
169
+ Uint64 ("block_height" , vc .Header .Height ).
170
+ Hex ("block_id" , vc .Chunk .ChunkBody .BlockID [:]).
170
171
Logger ()
171
172
172
173
log .Info ().Msg ("verifiable chunk received by verifier engine" )
173
174
174
175
// only accept internal calls
175
176
if originID != e .me .NodeID () {
176
- return fmt .Errorf ("invalid remote origin for verify" )
177
+ return fmt .Errorf ("invalid remote origin for verify: %v" , originID )
177
178
}
178
179
179
- var err error
180
-
181
180
// extracts chunk ID
182
181
ch , ok := vc .Result .Chunks .ByIndex (vc .Chunk .Index )
183
182
if ! ok {
184
183
return engine .NewInvalidInputErrorf ("chunk out of range requested: %v" , vc .Chunk .Index )
185
184
}
186
- log .With ().Hex ("chunk_id" , logging .Entity (ch )).Logger ()
185
+ log = log .With ().
186
+ Hex ("chunk_id" , logging .Entity (ch )).
187
+ Logger ()
187
188
188
189
// execute the assigned chunk
189
190
span , _ := e .tracer .StartSpanFromContext (ctx , trace .VERVerChunkVerify )
@@ -200,58 +201,58 @@ func (e *Engine) verify(ctx context.Context, originID flow.Identifier,
200
201
// if any fault found with the chunk
201
202
switch chFault := err .(type ) {
202
203
case * chmodels.CFMissingRegisterTouch :
203
- e . log .Warn ().
204
+ log .Warn ().
204
205
Str ("chunk_fault_type" , "missing_register_touch" ).
205
206
Str ("chunk_fault" , chFault .Error ()).
206
207
Msg ("chunk fault found, could not verify chunk" )
207
208
// still create approvals for this case
208
209
case * chmodels.CFNonMatchingFinalState :
209
210
// TODO raise challenge
210
- e . log .Warn ().
211
+ log .Warn ().
211
212
Str ("chunk_fault_type" , "final_state_mismatch" ).
212
213
Str ("chunk_fault" , chFault .Error ()).
213
214
Msg ("chunk fault found, could not verify chunk" )
214
215
return nil
215
216
case * chmodels.CFInvalidVerifiableChunk :
216
217
// TODO raise challenge
217
- e . log .Error ().
218
+ log .Error ().
218
219
Str ("chunk_fault_type" , "invalid_verifiable_chunk" ).
219
220
Str ("chunk_fault" , chFault .Error ()).
220
221
Msg ("chunk fault found, could not verify chunk" )
221
222
return nil
222
223
case * chmodels.CFInvalidEventsCollection :
223
224
// TODO raise challenge
224
- e . log .Error ().
225
+ log .Error ().
225
226
Str ("chunk_fault_type" , "invalid_event_collection" ).
226
227
Str ("chunk_fault" , chFault .Error ()).
227
228
Msg ("chunk fault found, could not verify chunk" )
228
229
return nil
229
230
case * chmodels.CFSystemChunkIncludedCollection :
230
- e . log .Error ().
231
+ log .Error ().
231
232
Str ("chunk_fault_type" , "system_chunk_includes_collection" ).
232
233
Str ("chunk_fault" , chFault .Error ()).
233
234
Msg ("chunk fault found, could not verify chunk" )
234
235
return nil
235
236
case * chmodels.CFExecutionDataBlockIDMismatch :
236
- e . log .Error ().
237
+ log .Error ().
237
238
Str ("chunk_fault_type" , "execution_data_block_id_mismatch" ).
238
239
Str ("chunk_fault" , chFault .Error ()).
239
240
Msg ("chunk fault found, could not verify chunk" )
240
241
return nil
241
242
case * chmodels.CFExecutionDataChunksLengthMismatch :
242
- e . log .Error ().
243
+ log .Error ().
243
244
Str ("chunk_fault_type" , "execution_data_chunks_count_mismatch" ).
244
245
Str ("chunk_fault" , chFault .Error ()).
245
246
Msg ("chunk fault found, could not verify chunk" )
246
247
return nil
247
248
case * chmodels.CFExecutionDataInvalidChunkCID :
248
- e . log .Error ().
249
+ log .Error ().
249
250
Str ("chunk_fault_type" , "execution_data_chunk_cid_mismatch" ).
250
251
Str ("chunk_fault" , chFault .Error ()).
251
252
Msg ("chunk fault found, could not verify chunk" )
252
253
return nil
253
254
case * chmodels.CFInvalidExecutionDataID :
254
- e . log .Error ().
255
+ log .Error ().
255
256
Str ("chunk_fault_type" , "execution_data_root_cid_mismatch" ).
256
257
Str ("chunk_fault" , chFault .Error ()).
257
258
Msg ("chunk fault found, could not verify chunk" )
0 commit comments