Skip to content

Commit 1aec17b

Browse files
committed
Merge branch 'unstable' of https://github.com/sigp/lighthouse into eip4844
2 parents c45b809 + 8600645 commit 1aec17b

File tree

26 files changed

+37
-77
lines changed

26 files changed

+37
-77
lines changed

account_manager/src/validator/exit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ fn load_voting_keypair(
349349
password_file_path: Option<&PathBuf>,
350350
stdin_inputs: bool,
351351
) -> Result<Keypair, String> {
352-
let keystore = Keystore::from_json_file(&voting_keystore_path).map_err(|e| {
352+
let keystore = Keystore::from_json_file(voting_keystore_path).map_err(|e| {
353353
format!(
354354
"Unable to read keystore JSON {:?}: {:?}",
355355
voting_keystore_path, e

account_manager/src/validator/import.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
176176

177177
let password = match keystore_password_path.as_ref() {
178178
Some(path) => {
179-
let password_from_file: ZeroizeString = fs::read_to_string(&path)
179+
let password_from_file: ZeroizeString = fs::read_to_string(path)
180180
.map_err(|e| format!("Unable to read {:?}: {:?}", path, e))?
181181
.into();
182182
password_from_file.without_newlines()
@@ -256,7 +256,7 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
256256
.ok_or_else(|| format!("Badly formatted file name: {:?}", src_keystore))?;
257257

258258
// Copy the keystore to the new location.
259-
fs::copy(&src_keystore, &dest_keystore)
259+
fs::copy(src_keystore, &dest_keystore)
260260
.map_err(|e| format!("Unable to copy keystore: {:?}", e))?;
261261

262262
// Register with slashing protection.

account_manager/src/wallet/create.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn create_wallet_from_mnemonic(
159159
unknown => return Err(format!("--{} {} is not supported", TYPE_FLAG, unknown)),
160160
};
161161

162-
let mgr = WalletManager::open(&wallet_base_dir)
162+
let mgr = WalletManager::open(wallet_base_dir)
163163
.map_err(|e| format!("Unable to open --{}: {:?}", WALLETS_DIR_FLAG, e))?;
164164

165165
let wallet_password: PlainText = match wallet_password_path {

beacon_node/beacon_chain/src/head_tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl HeadTracker {
4545
/// Returns a `SszHeadTracker`, which contains all necessary information to restore the state
4646
/// of `Self` at some later point.
4747
pub fn to_ssz_container(&self) -> SszHeadTracker {
48-
SszHeadTracker::from_map(&*self.0.read())
48+
SszHeadTracker::from_map(&self.0.read())
4949
}
5050

5151
/// Creates a new `Self` from the given `SszHeadTracker`, restoring `Self` to the same state of

beacon_node/beacon_chain/src/migrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
588588
let persisted_head = PersistedBeaconChain {
589589
_canonical_head_block_root: DUMMY_CANONICAL_HEAD_BLOCK_ROOT,
590590
genesis_block_root,
591-
ssz_head_tracker: SszHeadTracker::from_map(&*head_tracker_lock),
591+
ssz_head_tracker: SszHeadTracker::from_map(&head_tracker_lock),
592592
};
593593
drop(head_tracker_lock);
594594
kv_batch.push(persisted_head.as_kv_store_op(BEACON_CHAIN_DB_KEY));

beacon_node/beacon_chain/src/schema_change.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::persisted_fork_choice::{
1717
};
1818
use crate::types::ChainSpec;
1919
use slog::{warn, Logger};
20-
use std::path::Path;
2120
use std::sync::Arc;
2221
use store::hot_cold_store::{HotColdDB, HotColdDBError};
2322
use store::metadata::{SchemaVersion, CURRENT_SCHEMA_VERSION};
@@ -27,7 +26,6 @@ use store::{Error as StoreError, StoreItem};
2726
pub fn migrate_schema<T: BeaconChainTypes>(
2827
db: Arc<HotColdDB<T::EthSpec, T::HotStore, T::ColdStore>>,
2928
deposit_contract_deploy_block: u64,
30-
datadir: &Path,
3129
from: SchemaVersion,
3230
to: SchemaVersion,
3331
log: Logger,
@@ -42,43 +40,25 @@ pub fn migrate_schema<T: BeaconChainTypes>(
4240
migrate_schema::<T>(
4341
db.clone(),
4442
deposit_contract_deploy_block,
45-
datadir,
4643
from,
4744
next,
4845
log.clone(),
4946
spec,
5047
)?;
51-
migrate_schema::<T>(
52-
db,
53-
deposit_contract_deploy_block,
54-
datadir,
55-
next,
56-
to,
57-
log,
58-
spec,
59-
)
48+
migrate_schema::<T>(db, deposit_contract_deploy_block, next, to, log, spec)
6049
}
6150
// Downgrade across multiple versions by recursively migrating one step at a time.
6251
(_, _) if to.as_u64() + 1 < from.as_u64() => {
6352
let next = SchemaVersion(from.as_u64() - 1);
6453
migrate_schema::<T>(
6554
db.clone(),
6655
deposit_contract_deploy_block,
67-
datadir,
6856
from,
6957
next,
7058
log.clone(),
7159
spec,
7260
)?;
73-
migrate_schema::<T>(
74-
db,
75-
deposit_contract_deploy_block,
76-
datadir,
77-
next,
78-
to,
79-
log,
80-
spec,
81-
)
61+
migrate_schema::<T>(db, deposit_contract_deploy_block, next, to, log, spec)
8262
}
8363

8464
//

beacon_node/beacon_chain/src/test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ where
356356

357357
let urls: Vec<SensitiveUrl> = urls
358358
.iter()
359-
.map(|s| SensitiveUrl::parse(*s))
359+
.map(|s| SensitiveUrl::parse(s))
360360
.collect::<Result<_, _>>()
361361
.unwrap();
362362

beacon_node/beacon_chain/src/validator_monitor.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -332,34 +332,22 @@ impl<T: EthSpec> ValidatorMonitor<T> {
332332
metrics::set_int_gauge(
333333
&metrics::VALIDATOR_MONITOR_SLASHED,
334334
&[id],
335-
if validator.slashed { 1 } else { 0 },
335+
i64::from(validator.slashed),
336336
);
337337
metrics::set_int_gauge(
338338
&metrics::VALIDATOR_MONITOR_ACTIVE,
339339
&[id],
340-
if validator.is_active_at(current_epoch) {
341-
1
342-
} else {
343-
0
344-
},
340+
i64::from(validator.is_active_at(current_epoch)),
345341
);
346342
metrics::set_int_gauge(
347343
&metrics::VALIDATOR_MONITOR_EXITED,
348344
&[id],
349-
if validator.is_exited_at(current_epoch) {
350-
1
351-
} else {
352-
0
353-
},
345+
i64::from(validator.is_exited_at(current_epoch)),
354346
);
355347
metrics::set_int_gauge(
356348
&metrics::VALIDATOR_MONITOR_WITHDRAWABLE,
357349
&[id],
358-
if validator.is_withdrawable_at(current_epoch) {
359-
1
360-
} else {
361-
0
362-
},
350+
i64::from(validator.is_withdrawable_at(current_epoch)),
363351
);
364352
metrics::set_int_gauge(
365353
&metrics::VALIDATOR_ACTIVATION_ELIGIBILITY_EPOCH,

beacon_node/client/src/builder.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ where
858858
/// Specifies that the `Client` should use a `HotColdDB` database.
859859
pub fn disk_store(
860860
mut self,
861-
datadir: &Path,
862861
hot_path: &Path,
863862
cold_path: &Path,
864863
config: StoreConfig,
@@ -888,7 +887,6 @@ where
888887
migrate_schema::<Witness<TSlotClock, TEth1Backend, _, _, _>>(
889888
db,
890889
deposit_contract_deploy_block,
891-
datadir,
892890
from,
893891
to,
894892
log,

beacon_node/http_api/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![recursion_limit = "256"]
12
//! This crate contains a HTTP server which serves the endpoints listed here:
23
//!
34
//! https://github.com/ethereum/beacon-APIs

0 commit comments

Comments
 (0)