mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
This commit syncs Prater
This commit is contained in:
@@ -417,6 +417,12 @@ where
|
||||
let (_, updated_builder) = self.set_genesis_state(genesis_state)?;
|
||||
self = updated_builder;
|
||||
|
||||
// Build the committee caches before storing. The database assumes that states have
|
||||
// committee caches built before storing.
|
||||
weak_subj_state
|
||||
.build_all_committee_caches(&self.spec)
|
||||
.map_err(|e| format!("Error building caches on checkpoint state: {:?}", e))?;
|
||||
|
||||
// Write the state and block non-atomically, it doesn't matter if they're forgotten
|
||||
// about on a crash restart.
|
||||
store
|
||||
|
||||
@@ -111,12 +111,11 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
|
||||
state: &BeaconState<T::EthSpec>,
|
||||
) -> Result<(), BeaconChainError> {
|
||||
if state.validators().len() > self.pubkeys.len() {
|
||||
// FIXME(sproul): iter_from would be more efficient than `skip` here
|
||||
self.import(
|
||||
state
|
||||
.validators()
|
||||
.iter()
|
||||
.skip(self.pubkeys.len())
|
||||
.iter_from(self.pubkeys.len())
|
||||
.unwrap() // FIXME(sproul)
|
||||
.map(|v| v.pubkey),
|
||||
)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user