@@ -14,6 +14,7 @@ use fvm_shared::event::StampedEvent;
14
14
use fvm_shared:: sys:: BlockId ;
15
15
use fvm_shared:: { ActorID , METHOD_SEND } ;
16
16
use num_traits:: Zero ;
17
+ use std:: collections:: HashMap ;
17
18
18
19
use super :: state_access_tracker:: { ActorAccessState , StateAccessTracker } ;
19
20
use super :: { Backtrace , CallManager , Entrypoint , InvocationResult , NO_DATA_BLOCK_ID } ;
@@ -75,6 +76,8 @@ pub struct InnerDefaultCallManager<M: Machine> {
75
76
limits : M :: Limiter ,
76
77
/// Accumulator for events emitted in this call stack.
77
78
events : EventsAccumulator ,
79
+ /// A map of ActorID and how often they appear on the call stack.
80
+ actor_call_stack : HashMap < ActorID , i32 > ,
78
81
}
79
82
80
83
#[ doc( hidden) ]
@@ -159,6 +162,7 @@ where
159
162
limits,
160
163
events : Default :: default ( ) ,
161
164
state_access_tracker,
165
+ actor_call_stack : HashMap :: new ( ) ,
162
166
} ) ) )
163
167
}
164
168
@@ -327,6 +331,14 @@ where
327
331
self . nonce
328
332
}
329
333
334
+ fn get_actor_call_stack ( & self ) -> & HashMap < ActorID , i32 > {
335
+ & self . actor_call_stack
336
+ }
337
+
338
+ fn get_actor_call_stack_mut ( & mut self ) -> & mut HashMap < ActorID , i32 > {
339
+ & mut self . actor_call_stack
340
+ }
341
+
330
342
fn next_actor_address ( & self ) -> Address {
331
343
// Base the next address on the address specified as the message origin. This lets us use,
332
344
// e.g., an f2 address even if we can't look it up anywhere.
0 commit comments