@@ -239,9 +239,41 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block)
239
239
if errors .Is (err , utils .ErrResourceBusy ) {
240
240
return nil , httpHeader , rpccore .ErrInternal .CloneWithData (rpccore .ThrottledVMErr )
241
241
}
242
+
243
+ res := make ([]struct {
244
+ Traces []vm.TransactionTrace `json:"traces"`
245
+ Error string `json:"error"`
246
+ }, len (block .Transactions )- 1 )
247
+ for i := range len (block .Transactions ) - 1 {
248
+ executionResult , err := h .vm .Execute (block .Transactions , classes , paidFeesOnL1 ,
249
+ & blockInfo , state , network , false , false , false , true )
250
+ res [i ] = struct {
251
+ Traces []vm.TransactionTrace `json:"traces"`
252
+ Error string `json:"error"`
253
+ }{
254
+ Traces : executionResult .Traces ,
255
+ Error : err .Error (),
256
+ }
257
+ }
258
+
242
259
// Since we are tracing an existing block, we know that there should be no errors during execution. If we encounter any,
243
260
// report them as unexpected errors
244
- return nil , httpHeader , rpccore .ErrUnexpectedError .CloneWithData (err .Error ())
261
+ return nil , httpHeader , rpccore .ErrUnexpectedError .CloneWithData (struct {
262
+ Error string `json:"error"`
263
+ StateBlock uint64 `json:"state_block"`
264
+ ParentBlock string `json:"parent_block"`
265
+ Number uint64 `json:"number"`
266
+ Res []struct {
267
+ Traces []vm.TransactionTrace `json:"traces"`
268
+ Error string `json:"error"`
269
+ } `json:"res"`
270
+ }{
271
+ Error : err .Error (),
272
+ StateBlock : core .GetBlockNumber (state ),
273
+ ParentBlock : block .ParentHash .String (),
274
+ Number : block .Number ,
275
+ Res : res ,
276
+ })
245
277
}
246
278
247
279
result := make ([]TracedBlockTransaction , len (executionResult .Traces ))
0 commit comments