mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
Merge branch 'stable' into validator-manager
This commit is contained in:
@@ -27,6 +27,7 @@ use std::io::{self, Read};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use types::graffiti::GraffitiString;
|
||||
use types::{Address, Graffiti, Keypair, PublicKey, PublicKeyBytes};
|
||||
use url::{ParseError, Url};
|
||||
use validator_dir::Builder as ValidatorDirBuilder;
|
||||
@@ -154,6 +155,10 @@ impl InitializedValidator {
|
||||
pub fn get_index(&self) -> Option<u64> {
|
||||
self.index
|
||||
}
|
||||
|
||||
pub fn get_graffiti(&self) -> Option<Graffiti> {
|
||||
self.graffiti
|
||||
}
|
||||
}
|
||||
|
||||
fn open_keystore(path: &Path) -> Result<Keystore, Error> {
|
||||
@@ -697,8 +702,8 @@ impl InitializedValidators {
|
||||
self.validators.get(public_key)
|
||||
}
|
||||
|
||||
/// Sets the `InitializedValidator` and `ValidatorDefinition` `enabled`, `gas_limit`, and `builder_proposals`
|
||||
/// values.
|
||||
/// Sets the `InitializedValidator` and `ValidatorDefinition` `enabled`, `gas_limit`,
|
||||
/// `builder_proposals`, and `graffiti` values.
|
||||
///
|
||||
/// ## Notes
|
||||
///
|
||||
@@ -708,7 +713,7 @@ impl InitializedValidators {
|
||||
///
|
||||
/// If a `gas_limit` is included in the call to this function, it will also be updated and saved
|
||||
/// to disk. If `gas_limit` is `None` the `gas_limit` *will not* be unset in `ValidatorDefinition`
|
||||
/// or `InitializedValidator`. The same logic applies to `builder_proposals`.
|
||||
/// or `InitializedValidator`. The same logic applies to `builder_proposals` and `graffiti`.
|
||||
///
|
||||
/// Saves the `ValidatorDefinitions` to file, even if no definitions were changed.
|
||||
pub async fn set_validator_definition_fields(
|
||||
@@ -717,6 +722,7 @@ impl InitializedValidators {
|
||||
enabled: Option<bool>,
|
||||
gas_limit: Option<u64>,
|
||||
builder_proposals: Option<bool>,
|
||||
graffiti: Option<GraffitiString>,
|
||||
) -> Result<(), Error> {
|
||||
if let Some(def) = self
|
||||
.definitions
|
||||
@@ -734,6 +740,9 @@ impl InitializedValidators {
|
||||
if let Some(builder_proposals) = builder_proposals {
|
||||
def.builder_proposals = Some(builder_proposals);
|
||||
}
|
||||
if let Some(graffiti) = graffiti.clone() {
|
||||
def.graffiti = Some(graffiti);
|
||||
}
|
||||
}
|
||||
|
||||
self.update_validators().await?;
|
||||
@@ -749,6 +758,9 @@ impl InitializedValidators {
|
||||
if let Some(builder_proposals) = builder_proposals {
|
||||
val.builder_proposals = Some(builder_proposals);
|
||||
}
|
||||
if let Some(graffiti) = graffiti {
|
||||
val.graffiti = Some(graffiti.into());
|
||||
}
|
||||
}
|
||||
|
||||
self.definitions
|
||||
|
||||
Reference in New Issue
Block a user