Skip to content
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

[Merged by Bors] - Enable Compatibility with Windows #2333

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8fb73f1
Made changes for Windows Compatibility
ethDreamer May 5, 2021
0a796db
Cleaned up command line args for windows
ethDreamer May 5, 2021
7b8748f
Merge branch 'unstable' into windows
ethDreamer May 5, 2021
c401368
Cleaned up formatting
ethDreamer May 5, 2021
6c4fda1
removed forgotten println
ethDreamer May 5, 2021
8f73443
fixed unused import issue
ethDreamer May 5, 2021
1cd6a6f
Fixed clippy complaints
ethDreamer May 5, 2021
138f34a
Fixed formatting again
ethDreamer May 5, 2021
82eed9e
fixed clippy complaints again
ethDreamer May 5, 2021
33b900f
fixed clippy complaints again again
ethDreamer May 5, 2021
669ae04
fixed platform-specific dependencies
ethDreamer May 5, 2021
5df34e3
Fixed Cargo.lock for clippy
ethDreamer May 6, 2021
c8ba601
Use cfg! macro for windows booleans
ethDreamer May 6, 2021
d725a09
use cfg! macro again
ethDreamer May 6, 2021
e39277f
fixed typo
ethDreamer May 6, 2021
749ea97
Tests *should* complete in windows now
ethDreamer May 7, 2021
ab775ee
Ran cargo fmt
ethDreamer May 7, 2021
4a1e251
cargo test --all --release now succeeds on windows
ethDreamer May 10, 2021
d7ffcda
forgot to run cargo fmt >.<
ethDreamer May 10, 2021
c6f9e79
clippy again..
ethDreamer May 10, 2021
7d7ffa1
Merge upstream/unstable into windows
ethDreamer May 12, 2021
b8b04b6
Made changes requested by msproul
ethDreamer May 12, 2021
c20a63d
Fix some compilation errors/quirks
michaelsproul May 13, 2021
f3d48b9
Fix typo, check for tempdir cleanup
michaelsproul May 13, 2021
4f3ef51
First go at Windows CI
michaelsproul May 13, 2021
2f41852
Cargo fmt
michaelsproul May 13, 2021
0ec467e
Smaller DB for slasher tests
michaelsproul May 13, 2021
c30b155
No sudo on Windows oops
michaelsproul May 13, 2021
18603c9
forgot one of the tests needs testing config
ethDreamer May 13, 2021
d23e695
Updated lighthouse book & fixed slasher cli tests
ethDreamer May 18, 2021
5124fa6
Windows shell is so weird.. works in both now
ethDreamer May 19, 2021
96d5c07
Update book/src/slasher.md
ethDreamer May 19, 2021
339c25b
made requested changes to lighthouse book
ethDreamer May 19, 2021
80360b8
Forgot to use const for OWNER_SID_STR
ethDreamer May 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 90 additions & 6 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions account_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ slashing_protection = { path = "../validator_client/slashing_protection" }
eth2 = {path = "../common/eth2"}
safe_arith = {path = "../consensus/safe_arith"}
slot_clock = { path = "../common/slot_clock" }
filesystem = { path = "../common/filesystem" }
sensitive_url = { path = "../common/sensitive_url" }

[dev-dependencies]
Expand Down
12 changes: 12 additions & 0 deletions account_manager/src/validator/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub const AT_MOST_FLAG: &str = "at-most";
pub const WALLET_PASSWORD_PROMPT: &str = "Enter your wallet's password:";

pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
#[cfg(unix)]
let windows = false;
#[cfg(windows)]
let windows = true;
ethDreamer marked this conversation as resolved.
Show resolved Hide resolved

