feat: forbid running mixnode + entry on the same node (#5878)

This commit is contained in:
Jędrzej Stuczyński
2025-07-09 08:59:55 +01:00
committed by GitHub
parent 812a8782b4
commit 2f5e8e0bcd
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -78,6 +78,7 @@ pub(crate) async fn execute(mut args: Args) -> Result<(), NymNodeError> {
}
config
};
config.validate()?;
if !config.modes.any_enabled() {
warn!("this node is going to run without mixnode or gateway support! consider providing `mode` value");
+7
View File
@@ -426,6 +426,13 @@ impl Config {
pub fn validate(&self) -> Result<(), NymNodeError> {
self.mixnet.validate()?;
// it's not allowed to run mixnode mode alongside entry mode
if self.modes.mixnode && self.modes.entry {
return Err(NymNodeError::config_validation_failure(
"illegal modes configuration - node cannot run as a mixnode and an entry gateway",
));
}
Ok(())
}
}