@@ -931,18 +931,26 @@ where
931931
932932 // Load the persisted custody context from the db and initialize
933933 // the context for this run
934- let custody_context = if let Some ( custody) =
934+ let ( custody_context, cgc_changed_opt ) = if let Some ( custody) =
935935 load_custody_context :: < E , THotStore , TColdStore > ( store. clone ( ) )
936936 {
937- Arc :: new ( CustodyContext :: new_from_persisted_custody_context (
937+ let head_epoch = canonical_head
938+ . cached_head ( )
939+ . head_slot ( )
940+ . epoch ( E :: slots_per_epoch ( ) ) ;
941+ CustodyContext :: new_from_persisted_custody_context (
938942 custody,
939943 self . node_custody_type ,
944+ head_epoch,
940945 & self . spec ,
941- ) )
946+ )
942947 } else {
943- Arc :: new ( CustodyContext :: new ( self . node_custody_type , & self . spec ) )
948+ (
949+ CustodyContext :: new ( self . node_custody_type , & self . spec ) ,
950+ None ,
951+ )
944952 } ;
945- debug ! ( ?custody_context, "Loading persisted custody context" ) ;
953+ debug ! ( ?custody_context, "Loaded persisted custody context" ) ;
946954
947955 let beacon_chain = BeaconChain {
948956 spec : self . spec . clone ( ) ,
@@ -1019,7 +1027,7 @@ where
10191027 slot_clock,
10201028 self . kzg . clone ( ) ,
10211029 store,
1022- custody_context,
1030+ Arc :: new ( custody_context) ,
10231031 self . spec ,
10241032 )
10251033 . map_err ( |e| format ! ( "Error initializing DataAvailabilityChecker: {:?}" , e) ) ?,
@@ -1062,6 +1070,14 @@ where
10621070 return Err ( format ! ( "Weak subjectivity verification failed: {:?}" , e) ) ;
10631071 }
10641072
1073+ if let Some ( cgc_changed) = cgc_changed_opt {
1074+ // Update data column custody info if there's a CGC change from CLI flags.
1075+ // This will trigger column backfill.
1076+ let cgc_change_effective_slot =
1077+ cgc_changed. effective_epoch . start_slot ( E :: slots_per_epoch ( ) ) ;
1078+ beacon_chain. update_data_column_custody_info ( Some ( cgc_change_effective_slot) ) ;
1079+ }
1080+
10651081 info ! (
10661082 head_state = %head. beacon_state_root( ) ,
10671083 head_block = %head. beacon_block_root,
0 commit comments