Skip to content

Commit e30cbde

Browse files
committed
Merge branch 'main' into ssz-update-v2
2 parents 3dcc47c + ed4747c commit e30cbde

33 files changed

Lines changed: 983 additions & 128 deletions

Cargo.lock

Lines changed: 106 additions & 0 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ lh_eth2 = { package = "eth2", git = "https://github.com/sigp/lighthouse", tag =
5353
lh_eth2_keystore = { package = "eth2_keystore", git = "https://github.com/sigp/lighthouse", tag = "v8.0.0-rc.0" }
5454
lh_types = { package = "types", git = "https://github.com/sigp/lighthouse", tag = "v8.0.0-rc.0" }
5555
mediatype = "0.20.0"
56+
notify = "8.2.0"
5657
parking_lot = "0.12.3"
5758
pbkdf2 = "0.12.2"
5859
prometheus = "0.14.0"

bin/pbs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ async fn main() -> Result<()> {
2727

2828
let _args = cb_cli::PbsArgs::parse();
2929

30-
let pbs_config = load_pbs_config().await?;
30+
let (pbs_config, config_path) = load_pbs_config(None).await?;
3131

3232
PbsService::init_metrics(pbs_config.chain)?;
33-
let state = PbsState::new(pbs_config);
33+
let state = PbsState::new(pbs_config, config_path);
3434
let server = PbsService::run::<_, DefaultBuilderApi>(state);
3535

3636
tokio::select! {

config.example.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ extra_validation_enabled = false
5555
# Execution Layer RPC url to use for extra validation
5656
# OPTIONAL
5757
# rpc_url = "https://ethereum-holesky-rpc.publicnode.com"
58-
# URL of the SSV API server to use, if you have a mux that targets an SSV node operator
58+
# URL of your local SSV node API endpoint, if you have a mux that targets an SSV node operator
59+
# OPTIONAL, DEFAULT: "http://localhost:16000/v1/"
60+
# ssv_node_api_url = "http://localhost:16000/v1/"
61+
# URL of the public SSV API server, if you have a mux that targets an SSV node operator. This is used as
62+
# a fallback if the user's own SSV node is not reachable.
5963
# OPTIONAL, DEFAULT: "https://api.ssv.network/api/v4/"
60-
# ssv_api_url = "https://api.ssv.network/api/v4/"
64+
# ssv_public_api_url = "https://api.ssv.network/api/v4/"
6165
# Timeout for any HTTP requests sent from the PBS module to other services, in seconds
6266
# OPTIONAL, DEFAULT: 10
6367
http_timeout_seconds = 10

crates/common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ lh_eth2.workspace = true
3232
lh_eth2_keystore.workspace = true
3333
lh_types.workspace = true
3434
mediatype.workspace = true
35+
notify.workspace = true
3536
pbkdf2.workspace = true
3637
rand.workspace = true
3738
rayon.workspace = true

crates/common/src/config/log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct LogsSettings {
1616

1717
impl LogsSettings {
1818
pub fn from_env_config() -> Result<Self> {
19-
let mut config = CommitBoostConfig::from_env_path()?;
19+
let (mut config, _) = CommitBoostConfig::from_env_path()?;
2020

2121
// Override log dir path if env var is set
2222
if let Some(log_dir) = load_optional_env_var(LOGS_DIR_ENV) {

crates/common/src/config/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ impl CommitBoostConfig {
5656
}
5757

5858
pub fn from_file(path: &PathBuf) -> Result<Self> {
59-
let config: Self = load_from_file(path)?;
59+
let (config, _): (Self, _) = load_from_file(path)?;
6060
Ok(config)
6161
}
6262

6363
// When loading the config from the environment, it's important that every path
6464
// is replaced with the correct value if the config is loaded inside a container
65-
pub fn from_env_path() -> Result<Self> {
66-
let helper_config: HelperConfig = load_file_from_env(CONFIG_ENV)?;
65+
pub fn from_env_path() -> Result<(Self, PathBuf)> {
66+
let (helper_config, config_path): (HelperConfig, PathBuf) = load_file_from_env(CONFIG_ENV)?;
6767

6868
let chain = match helper_config.chain {
6969
ChainLoader::Path { path, genesis_time_secs } => {
@@ -109,13 +109,13 @@ impl CommitBoostConfig {
109109
logs: helper_config.logs,
110110
};
111111

112-
Ok(config)
112+
Ok((config, config_path))
113113
}
114114

115115
/// Returns the path to the chain spec file if any
116116
pub fn chain_spec_file(path: &PathBuf) -> Option<PathBuf> {
117117
match load_from_file::<_, ChainConfig>(path) {
118-
Ok(config) => {
118+
Ok((config, _)) => {
119119
if let ChainLoader::Path { path, genesis_time_secs: _ } = config.chain {
120120
Some(path)
121121
} else {

crates/common/src/config/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub fn load_commit_module_config<T: DeserializeOwned>() -> Result<StartCommitMod
8282
}
8383

8484
// load module config including the extra data (if any)
85-
let cb_config: StubConfig<T> = load_file_from_env(CONFIG_ENV)?;
85+
let (cb_config, _): (StubConfig<T>, _) = load_file_from_env(CONFIG_ENV)?;
8686

8787
// find all matching modules config
8888
let matches: Vec<ThisModuleConfig<T>> = cb_config
@@ -148,7 +148,7 @@ pub fn load_builder_module_config<T: DeserializeOwned>() -> eyre::Result<StartBu
148148
}
149149

150150
// load module config including the extra data (if any)
151-
let cb_config: StubConfig<T> = load_file_from_env(CONFIG_ENV)?;
151+
let (cb_config, _): (StubConfig<T>, _) = load_file_from_env(CONFIG_ENV)?;
152152

153153
// find all matching modules config
154154
let matches: Vec<ThisModuleConfig<T>> = cb_config

0 commit comments

Comments
 (0)