-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create dump_config for mempool node config
- Loading branch information
1 parent
43fc7d4
commit 3399d1a
Showing
10 changed files
with
241 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,42 @@ | ||
{ | ||
"components.gateway_component.execute": { | ||
"description": "The component execution flag.", | ||
"privacy": "Public", | ||
"value": true | ||
}, | ||
"components.mempool_component.execute": { | ||
"description": "The component execution flag.", | ||
"privacy": "Public", | ||
"value": true | ||
}, | ||
"gateway_config.network_config.ip": { | ||
"description": "The gateway server ip.", | ||
"privacy": "Public", | ||
"value": "0.0.0.0" | ||
}, | ||
"gateway_config.network_config.port": { | ||
"description": "The gateway server port.", | ||
"privacy": "Public", | ||
"value": 8080 | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.max_calldata_length": { | ||
"description": "Validates that a transaction has signature length less than or equal to this value.", | ||
"privacy": "Public", | ||
"value": 0 | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.max_signature_length": { | ||
"description": "Validates that a transaction has calldata length less than or equal to this value.", | ||
"privacy": "Public", | ||
"value": 0 | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.validate_non_zero_l1_gas_fee": { | ||
"description": "If true, validates that a transaction has non-zero L1 resource bounds.", | ||
"privacy": "Public", | ||
"value": false | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.validate_non_zero_l2_gas_fee": { | ||
"description": "If true, validates that a transaction has non-zero L2 resource bounds.", | ||
"privacy": "Public", | ||
"value": false | ||
} | ||
} |
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,10 @@ | ||
use mempool_node::config::{MempoolNodeConfig, DEFAULT_CONFIG_PATH}; | ||
use papyrus_config::dumping::SerializeConfig; | ||
|
||
/// Updates the default config file by: | ||
/// cargo run --bin dump_config -q | ||
fn main() { | ||
MempoolNodeConfig::default() | ||
.dump_to_file(&vec![], DEFAULT_CONFIG_PATH) | ||
.expect("dump to file error"); | ||
} |
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
52 changes: 52 additions & 0 deletions
52
...ool_node/src/config/snapshots/mempool_node__config__config_test__dump_default_config.snap
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,52 @@ | ||
--- | ||
source: crates/mempool_node/src/config/config_test.rs | ||
expression: dumped_default_config | ||
--- | ||
{ | ||
"components.gateway_component.execute": { | ||
"description": "The component execution flag.", | ||
"value": true, | ||
"privacy": "Public" | ||
}, | ||
"components.mempool_component.execute": { | ||
"description": "The component execution flag.", | ||
"value": true, | ||
"privacy": "Public" | ||
}, | ||
"gateway_config.network_config.ip": { | ||
"description": "The gateway server ip.", | ||
"value": "0.0.0.0", | ||
"privacy": "Public" | ||
}, | ||
"gateway_config.network_config.port": { | ||
"description": "The gateway server port.", | ||
"value": { | ||
"$serde_json::private::Number": "8080" | ||
}, | ||
"privacy": "Public" | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.max_calldata_length": { | ||
"description": "Validates that a transaction has signature length less than or equal to this value.", | ||
"value": { | ||
"$serde_json::private::Number": "0" | ||
}, | ||
"privacy": "Public" | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.max_signature_length": { | ||
"description": "Validates that a transaction has calldata length less than or equal to this value.", | ||
"value": { | ||
"$serde_json::private::Number": "0" | ||
}, | ||
"privacy": "Public" | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.validate_non_zero_l1_gas_fee": { | ||
"description": "If true, validates that a transaction has non-zero L1 resource bounds.", | ||
"value": false, | ||
"privacy": "Public" | ||
}, | ||
"gateway_config.stateless_transaction_validator_config.validate_non_zero_l2_gas_fee": { | ||
"description": "If true, validates that a transaction has non-zero L2 resource bounds.", | ||
"value": false, | ||
"privacy": "Public" | ||
} | ||
} |
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,12 @@ | ||
[package] | ||
name = "test_utils" | ||
version.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
license.workspace = true | ||
|
||
[features] | ||
|
||
[dependencies] | ||
|
||
|
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,7 @@ | ||
use std::env; | ||
use std::path::{Path, PathBuf}; | ||
|
||
/// Returns the absolute path from the project root. | ||
pub fn get_absolute_path(relative_path: &str) -> PathBuf { | ||
Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("../..").join(relative_path) | ||
} |