@@ -216,13 +216,17 @@ fn fvm_machine_execute_message(
216
216
method,
217
217
params,
218
218
value,
219
+ gas_limit,
220
+ read_only,
219
221
} ) => {
220
222
break build_lotus_trace (
221
223
from,
222
224
to,
223
225
method,
224
226
params,
225
227
value,
228
+ gas_limit,
229
+ read_only,
226
230
& mut initial_gas_charges. into_iter ( ) . chain ( & mut trace_iter) ,
227
231
)
228
232
. ok ( )
@@ -378,6 +382,9 @@ pub struct TraceMessage {
378
382
#[ serde( with = "strict_bytes" ) ]
379
383
pub params : Vec < u8 > ,
380
384
pub codec : u64 ,
385
+ pub gas_limit : u64 ,
386
+ pub read_only : bool ,
387
+ pub code_cid : Cid ,
381
388
}
382
389
383
390
#[ derive( Serialize_tuple , Deserialize_tuple , Debug , PartialEq , Eq , Clone ) ]
@@ -388,12 +395,15 @@ pub struct TraceReturn {
388
395
pub codec : u64 ,
389
396
}
390
397
398
+ #[ allow( clippy:: too_many_arguments) ]
391
399
fn build_lotus_trace (
392
400
from : u64 ,
393
401
to : Address ,
394
402
method : u64 ,
395
403
params : Option < IpldBlock > ,
396
404
value : TokenAmount ,
405
+ gas_limit : u64 ,
406
+ read_only : bool ,
397
407
trace_iter : & mut impl Iterator < Item = ExecutionEvent > ,
398
408
) -> anyhow:: Result < Trace > {
399
409
let params = params. unwrap_or_default ( ) ;
@@ -405,6 +415,9 @@ fn build_lotus_trace(
405
415
method_num : method,
406
416
params : params. data ,
407
417
codec : params. codec ,
418
+ gas_limit,
419
+ read_only,
420
+ code_cid : Cid :: default ( ) ,
408
421
} ,
409
422
msg_ret : TraceReturn {
410
423
exit_code : ExitCode :: OK ,
@@ -423,11 +436,16 @@ fn build_lotus_trace(
423
436
method,
424
437
params,
425
438
value,
439
+ gas_limit,
440
+ read_only,
426
441
} => {
427
442
new_trace. subcalls . push ( build_lotus_trace (
428
- from, to, method, params, value, trace_iter,
443
+ from, to, method, params, value, gas_limit , read_only , trace_iter,
429
444
) ?) ;
430
445
}
446
+ ExecutionEvent :: InvokeActor ( cid) => {
447
+ new_trace. msg . code_cid = cid;
448
+ }
431
449
ExecutionEvent :: CallReturn ( exit_code, return_data) => {
432
450
let return_data = return_data. unwrap_or_default ( ) ;
433
451
new_trace. msg_ret = TraceReturn {
@@ -501,6 +519,8 @@ mod test {
501
519
params : None ,
502
520
to : Address :: new_id ( 0 ) ,
503
521
value : TokenAmount :: default ( ) ,
522
+ gas_limit : u64:: MAX ,
523
+ read_only : false ,
504
524
} ;
505
525
let return_result =
506
526
ExecutionEvent :: CallError ( SyscallError :: new ( IllegalArgument , "illegal" ) ) ;
@@ -524,6 +544,8 @@ mod test {
524
544
0 ,
525
545
None ,
526
546
TokenAmount :: default ( ) ,
547
+ u64:: MAX ,
548
+ false ,
527
549
& mut trace_iter,
528
550
)
529
551
. unwrap ( ) ;
0 commit comments