App::new(CMD)
.about(
"Creates new validators from an existing EIP-2386 wallet using the EIP-2333 HD key \
Expand Down Expand Up @@ -105,6 +110,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
)
.arg(
Arg::with_name(STDIN_INPUTS_FLAG)
.takes_value(false)
.hidden(windows)
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
)
Expand All @@ -118,7 +125,12 @@ pub fn cli_run<T: EthSpec>(
let spec = env.core_context().eth2_config.spec;

let name: Option<String> = clap_utils::parse_optional(matches, WALLET_NAME_FLAG)?;

#[cfg(unix)]
let stdin_inputs = matches.is_present(STDIN_INPUTS_FLAG);
#[cfg(windows)]
let stdin_inputs = true;

let wallet_base_dir = if matches.value_of("datadir").is_some() {
let path: PathBuf = clap_utils::parse_required(matches, "datadir")?;
path.join(DEFAULT_WALLET_DIR)
Expand Down
12 changes: 12 additions & 0 deletions account_manager/src/validator/exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ pub const WEBSITE_URL: &str = "https://lighthouse-book.sigmaprime.io/voluntary-e
pub const PROMPT: &str = "WARNING: WITHDRAWING STAKED ETH IS NOT CURRENTLY POSSIBLE";

pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
#[cfg(unix)]
let windows = false;
#[cfg(windows)]
let windows = true;

App::new("exit")
.about("Submits a VoluntaryExit to the beacon chain for a given validator keystore.")
.arg(
Expand Down Expand Up @@ -61,6 +66,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
)
.arg(
Arg::with_name(STDIN_INPUTS_FLAG)
.takes_value(false)
.hidden(windows)
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
)
Expand All @@ -70,7 +77,12 @@ pub fn cli_run<E: EthSpec>(matches: &ArgMatches, env: Environment<E>) -> Result<
let keystore_path: PathBuf = clap_utils::parse_required(matches, KEYSTORE_FLAG)?;
let password_file_path: Option<PathBuf> =
clap_utils::parse_optional(matches, PASSWORD_FILE_FLAG)?;

#[cfg(unix)]
let stdin_inputs = matches.is_present(STDIN_INPUTS_FLAG);
#[cfg(windows)]
let stdin_inputs = true;

let no_wait = matches.is_present(NO_WAIT);

let spec = env.eth2_config().spec.clone();
Expand Down
10 changes: 10 additions & 0 deletions account_manager/src/validator/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ pub const KEYSTORE_REUSE_WARNING: &str = "DO NOT USE THE ORIGINAL KEYSTORES TO V
ANOTHER CLIENT, OR YOU WILL GET SLASHED.";

pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
#[cfg(unix)]
let windows = false;
#[cfg(windows)]
let windows = true;

App::new(CMD)
.about(
"Imports one or more EIP-2335 passwords into a Lighthouse VC directory, \
Expand Down Expand Up @@ -57,6 +62,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
)
.arg(
Arg::with_name(STDIN_INPUTS_FLAG)
.takes_value(false)
.hidden(windows)
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
)
Expand All @@ -83,7 +90,10 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), String> {
let keystore: Option<PathBuf> = clap_utils::parse_optional(matches, KEYSTORE_FLAG)?;
let keystores_dir: Option<PathBuf> = clap_utils::parse_optional(matches, DIR_FLAG)?;
#[cfg(unix)]
let stdin_inputs = matches.is_present(STDIN_INPUTS_FLAG);
#[cfg(windows)]
let stdin_inputs = true;
let reuse_password = matches.is_present(REUSE_PASSWORD_FLAG);
let keystore_password_path: Option<PathBuf> =
clap_utils::parse_optional(matches, PASSWORD_FLAG)?;
Expand Down
10 changes: 10 additions & 0 deletions account_manager/src/validator/recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ pub const FIRST_INDEX_FLAG: &str = "first-index";
pub const MNEMONIC_FLAG: &str = "mnemonic-path";

pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
#[cfg(unix)]
let windows = false;
#[cfg(windows)]
let windows = true;

App::new(CMD)
.about(
"Recovers validator private keys given a BIP-39 mnemonic phrase. \
Expand Down Expand Up @@ -71,6 +76,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
)
.arg(
Arg::with_name(STDIN_INPUTS_FLAG)
.takes_value(false)
.hidden(windows)
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
)
Expand All @@ -86,7 +93,10 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
let first_index: u32 = clap_utils::parse_required(matches, FIRST_INDEX_FLAG)?;
let count: u32 = clap_utils::parse_required(matches, COUNT_FLAG)?;
let mnemonic_path: Option<PathBuf> = clap_utils::parse_optional(matches, MNEMONIC_FLAG)?;
#[cfg(unix)]
let stdin_inputs = matches.is_present(STDIN_INPUTS_FLAG);
#[cfg(windows)]
let stdin_inputs = true;

eprintln!("secrets-dir path: {:?}", secrets_dir);

Expand Down
Loading