Skip to content

Commit 19f9fe0

Browse files
authored
Merge branch 'unstable' into vm-voluntary-exit
2 parents d7421b0 + d74b2d9 commit 19f9fe0

File tree

141 files changed

+2730
-2183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2730
-2183
lines changed

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
env:
16-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
17-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
16+
DOCKER_PASSWORD: ${{ secrets.DH_KEY }}
17+
DOCKER_USERNAME: ${{ secrets.DH_ORG }}
1818
# Enable self-hosted runners for the sigp repo only.
1919
SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/lighthouse' }}
2020

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
env:
13-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
14-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
13+
DOCKER_PASSWORD: ${{ secrets.DH_KEY }}
14+
DOCKER_USERNAME: ${{ secrets.DH_ORG }}
1515
REPO_NAME: ${{ github.repository_owner }}/lighthouse
1616
IMAGE_NAME: ${{ github.repository_owner }}/lighthouse
1717
# Enable self-hosted runners for the sigp repo only.

Cargo.lock

Lines changed: 13 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ tree_hash_derive = "0.8"
201201
url = "2"
202202
uuid = { version = "0.8", features = ["serde", "v4"] }
203203
warp = { version = "0.3.7", default-features = false, features = ["tls"] }
204-
zeroize = { version = "1", features = ["zeroize_derive"] }
204+
zeroize = { version = "1", features = ["zeroize_derive", "serde"] }
205205
zip = "0.6"
206206

207207
# Local crates.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ test-full: cargo-fmt test-release test-debug test-ef test-exec-engine
204204
# Lints the code for bad style and potentially unsafe arithmetic using Clippy.
205205
# Clippy lints are opt-in per-crate for now. By default, everything is allowed except for performance and correctness lints.
206206
lint:
207-
cargo clippy --workspace --benches --tests $(EXTRA_CLIPPY_OPTS) --features "$(TEST_FEATURES)" -- \
207+
RUSTFLAGS="-C debug-assertions=no $(RUSTFLAGS)" cargo clippy --workspace --benches --tests $(EXTRA_CLIPPY_OPTS) --features "$(TEST_FEATURES)" -- \
208208
-D clippy::fn_to_numeric_cast_any \
209209
-D clippy::manual_let_else \
210210
-D clippy::large_stack_frames \

account_manager/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ safe_arith = { workspace = true }
2727
slot_clock = { workspace = true }
2828
filesystem = { workspace = true }
2929
sensitive_url = { workspace = true }
30+
zeroize = { workspace = true }
3031

3132
[dev-dependencies]
3233
tempfile = { workspace = true }

account_manager/src/validator/create.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pub fn read_wallet_password_from_cli(
294294
eprintln!();
295295
eprintln!("{}", WALLET_PASSWORD_PROMPT);
296296
let password =
297-
PlainText::from(read_password_from_user(stdin_inputs)?.as_ref().to_vec());
297+
PlainText::from(read_password_from_user(stdin_inputs)?.as_bytes().to_vec());
298298
Ok(password)
299299
}
300300
}

account_manager/src/validator/exit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,6 @@ mod tests {
409409
)
410410
.unwrap();
411411

412-
assert_eq!(expected_pk, kp.pk.into());
412+
assert_eq!(expected_pk, kp.pk);
413413
}
414414
}

account_manager/src/validator/import.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use account_utils::{
77
recursively_find_voting_keystores, PasswordStorage, ValidatorDefinition,
88
ValidatorDefinitions, CONFIG_FILENAME,
99
},
10-
ZeroizeString, STDIN_INPUTS_FLAG,
10+
STDIN_INPUTS_FLAG,
1111
};
1212
use clap::{Arg, ArgAction, ArgMatches, Command};
1313
use clap_utils::FLAG_HEADER;
@@ -16,6 +16,7 @@ use std::fs;
1616
use std::path::PathBuf;
1717
use std::thread::sleep;
1818
use std::time::Duration;
19+
use zeroize::Zeroizing;
1920

2021
pub const CMD: &str = "import";
2122
pub const KEYSTORE_FLAG: &str = "keystore";
@@ -148,7 +149,7 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
148149
// Skip keystores that already exist, but exit early if any operation fails.
149150
// Reuses the same password for all keystores if the `REUSE_PASSWORD_FLAG` flag is set.
150151
let mut num_imported_keystores = 0;
151-
let mut previous_password: Option<ZeroizeString> = None;
152+
let mut previous_password: Option<Zeroizing<String>> = None;
152153

153154
for src_keystore in &keystore_paths {
154155
let keystore = Keystore::from_json_file(src_keystore)
@@ -182,14 +183,17 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
182183

183184
let password = match keystore_password_path.as_ref() {
184185
Some(path) => {
185-
let password_from_file: ZeroizeString = fs::read_to_string(path)
186+
let password_from_file: Zeroizing<String> = fs::read_to_string(path)
186187
.map_err(|e| format!("Unable to read {:?}: {:?}", path, e))?
187188
.into();
188-
password_from_file.without_newlines()
189+
password_from_file
190+
.trim_end_matches(['\r', '\n'])
191+
.to_string()
192+
.into()
189193
}
190194
None => {
191195
let password_from_user = read_password_from_user(stdin_inputs)?;
192-
if password_from_user.as_ref().is_empty() {
196+
if password_from_user.is_empty() {
193197
eprintln!("Continuing without password.");
194198
sleep(Duration::from_secs(1)); // Provides nicer UX.
195199
break None;
@@ -314,7 +318,7 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
314318
/// Otherwise, returns the keystore error.
315319
fn check_password_on_keystore(
316320
keystore: &Keystore,
317-
password: &ZeroizeString,
321+
password: &Zeroizing<String>,
318322
) -> Result<bool, String> {
319323
match keystore.decrypt_keypair(password.as_ref()) {
320324
Ok(_) => {

account_manager/src/wallet/create.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ pub fn read_new_wallet_password_from_cli(
226226
eprintln!();
227227
eprintln!("{}", NEW_WALLET_PASSWORD_PROMPT);
228228
let password =
229-
PlainText::from(read_password_from_user(stdin_inputs)?.as_ref().to_vec());
229+
PlainText::from(read_password_from_user(stdin_inputs)?.as_bytes().to_vec());
230230

231231
// Ensure the password meets the minimum requirements.
232232
match is_password_sufficiently_complex(password.as_bytes()) {
233233
Ok(_) => {
234234
eprintln!("{}", RETYPE_PASSWORD_PROMPT);
235235
let retyped_password =
236-
PlainText::from(read_password_from_user(stdin_inputs)?.as_ref().to_vec());
236+
PlainText::from(read_password_from_user(stdin_inputs)?.as_bytes().to_vec());
237237
if retyped_password == password {
238238
break Ok(password);
239239
} else {

0 commit comments

Comments
 (0)