-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Node Startup Config] Add new config to skip sanitizer/optimizer.
- Loading branch information
Showing
5 changed files
with
127 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize)] | ||
#[serde(default, deny_unknown_fields)] | ||
pub struct NodeStartupConfig { | ||
pub skip_config_optimizer: bool, // Whether or not to skip the config optimizer at startup | ||
pub skip_config_sanitizer: bool, // Whether or not to skip the config sanitizer at startup | ||
} | ||
|
||
#[allow(clippy::derivable_impls)] // Derive default manually (this is safer than guessing defaults) | ||
impl Default for NodeStartupConfig { | ||
fn default() -> Self { | ||
Self { | ||
skip_config_optimizer: false, | ||
skip_config_sanitizer: false, | ||
} | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_node_startup_config_default() { | ||
// Create the default config | ||
let config = NodeStartupConfig::default(); | ||
|
||
// Verify both fields are set to false | ||
assert!(!config.skip_config_optimizer); | ||
assert!(!config.skip_config_sanitizer); | ||
} | ||
} |