@@ -26,7 +26,7 @@ use solana_sbpf::{
2626use solana_svm_feature_set:: SVMFeatureSet ;
2727use solana_svm_log_collector:: LogCollector ;
2828use solana_transaction_context:: TransactionContext ;
29- use std:: { cell :: RefCell , ffi:: c_int} ;
29+ use std:: ffi:: c_int;
3030
3131#[ no_mangle]
3232pub unsafe extern "C" fn sol_compat_vm_syscall_execute_v1 (
@@ -115,7 +115,7 @@ pub fn execute_vm_syscall(input: SyscallContext) -> Option<SyscallEffects> {
115115 let log_collector = LogCollector :: new_ref ( ) ;
116116 let instr_accounts = crate :: get_instr_accounts ( transaction_context, & instr. accounts ) ;
117117
118- let invoke_context = RefCell :: new ( InvokeContext :: new (
118+ let mut invoke_ctx = InvokeContext :: new (
119119 transaction_context,
120120 program_cache_for_tx_batch,
121121 EnvironmentConfig :: new (
@@ -128,9 +128,7 @@ pub fn execute_vm_syscall(input: SyscallContext) -> Option<SyscallEffects> {
128128 Some ( log_collector. clone ( ) ) ,
129129 compute_budget. to_budget ( ) ,
130130 SVMTransactionExecutionCost :: default ( ) ,
131- ) ) ;
132-
133- let mut invoke_ctx: std:: cell:: RefMut < ' _ , InvokeContext < ' _ > > = invoke_context. borrow_mut ( ) ;
131+ ) ;
134132
135133 let Some ( program_idx) = invoke_ctx
136134 . transaction_context
@@ -174,9 +172,7 @@ pub fn execute_vm_syscall(input: SyscallContext) -> Option<SyscallEffects> {
174172 return None ;
175173 }
176174 }
177- drop ( invoke_ctx) ;
178175
179- let invoke_ctx = invoke_context. borrow_mut ( ) ;
180176 let caller_instr_ctx = invoke_ctx
181177 . transaction_context
182178 . get_current_instruction_context ( )
@@ -198,8 +194,6 @@ pub fn execute_vm_syscall(input: SyscallContext) -> Option<SyscallEffects> {
198194 )
199195 . unwrap ( ) ;
200196
201- drop ( invoke_ctx) ;
202-
203197 let sbpf_version = SBPFVersion :: V0 ;
204198
205199 // Set up memory mapping
@@ -216,7 +210,6 @@ pub fn execute_vm_syscall(input: SyscallContext) -> Option<SyscallEffects> {
216210 return None ;
217211 }
218212
219- let mut invoke_ctx = invoke_context. borrow_mut ( ) ;
220213 let config = invoke_ctx
221214 . program_cache_for_tx_batch
222215 . environments
@@ -300,7 +293,7 @@ pub fn execute_vm_syscall(input: SyscallContext) -> Option<SyscallEffects> {
300293 let mut vm = EbpfVm :: new (
301294 loader,
302295 sbpf_version,
303- & mut * invoke_ctx,
296+ & mut invoke_ctx,
304297 memory_mapping,
305298 STACK_SIZE ,
306299 ) ;
0 commit comments