File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
beacon_node/beacon_chain/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -325,9 +325,20 @@ where
325
325
. unwrap_or_else ( OperationPool :: new) ,
326
326
) ;
327
327
328
- let pubkey_cache = ValidatorPubkeyCache :: load_from_store ( store)
328
+ let mut pubkey_cache = ValidatorPubkeyCache :: load_from_store ( store. clone ( ) )
329
329
. map_err ( |e| format ! ( "Unable to open persisted pubkey cache: {:?}" , e) ) ?;
330
330
331
+ // If any validators weren't persisted to disk on previous runs, this will use the genesis_state to
332
+ // "top-up" the in-memory validator cache and its on-disk representation with any missing validators.
333
+ let pubkey_store_ops = pubkey_cache
334
+ . import_new_pubkeys ( & genesis_state)
335
+ . map_err ( |e| format ! ( "Unable to top-up persisted pubkey cache {:?}" , e) ) ?;
336
+
337
+ // Write any missed validators to disk
338
+ store
339
+ . do_atomically_with_block_and_blobs_cache ( pubkey_store_ops)
340
+ . map_err ( |e| format ! ( "Unable to write pubkeys to disk {:?}" , e) ) ?;
341
+
331
342
self . genesis_block_root = Some ( chain. genesis_block_root ) ;
332
343
self . genesis_state_root = Some ( genesis_block. state_root ( ) ) ;
333
344
self . head_tracker = Some (
You can’t perform that action at this time.
0 commit comments