Skip to content

Commit a91dd91

Browse files
starknet_committer_and_os_cli: build storage tries concurrently based on py config
1 parent ac85e19 commit a91dd91

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

crates/starknet_committer_and_os_cli/src/committer_cli/parse_input/cast.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ impl TryFrom<RawInput> for CommitterFactsDbInputImpl {
8585
inner_map,
8686
)?;
8787
}
88-
// TODO(Nimrod): Get this by adding a field to `RawInput`.
89-
let build_storage_tries_concurrently = false;
9088
let input = Input {
9189
initial_read_context: FactsDbInitialRead(StateRoots {
9290
contracts_trie_root_hash: HashOutput(Felt::from_bytes_be_slice(
@@ -104,7 +102,7 @@ impl TryFrom<RawInput> for CommitterFactsDbInputImpl {
104102
},
105103
config: ReaderConfig::new(
106104
raw_input.config.warn_on_trivial_modifications,
107-
build_storage_tries_concurrently,
105+
raw_input.config.build_storage_tries_concurrently,
108106
),
109107
};
110108
Ok(Self { input, log_level: raw_input.config.log_level.into(), storage })

crates/starknet_committer_and_os_cli/src/committer_cli/parse_input/raw_input.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub(crate) struct RawStorageEntry {
2424
#[derive(Deserialize, Debug)]
2525
pub(crate) struct RawConfigImpl {
2626
pub warn_on_trivial_modifications: bool,
27+
pub build_storage_tries_concurrently: bool,
2728
pub log_level: PythonLogLevel,
2829
}
2930

crates/starknet_committer_and_os_cli/src/committer_cli/parse_input/read_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn test_simple_input_parsing() {
8787
],
8888
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19],
8989
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
90-
{"warn_on_trivial_modifications": true, "log_level": 5}
90+
{"warn_on_trivial_modifications": true, "build_storage_tries_concurrently": false, "log_level": 5}
9191
]
9292
9393
"#;
@@ -254,7 +254,7 @@ fn test_input_parsing_with_storage_key_duplicate() {
254254
],
255255
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5],
256256
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 3],
257-
{"warn_on_trivial_modifications": true, "log_level": 20}
257+
{"warn_on_trivial_modifications": true, "build_storage_tries_concurrently": false, "log_level": 20}
258258
]
259259
260260
"#;
@@ -296,7 +296,7 @@ fn test_input_parsing_with_mapping_key_duplicate() {
296296
],
297297
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 5],
298298
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 3],
299-
{"warn_on_trivial_modifications": false, "log_level": 30}
299+
{"warn_on_trivial_modifications": false, "build_storage_tries_concurrently": true, "log_level": 30}
300300
]
301301
302302
"#;

0 commit comments

Comments
 (0)