@@ -14,6 +14,7 @@ use fvm_shared::event::StampedEvent;
1414use fvm_shared:: sys:: BlockId ;
1515use fvm_shared:: { ActorID , METHOD_SEND } ;
1616use num_traits:: Zero ;
17+ use std:: collections:: HashMap ;
1718
1819use super :: state_access_tracker:: { ActorAccessState , StateAccessTracker } ;
1920use super :: { Backtrace , CallManager , Entrypoint , InvocationResult , NO_DATA_BLOCK_ID } ;
@@ -75,6 +76,8 @@ pub struct InnerDefaultCallManager<M: Machine> {
7576 limits : M :: Limiter ,
7677 /// Accumulator for events emitted in this call stack.
7778 events : EventsAccumulator ,
79+ /// A map of ActorID and how often they appear on the call stack.
80+ actor_call_stack : HashMap < ActorID , i32 > ,
7881}
7982
8083#[ doc( hidden) ]
@@ -159,6 +162,7 @@ where
159162 limits,
160163 events : Default :: default ( ) ,
161164 state_access_tracker,
165+ actor_call_stack : HashMap :: new ( ) ,
162166 } ) ) )
163167 }
164168
@@ -327,6 +331,14 @@ where
327331 self . nonce
328332 }
329333
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+
330342 fn next_actor_address ( & self ) -> Address {
331343 // Base the next address on the address specified as the message origin. This lets us use,
332344 // e.g., an f2 address even if we can't look it up anywhere.
0 commit comments