@@ -1077,11 +1077,8 @@ int
10771077fd_forest_evict ( fd_forest_t * forest , ulong new_slot , ulong parent_slot ) {
10781078 FD_LOG_NOTICE (( "fd_forest_eviction_time" ));
10791079 fd_forest_ancestry_t * ancestry = fd_forest_ancestry ( forest );
1080- fd_forest_orphaned_t * orphaned = fd_forest_orphaned ( forest );
10811080 fd_forest_frontier_t * frontier = fd_forest_frontier ( forest );
1082- fd_forest_subtrees_t * subtrees = fd_forest_subtrees ( forest );
10831081 fd_forest_subtlist_t * subtlist = fd_forest_subtlist ( forest );
1084- fd_forest_ref_t * conspool = fd_forest_conspool ( forest );
10851082 fd_forest_blk_t * pool = fd_forest_pool ( forest );
10861083 ulong null = fd_forest_pool_idx_null ( pool );
10871084
@@ -1095,7 +1092,7 @@ fd_forest_evict( fd_forest_t * forest, ulong new_slot, ulong parent_slot ) {
10951092 /* We'll keep it if it's older than all of our orphans, or if it's
10961093 parent is part of the main tree. */
10971094
1098- ulong evict_orphan_slot = ULONG_MAX ; /* best orphan candidate for eviction is the newest one . */
1095+ ulong evict_orphan_slot = ULONG_MAX ; /* best orphan candidate for eviction is the newest subtree . */
10991096 for ( fd_forest_subtlist_iter_t iter = fd_forest_subtlist_iter_fwd_init ( subtlist , pool );
11001097 !fd_forest_subtlist_iter_done ( iter , subtlist , pool );
11011098 iter = fd_forest_subtlist_iter_fwd_next ( iter , subtlist , pool ) ) {
@@ -1104,14 +1101,17 @@ fd_forest_evict( fd_forest_t * forest, ulong new_slot, ulong parent_slot ) {
11041101 else evict_orphan_slot = fd_ulong_max ( evict_orphan_slot , ele -> slot );
11051102
11061103 }
1107- /// TODO: idk should we evict the whole subtree??? or just like the leafy
1104+ /* We are connecting to the main tree. Nuke the orphan. */
11081105 if ( fd_forest_ancestry_ele_query ( ancestry , & parent_slot , NULL , pool ) ||
11091106 fd_forest_frontier_ele_query ( frontier , & parent_slot , NULL , pool ) ) {
1110- // choose something to evict from orphans
1107+ // evict_orphan_slot
11111108
11121109 return SLOT_INSERT ;
11131110 }
11141111
1112+
1113+ /* We ourselves are an orphan. Should we evict something else or just evict ourselves?
1114+ We'll keep it if it's older than all of our orphans */
11151115 for ( fd_forest_subtlist_iter_t iter = fd_forest_subtlist_iter_fwd_init ( subtlist , pool );
11161116 !fd_forest_subtlist_iter_done ( iter , subtlist , pool );
11171117 iter = fd_forest_subtlist_iter_fwd_next ( iter , subtlist , pool ) ) {
0 commit comments