@@ -327,14 +327,15 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
327
327
kind : RuntimeKind :: Execute ,
328
328
inner : MaybeBorrowed :: Borrowed ( runtime) ,
329
329
} ) ;
330
- let ( reason, _, _) = self . execute_with_call_stack ( & mut call_stack) ;
330
+ let ( reason, _, _) = self . execute_with_call_stack ( & mut call_stack, None ) ;
331
331
reason
332
332
}
333
333
334
334
/// Execute using Runtimes on the call_stack until it returns.
335
335
fn execute_with_call_stack (
336
336
& mut self ,
337
337
call_stack : & mut Vec < TaggedRuntime < ' _ > > ,
338
+ caller : Option < H160 > ,
338
339
) -> ( ExitReason , Option < H160 > , Vec < u8 > ) {
339
340
// This `interrupt_runtime` is used to pass the runtime obtained from the
340
341
// `Capture::Trap` branch in the match below back to the top of the call stack.
@@ -378,6 +379,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
378
379
created_address,
379
380
reason,
380
381
runtime. inner . machine ( ) . return_value ( ) ,
382
+ caller,
381
383
) ;
382
384
( reason, maybe_address, return_data)
383
385
}
@@ -486,7 +488,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
486
488
Capture :: Trap ( rt) => {
487
489
let mut cs = Vec :: with_capacity ( DEFAULT_CALL_STACK_CAPACITY ) ;
488
490
cs. push ( rt. 0 ) ;
489
- let ( s, _, v) = self . execute_with_call_stack ( & mut cs) ;
491
+ let ( s, _, v) = self . execute_with_call_stack ( & mut cs, None ) ;
490
492
emit_exit ! ( s, v)
491
493
}
492
494
}
@@ -544,7 +546,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
544
546
Capture :: Trap ( rt) => {
545
547
let mut cs = Vec :: with_capacity ( DEFAULT_CALL_STACK_CAPACITY ) ;
546
548
cs. push ( rt. 0 ) ;
547
- let ( s, _, v) = self . execute_with_call_stack ( & mut cs) ;
549
+ let ( s, _, v) = self . execute_with_call_stack ( & mut cs, None ) ;
548
550
emit_exit ! ( s, v)
549
551
}
550
552
}
@@ -675,7 +677,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
675
677
Capture :: Trap ( rt) => {
676
678
let mut cs = Vec :: with_capacity ( DEFAULT_CALL_STACK_CAPACITY ) ;
677
679
cs. push ( rt. 0 ) ;
678
- let ( s, _, v) = self . execute_with_call_stack ( & mut cs) ;
680
+ let ( s, _, v) = self . execute_with_call_stack ( & mut cs, Some ( caller ) ) ;
679
681
emit_exit ! ( s, v)
680
682
}
681
683
}
@@ -1028,6 +1030,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
1028
1030
created_address : H160 ,
1029
1031
reason : ExitReason ,
1030
1032
return_data : Vec < u8 > ,
1033
+ caller : Option < H160 >
1031
1034
) -> ( ExitReason , Option < H160 > , Vec < u8 > ) {
1032
1035
fn check_first_byte ( config : & Config , code : & [ u8 ] ) -> Result < ( ) , ExitError > {
1033
1036
if config. disallow_executable_format && Some ( & Opcode :: EOFMAGIC . as_u8 ( ) ) == code. first ( )
@@ -1526,7 +1529,7 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle
1526
1529
let mut call_stack = Vec :: with_capacity ( DEFAULT_CALL_STACK_CAPACITY ) ;
1527
1530
call_stack. push ( rt. 0 ) ;
1528
1531
let ( reason, _, return_data) =
1529
- self . executor . execute_with_call_stack ( & mut call_stack) ;
1532
+ self . executor . execute_with_call_stack ( & mut call_stack, None ) ;
1530
1533
emit_exit ! ( reason, return_data)
1531
1534
}
1532
1535
}
0 commit comments