@@ -353,9 +353,10 @@ where
353353
354354 // A configured floor follows the same path as `SetFloor`: verify it,
355355 // then apply a local anchor or fetch the anchor block.
356- if let Some ( finalization) = self . floor . take_pending_anchor ( ) {
356+ if let Some ( ( finalization, prune_archives ) ) = self . floor . take_pending_anchor ( ) {
357357 self . install_floor (
358358 finalization,
359+ prune_archives,
359360 false ,
360361 & mut resolver,
361362 & mut buffer,
@@ -692,6 +693,9 @@ where
692693 let finalization = self . get_finalization_by_height ( height) . await ;
693694 response. send_lossy ( finalization) ;
694695 }
696+ Message :: GetProcessedHeight { response } => {
697+ response. send_lossy ( self . floor . processed_height ( ) ) ;
698+ }
695699 Message :: HintFinalized { height, targets } => {
696700 // Skip if finalization is already available locally.
697701 if self . get_finalization_by_height ( height) . await . is_some ( ) {
@@ -743,9 +747,19 @@ where
743747 . ignore ( ) ;
744748 }
745749 }
746- Message :: SetFloor { finalization } => {
747- self . install_floor ( finalization, true , resolver, buffer, application)
748- . await ;
750+ Message :: SetFloor {
751+ finalization,
752+ prune_archives,
753+ } => {
754+ self . install_floor (
755+ finalization,
756+ prune_archives,
757+ true ,
758+ resolver,
759+ buffer,
760+ application,
761+ )
762+ . await ;
749763 }
750764 Message :: Prune { height } => {
751765 // Only allow pruning at or below the current floor.
@@ -991,6 +1005,7 @@ where
9911005 async fn install_floor < Buf , R > (
9921006 & mut self ,
9931007 finalization : Finalization < P :: Scheme , V :: Commitment > ,
1008+ prune_archives : bool ,
9941009 skip_if_superseded : bool ,
9951010 resolver : & mut R ,
9961011 buffer : & mut OptionalBuffer < V , Buf > ,
@@ -1034,7 +1049,7 @@ where
10341049 }
10351050
10361051 if let Some ( block) = self . find_block_by_commitment ( buffer, commitment) . await {
1037- self . floor . await_anchor ( finalization) ;
1052+ self . floor . await_anchor ( finalization, prune_archives ) ;
10381053 assert ! (
10391054 self . apply_floor_anchor( & block, buffer, application, resolver)
10401055 . await
@@ -1047,7 +1062,7 @@ where
10471062 self . pending_acks . clear ( ) ;
10481063
10491064 debug ! ( ?round, ?commitment, "starting fetch for floor block" ) ;
1050- self . floor . await_anchor ( finalization) ;
1065+ self . floor . await_anchor ( finalization, prune_archives ) ;
10511066 self . floor
10521067 . fetch_if_permitted (
10531068 resolver,
@@ -1094,7 +1109,7 @@ where
10941109 existing = %self . floor. processed_height( ) ,
10951110 "floor not updated, at or below existing"
10961111 ) ;
1097- let finalization = self
1112+ let ( finalization, _prune_archives ) = self
10981113 . floor
10991114 . take_pending_anchor ( )
11001115 . expect ( "pending floor anchor missing" ) ;
@@ -1108,7 +1123,7 @@ where
11081123 }
11091124
11101125 let digest = block. digest ( ) ;
1111- let finalization = self
1126+ let ( finalization, prune_archives ) = self
11121127 . floor
11131128 . take_pending_anchor ( )
11141129 . expect ( "pending floor anchor missing" ) ;
@@ -1152,10 +1167,11 @@ where
11521167 // acks for blocks below the new floor cannot rewrite the processed floor.
11531168 self . pending_acks . clear ( ) ;
11541169
1155- // The floor is durable, so cache/finalized data below it can be pruned.
1156- self . prune_after_floor ( height)
1157- . await
1158- . expect ( "failed to prune data below floor" ) ;
1170+ if prune_archives {
1171+ self . prune_after_floor ( height)
1172+ . await
1173+ . expect ( "failed to prune data below floor" ) ;
1174+ }
11591175
11601176 // Intentionally keep existing block subscriptions alive. Canceling
11611177 // waiters can have catastrophic consequences (nodes can get stuck in
@@ -1726,9 +1742,9 @@ where
17261742 finalization : Option < Finalization < P :: Scheme , V :: Commitment > > ,
17271743 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
17281744 ) -> bool {
1729- // Blocks below the last processed height are not useful to us, so we ignore them (this
1730- // has the nice byproduct of ensuring we don't call a backing store with a block below the
1731- // pruning boundary)
1745+ // Blocks at or below the last processed height are not useful to us, so we
1746+ // ignore them (this has the nice byproduct of ensuring we don't call
1747+ // a backing store with a block below the pruning boundary).
17321748 if height <= self . floor . processed_height ( ) {
17331749 debug ! (
17341750 %height,
0 commit comments