Skip to content

Update Rust Edition to 2024 #7766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 39 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ members = [
resolver = "2"

[workspace.package]
edition = "2021"
edition = "2024"

[workspace.dependencies]
account_utils = { path = "common/account_utils" }
Expand Down Expand Up @@ -203,7 +203,7 @@ quickcheck = "1"
quickcheck_macros = "1"
quote = "1"
r2d2 = "0.8"
rand = "0.8"
rand = "0.9.1"
rayon = "1.7"
regex = "1"
reqwest = { version = "0.11", default-features = false, features = [
Expand Down
12 changes: 7 additions & 5 deletions account_manager/src/validator/create.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use crate::common::read_wallet_name_from_cli;
use crate::{SECRETS_DIR_FLAG, WALLETS_DIR_FLAG};
use account_utils::{
random_password, read_password_from_user, strip_off_newlines, validator_definitions, PlainText,
STDIN_INPUTS_FLAG,
PlainText, STDIN_INPUTS_FLAG, random_password, read_password_from_user, strip_off_newlines,
validator_definitions,
};
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use directory::{parse_path_or_default_with_flag, DEFAULT_SECRET_DIR, DEFAULT_WALLET_DIR};
use directory::{DEFAULT_SECRET_DIR, DEFAULT_WALLET_DIR, parse_path_or_default_with_flag};
use environment::Environment;
use eth2_wallet_manager::WalletManager;
use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME};
use slashing_protection::{SLASHING_PROTECTION_FILENAME, SlashingDatabase};
use std::ffi::OsStr;
use std::fs;
use std::fs::create_dir_all;
Expand Down Expand Up @@ -148,7 +148,9 @@ pub fn cli_run<E: EthSpec>(
return Err(format!(
"No wallet directory at {:?}. Use the `lighthouse --network {} {} {} {}` command to create a wallet",
wallet_base_dir,
matches.get_one::<String>("network").unwrap_or(&String::from("<NETWORK>")),
matches
.get_one::<String>("network")
.unwrap_or(&String::from("<NETWORK>")),
crate::CMD,
crate::wallet::CMD,
crate::wallet::create::CMD
Expand Down
10 changes: 6 additions & 4 deletions account_manager/src/validator/exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use environment::Environment;
use eth2::{
types::{GenesisData, StateId, ValidatorData, ValidatorId, ValidatorStatus},
BeaconNodeHttpClient, Timeouts,
types::{GenesisData, StateId, ValidatorData, ValidatorId, ValidatorStatus},
};
use eth2_keystore::Keystore;
use eth2_network_config::Eth2NetworkConfig;
Expand Down Expand Up @@ -239,9 +239,11 @@ async fn publish_voluntary_exit<E: EthSpec>(
let withdrawal_epoch = validator_data.validator.withdrawable_epoch;
let current_epoch = get_current_epoch::<E>(genesis_data.genesis_time, spec)
.ok_or("Failed to get current epoch. Please check your system time")?;
eprintln!("Voluntary exit has been accepted into the beacon chain, but not yet finalized. \
eprintln!(
"Voluntary exit has been accepted into the beacon chain, but not yet finalized. \
Finalization may take several minutes or longer. Before finalization there is a low \
probability that the exit may be reverted.");
probability that the exit may be reverted."
);
eprintln!(
"Current epoch: {}, Exit epoch: {}, Withdrawable epoch: {}",
current_epoch, exit_epoch, withdrawal_epoch
Expand Down Expand Up @@ -401,7 +403,7 @@ mod tests {
use eth2_keystore::KeystoreBuilder;
use std::fs::File;
use std::io::Write;
use tempfile::{tempdir, TempDir};
use tempfile::{TempDir, tempdir};

const PASSWORD: &str = "cats";
const KEYSTORE_NAME: &str = "keystore-m_12381_3600_0_0_0-1595406747.json";
Expand Down
12 changes: 6 additions & 6 deletions account_manager/src/validator/import.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use crate::wallet::create::PASSWORD_FLAG;
use account_utils::validator_definitions::SigningDefinition;
use account_utils::{
STDIN_INPUTS_FLAG,
eth2_keystore::Keystore,
read_password_from_user,
validator_definitions::{
recursively_find_voting_keystores, PasswordStorage, ValidatorDefinition,
ValidatorDefinitions, CONFIG_FILENAME,
CONFIG_FILENAME, PasswordStorage, ValidatorDefinition, ValidatorDefinitions,
recursively_find_voting_keystores,
},
STDIN_INPUTS_FLAG,
};
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME};
use slashing_protection::{SLASHING_PROTECTION_FILENAME, SlashingDatabase};
use std::fs;
use std::path::PathBuf;
use std::thread::sleep;
Expand Down Expand Up @@ -133,7 +133,7 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
return Err(format!(
"Must supply either --{} or --{}",
KEYSTORE_FLAG, DIR_FLAG
))
));
}
};

Expand Down Expand Up @@ -227,7 +227,7 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
if let Some(ValidatorDefinition {
signing_definition:
SigningDefinition::LocalKeystore {
voting_keystore_password: ref mut old_passwd,
voting_keystore_password: old_passwd,
..
},
..
Expand Down
Loading
Loading