feat: forbid running mixnode + entry on the same node (#5878)
This commit is contained in:
committed by
GitHub
parent
812a8782b4
commit
2f5e8e0bcd
@@ -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");
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user