Skip to content
Open
Changes from all commits
Commits
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
20 changes: 13 additions & 7 deletions crates/common/src/config/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ impl PbsMuxes {
mux.validator_pubkeys.extend(extra_keys);
}

ensure!(
!mux.validator_pubkeys.is_empty(),
"mux config {} must have at least one validator pubkey",
mux.id
);
if mux.loader.as_ref().is_none_or(|loader| !loader.refreshing_enabled()) {
ensure!(
!mux.validator_pubkeys.is_empty(),
"mux config {} must have at least one validator pubkey",
mux.id
);
}
}

// check that validator pubkeys are in disjoint sets
Expand Down Expand Up @@ -122,8 +124,8 @@ impl PbsMuxes {
}

// Track registry muxes with refreshing enabled
if let Some(loader) = &mux.loader &&
let MuxKeysLoader::Registry { enable_refreshing: true, .. } = loader
if let Some(loader) = &mux.loader
&& let MuxKeysLoader::Registry { enable_refreshing: true, .. } = loader
{
info!(
"mux {} uses registry loader with dynamic refreshing enabled",
Expand Down Expand Up @@ -273,6 +275,10 @@ impl MuxKeysLoader {
let deduped_keys = remove_duplicate_keys(keys);
Ok(deduped_keys)
}

pub fn refreshing_enabled(&self) -> bool {
matches!(self, Self::Registry { enable_refreshing: true, .. })
}
}

fn load_file<P: AsRef<Path> + std::fmt::Debug>(path: P) -> eyre::Result<String> {
Expand Down