@@ -56,7 +56,7 @@ impl<N: Network> Stack<N> {
5656 // Store the inputs.
5757 closure. inputs ( ) . iter ( ) . map ( |i| i. register ( ) ) . zip_eq ( inputs) . try_for_each ( |( register, input) | {
5858 // If the circuit is in execute mode, then store the console input.
59- if let CallStack :: Execute ( ..) = registers. call_stack ( ) {
59+ if let CallStack :: Execute ( ..) = registers. call_stack_ref ( ) {
6060 use circuit:: Eject ;
6161 // Assign the console input to the register.
6262 registers. store ( self , register, input. eject_value ( ) ) ?;
@@ -69,7 +69,7 @@ impl<N: Network> Stack<N> {
6969 // Execute the instructions.
7070 for instruction in closure. instructions ( ) {
7171 // If the circuit is in execute mode, then evaluate the instructions.
72- if let CallStack :: Execute ( ..) = registers. call_stack ( ) {
72+ if let CallStack :: Execute ( ..) = registers. call_stack_ref ( ) {
7373 // If the evaluation fails, bail and return the error.
7474 if let Err ( error) = instruction. evaluate ( self , & mut registers) {
7575 bail ! ( "Failed to evaluate instruction ({instruction}): {error}" ) ;
@@ -267,7 +267,7 @@ impl<N: Network> Stack<N> {
267267 // Store the inputs.
268268 function. inputs ( ) . iter ( ) . map ( |i| i. register ( ) ) . zip_eq ( request. inputs ( ) ) . try_for_each ( |( register, input) | {
269269 // If the circuit is in execute mode, then store the console input.
270- if let CallStack :: Execute ( ..) = registers. call_stack ( ) {
270+ if let CallStack :: Execute ( ..) = registers. call_stack_ref ( ) {
271271 // Assign the console input to the register.
272272 registers. store ( self , register, input. eject_value ( ) ) ?;
273273 }
@@ -282,11 +282,11 @@ impl<N: Network> Stack<N> {
282282 // Execute the instructions.
283283 for instruction in function. instructions ( ) {
284284 // If the circuit is in execute mode, then evaluate the instructions.
285- if let CallStack :: Execute ( ..) = registers. call_stack ( ) {
285+ if let CallStack :: Execute ( ..) = registers. call_stack_ref ( ) {
286286 // Evaluate the instruction.
287287 let result = match instruction {
288288 // If the instruction is a `call` instruction, we need to handle it separately.
289- Instruction :: Call ( call) => CallTrait :: evaluate ( call, self , & mut registers) ,
289+ Instruction :: Call ( call) => CallTrait :: evaluate ( call, self , & mut registers, rng ) ,
290290 // Otherwise, evaluate the instruction normally.
291291 _ => instruction. evaluate ( self , & mut registers) ,
292292 } ;
@@ -410,7 +410,7 @@ impl<N: Network> Stack<N> {
410410 } ) ?;
411411
412412 // If the circuit is in `Execute` or `PackageRun` mode, then ensure the circuit is satisfied.
413- if matches ! ( registers. call_stack ( ) , CallStack :: Execute ( ..) | CallStack :: PackageRun ( ..) ) {
413+ if matches ! ( registers. call_stack_ref ( ) , CallStack :: Execute ( ..) | CallStack :: PackageRun ( ..) ) {
414414 // If the circuit is empty or not satisfied, then throw an error.
415415 ensure ! (
416416 A :: num_constraints( ) > 0 && A :: is_satisfied( ) ,
@@ -425,7 +425,7 @@ impl<N: Network> Stack<N> {
425425 let assignment = A :: eject_assignment_and_reset ( ) ;
426426
427427 // If the circuit is in `Synthesize` or `Execute` mode, synthesize the circuit key, if it does not exist.
428- if matches ! ( registers. call_stack ( ) , CallStack :: Synthesize ( ..) | CallStack :: Execute ( ..) ) {
428+ if matches ! ( registers. call_stack_ref ( ) , CallStack :: Synthesize ( ..) | CallStack :: Execute ( ..) ) {
429429 // If the proving key does not exist, then synthesize it.
430430 if !self . contains_proving_key ( function. name ( ) ) {
431431 // Add the circuit key to the mapping.
@@ -434,15 +434,15 @@ impl<N: Network> Stack<N> {
434434 }
435435 }
436436 // If the circuit is in `Authorize` mode, then save the transition.
437- if let CallStack :: Authorize ( _, _, authorization) = registers. call_stack ( ) {
437+ if let CallStack :: Authorize ( _, _, authorization) = registers. call_stack_ref ( ) {
438438 // Construct the transition.
439439 let transition = Transition :: from ( & console_request, & response, & output_types, & output_registers) ?;
440440 // Add the transition to the authorization.
441441 authorization. insert_transition ( transition) ?;
442442 lap ! ( timer, "Save the transition" ) ;
443443 }
444444 // If the circuit is in `CheckDeployment` mode, then save the assignment.
445- else if let CallStack :: CheckDeployment ( _, _, ref assignments, _, _) = registers. call_stack ( ) {
445+ else if let CallStack :: CheckDeployment ( _, _, ref assignments, _, _) = registers. call_stack_ref ( ) {
446446 // Construct the call metrics.
447447 let metrics = CallMetrics {
448448 program_id : * self . program_id ( ) ,
@@ -457,7 +457,7 @@ impl<N: Network> Stack<N> {
457457 lap ! ( timer, "Save the circuit assignment" ) ;
458458 }
459459 // If the circuit is in `Execute` mode, then execute the circuit into a transition.
460- else if let CallStack :: Execute ( _, ref trace) = registers. call_stack ( ) {
460+ else if let CallStack :: Execute ( _, ref trace) = registers. call_stack_ref ( ) {
461461 registers. ensure_console_and_circuit_registers_match ( ) ?;
462462
463463 // Construct the transition.
@@ -484,7 +484,7 @@ impl<N: Network> Stack<N> {
484484 ) ?;
485485 }
486486 // If the circuit is in `PackageRun` mode, then save the assignment.
487- else if let CallStack :: PackageRun ( _, _, ref assignments) = registers. call_stack ( ) {
487+ else if let CallStack :: PackageRun ( _, _, ref assignments) = registers. call_stack_ref ( ) {
488488 // Construct the call metrics.
489489 let metrics = CallMetrics {
490490 program_id : * self . program_id ( ) ,
0 commit comments