File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -378,13 +378,19 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
378378 config. limit_to_load_programs,
379379 ) ;
380380
381+ // This means the cache is corrupted and runtime cannot load required programs
381382 if program_cache_for_tx_batch. hit_max_limit {
383+ // We retry once (will most likely succeed)
384+ // But to guarantee success we clear the cache
382385 if !replenish_retried {
383386 replenish_retried = true ;
384- self . program_cache
385- . write( )
386- . unwrap( )
387- . prune( self . slot, self . epoch) ;
387+ let mut cache = self . program_cache. write( ) . unwrap( ) ;
388+ // We need to reset the slot to avoid debug panics
389+ let slot = cache. latest_root_slot;
390+ cache. latest_root_slot = 0 ;
391+ cache. prune( 0 , 0 ) ;
392+ // And restore the slot to previous value after prune
393+ cache. latest_root_slot = slot;
388394 continue ;
389395 }
390396
You can’t perform that action at this time.
0 commit comments