Merge branch 'unstable' of https://github.com/sigp/lighthouse into eip4844

This commit is contained in:
realbigsean
2022-11-04 13:23:55 -04:00
26 changed files with 37 additions and 77 deletions

View File

@@ -45,7 +45,7 @@ impl HeadTracker {
/// Returns a `SszHeadTracker`, which contains all necessary information to restore the state
/// of `Self` at some later point.
pub fn to_ssz_container(&self) -> SszHeadTracker {
SszHeadTracker::from_map(&*self.0.read())
SszHeadTracker::from_map(&self.0.read())
}
/// Creates a new `Self` from the given `SszHeadTracker`, restoring `Self` to the same state of

View File

@@ -588,7 +588,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
let persisted_head = PersistedBeaconChain {
_canonical_head_block_root: DUMMY_CANONICAL_HEAD_BLOCK_ROOT,
genesis_block_root,
ssz_head_tracker: SszHeadTracker::from_map(&*head_tracker_lock),
ssz_head_tracker: SszHeadTracker::from_map(&head_tracker_lock),
};
drop(head_tracker_lock);
kv_batch.push(persisted_head.as_kv_store_op(BEACON_CHAIN_DB_KEY));

View File

@@ -17,7 +17,6 @@ use crate::persisted_fork_choice::{
};
use crate::types::ChainSpec;
use slog::{warn, Logger};
use std::path::Path;
use std::sync::Arc;
use store::hot_cold_store::{HotColdDB, HotColdDBError};
use store::metadata::{SchemaVersion, CURRENT_SCHEMA_VERSION};
@@ -27,7 +26,6 @@ use store::{Error as StoreError, StoreItem};
pub fn migrate_schema<T: BeaconChainTypes>(
db: Arc<HotColdDB<T::EthSpec, T::HotStore, T::ColdStore>>,
deposit_contract_deploy_block: u64,
datadir: &Path,
from: SchemaVersion,
to: SchemaVersion,
log: Logger,
@@ -42,21 +40,12 @@ pub fn migrate_schema<T: BeaconChainTypes>(
migrate_schema::<T>(
db.clone(),
deposit_contract_deploy_block,
datadir,
from,
next,
log.clone(),
spec,
)?;
migrate_schema::<T>(
db,
deposit_contract_deploy_block,
datadir,
next,
to,
log,
spec,
)
migrate_schema::<T>(db, deposit_contract_deploy_block, next, to, log, spec)
}
// Downgrade across multiple versions by recursively migrating one step at a time.
(_, _) if to.as_u64() + 1 < from.as_u64() => {
@@ -64,21 +53,12 @@ pub fn migrate_schema<T: BeaconChainTypes>(
migrate_schema::<T>(
db.clone(),
deposit_contract_deploy_block,
datadir,
from,
next,
log.clone(),
spec,
)?;
migrate_schema::<T>(
db,
deposit_contract_deploy_block,
datadir,
next,
to,
log,
spec,
)
migrate_schema::<T>(db, deposit_contract_deploy_block, next, to, log, spec)
}
//

View File

@@ -356,7 +356,7 @@ where
let urls: Vec<SensitiveUrl> = urls
.iter()
.map(|s| SensitiveUrl::parse(*s))
.map(|s| SensitiveUrl::parse(s))
.collect::<Result<_, _>>()
.unwrap();

View File

@@ -332,34 +332,22 @@ impl<T: EthSpec> ValidatorMonitor<T> {
metrics::set_int_gauge(
&metrics::VALIDATOR_MONITOR_SLASHED,
&[id],
if validator.slashed { 1 } else { 0 },
i64::from(validator.slashed),
);
metrics::set_int_gauge(
&metrics::VALIDATOR_MONITOR_ACTIVE,
&[id],
if validator.is_active_at(current_epoch) {
1
} else {
0
},
i64::from(validator.is_active_at(current_epoch)),
);
metrics::set_int_gauge(
&metrics::VALIDATOR_MONITOR_EXITED,
&[id],
if validator.is_exited_at(current_epoch) {
1
} else {
0
},
i64::from(validator.is_exited_at(current_epoch)),
);
metrics::set_int_gauge(
&metrics::VALIDATOR_MONITOR_WITHDRAWABLE,
&[id],
if validator.is_withdrawable_at(current_epoch) {
1
} else {
0
},
i64::from(validator.is_withdrawable_at(current_epoch)),
);
metrics::set_int_gauge(
&metrics::VALIDATOR_ACTIVATION_ELIGIBILITY_EPOCH,