@@ -690,6 +690,10 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
690
690
}
691
691
}
692
692
693
+ // Sort states to prune to make it more readable
694
+ let mut states_to_prune = states_to_prune. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
695
+ states_to_prune. sort_by_key ( |( slot, _) | * slot) ;
696
+
693
697
debug ! (
694
698
log,
695
699
"Extra pruning information" ;
@@ -702,11 +706,17 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
702
706
"state_summaries_dag_roots" => ?state_summaries_dag_roots,
703
707
"finalized_and_descendant_state_roots_of_finalized_checkpoint" => finalized_and_descendant_state_roots_of_finalized_checkpoint. len( ) ,
704
708
"finalized_and_descendant_state_roots_of_finalized_checkpoint" => finalized_and_descendant_state_roots_of_finalized_checkpoint. len( ) ,
705
- "blocks_to_prune_count" => blocks_to_prune. len( ) ,
706
- "states_to_prune_count" => states_to_prune. len( ) ,
707
- "blocks_to_prune" => ?blocks_to_prune,
708
- "states_to_prune" => ?states_to_prune,
709
+ "blocks_to_prune" => blocks_to_prune. len( ) ,
710
+ "states_to_prune" => states_to_prune. len( ) ,
709
711
) ;
712
+ // Don't log the full `states_to_prune` in the log statement above as it can result in a
713
+ // single log line of +1Kb and break logging setups.
714
+ for block_root in & blocks_to_prune {
715
+ debug ! ( log, "block to prune" ; "block_root" => ?block_root) ;
716
+ }
717
+ for ( slot, state_root) in & states_to_prune {
718
+ debug ! ( log, "state to prune" ; "state_root" => ?state_root, "slot" => slot) ;
719
+ }
710
720
711
721
let mut batch: Vec < StoreOp < E > > = blocks_to_prune
712
722
. into_iter ( )
0 commit comments