mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
VC: accept unknown fields in chain spec (#2277)
## Issue Addressed Closes #2274 ## Proposed Changes * Modify the `YamlConfig` to collect unknown fields into an `extra_fields` map, instead of failing hard. * Log a debug message if there are extra fields returned to the VC from one of its BNs. This restores Lighthouse's compatibility with Teku beacon nodes (and therefore Infura)
This commit is contained in:
@@ -89,7 +89,7 @@ impl ValidatorDir {
|
||||
}
|
||||
|
||||
/// Returns the `dir` provided to `Self::open`.
|
||||
pub fn dir(&self) -> &PathBuf {
|
||||
pub fn dir(&self) -> &Path {
|
||||
&self.dir
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ impl ValidatorDir {
|
||||
|
||||
/// Attempts to load and decrypt a Keypair given path to the keystore.
|
||||
pub fn unlock_keypair<P: AsRef<Path>>(
|
||||
keystore_path: &PathBuf,
|
||||
keystore_path: &Path,
|
||||
password_dir: P,
|
||||
) -> Result<Keypair, Error> {
|
||||
let keystore = Keystore::from_json_reader(
|
||||
@@ -229,8 +229,8 @@ pub fn unlock_keypair<P: AsRef<Path>>(
|
||||
|
||||
/// Attempts to load and decrypt a Keypair given path to the keystore and the password file.
|
||||
pub fn unlock_keypair_from_password_path(
|
||||
keystore_path: &PathBuf,
|
||||
password_path: &PathBuf,
|
||||
keystore_path: &Path,
|
||||
password_path: &Path,
|
||||
) -> Result<Keypair, Error> {
|
||||
let keystore = Keystore::from_json_reader(
|
||||
&mut OpenOptions::new()
|
||||
@@ -242,7 +242,7 @@ pub fn unlock_keypair_from_password_path(
|
||||
.map_err(Error::UnableToReadKeystore)?;
|
||||
|
||||
let password: PlainText = read(password_path)
|
||||
.map_err(|_| Error::UnableToReadPassword(password_path.clone()))?
|
||||
.map_err(|_| Error::UnableToReadPassword(password_path.into()))?
|
||||
.into();
|
||||
keystore
|
||||
.decrypt_keypair(password.as_bytes())
|
||||
|
||||
Reference in New Issue
Block a user