Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/starknet_committer/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub mod create_facts_tree;
#[cfg(any(feature = "testing", test))]
pub mod external_test_utils;
pub mod facts_db;
pub mod forest_trait;
pub mod traversal;
2 changes: 1 addition & 1 deletion crates/starknet_committer/src/db/external_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use starknet_patricia::patricia_merkle_tree::updated_skeleton_tree::tree::{
};
use starknet_patricia_storage::map_storage::MapStorage;

use crate::db::create_facts_tree::create_original_skeleton_tree;
use crate::db::facts_db::create_facts_tree::create_original_skeleton_tree;

pub async fn tree_computation_flow<L, TH>(
leaf_modifications: LeafModifications<L>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use starknet_patricia::patricia_merkle_tree::types::{NodeIndex, SortedLeafIndice
use starknet_patricia_storage::storage_trait::Storage;
use tracing::warn;

use crate::db::traversal::calculate_subtrees_roots;
use crate::db::facts_db::traversal::calculate_subtrees_roots;

#[cfg(test)]
#[path = "create_facts_tree_test.rs"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use starknet_patricia_storage::map_storage::MapStorage;
use starknet_patricia_storage::storage_trait::{DbHashMap, DbKey, DbValue};
use starknet_types_core::felt::Felt;

use crate::db::create_facts_tree::create_original_skeleton_tree;
use crate::db::facts_db::create_facts_tree::create_original_skeleton_tree;

#[tokio::test]
#[rstest]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::block_committer::input::{
ConfigImpl,
StarknetStorageValue,
};
use crate::db::create_facts_tree::{
use crate::db::facts_db::create_facts_tree::{
create_original_skeleton_tree,
create_original_skeleton_tree_and_get_previous_leaves,
};
Expand Down
4 changes: 4 additions & 0 deletions crates/starknet_committer/src/db/facts_db/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod create_facts_tree;
// TODO(Ariel): Move db.rs to this module and avoid db::fact_db::db path..
pub mod db;
pub mod traversal;
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use starknet_patricia_storage::storage_trait::{DbHashMap, DbKey, DbValue};
use starknet_types_core::felt::Felt;
use starknet_types_core::hash::Pedersen;

use super::fetch_patricia_paths_inner;
use crate::db::facts_db::traversal::fetch_patricia_paths_inner;

fn to_preimage_map(raw_preimages: HashMap<u32, Vec<u32>>) -> PreimageMap {
raw_preimages
Expand Down Expand Up @@ -514,10 +514,10 @@ struct TestPatriciaPathsInput {
/// The files names indicate the tree height, number of initial leaves and number of modified
/// leaves. The hash function used in the python tests is Pedersen.
/// The leaves values are their NodeIndices.
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_200_50.json"))]
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_5_2.json"))]
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_100_30.json"))]
#[case(include_str!("../../resources/fetch_patricia_paths_test_8_120_70.json"))]
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_200_50.json"))]
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_5_2.json"))]
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_100_30.json"))]
#[case(include_str!("../../../resources/fetch_patricia_paths_test_8_120_70.json"))]
async fn test_fetch_patricia_paths_inner_from_json(#[case] input_data: &str) {
let input: TestPatriciaPathsInput = serde_json::from_str(input_data)
.unwrap_or_else(|error| panic!("JSON was not well-formatted: {error:?}"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::block_committer::input::{
StarknetStorageValue,
StateDiff,
};
use crate::db::facts_db::FactsDb;
use crate::db::facts_db::db::FactsDb;
use crate::db::forest_trait::ForestReader;
use crate::forest::original_skeleton_forest::{ForestSortedIndices, OriginalSkeletonForest};
use crate::patricia_merkle_tree::leaf::leaf_impl::ContractState;
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_committer/src/patricia_merkle_tree/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::block_committer::input::{
StarknetStorageKey,
StarknetStorageValue,
};
use crate::db::traversal::fetch_patricia_paths;
use crate::db::facts_db::traversal::fetch_patricia_paths;
use crate::patricia_merkle_tree::leaf::leaf_impl::ContractState;
use crate::patricia_merkle_tree::types::{
class_hash_into_node_index,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use starknet_committer::block_committer::commit::commit_block;
use starknet_committer::block_committer::input::Config;
use starknet_committer::db::facts_db::FactsDb;
use starknet_committer::db::facts_db::db::FactsDb;
use starknet_patricia_storage::map_storage::MapStorage;
use tracing::info;
use tracing::level_filters::LevelFilter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::Serialize;
use starknet_committer::db::facts_db::FactsDb;
use starknet_committer::db::facts_db::db::FactsDb;
use starknet_committer::db::forest_trait::ForestWriter;
use starknet_committer::forest::filled_forest::FilledForest;
use starknet_patricia_storage::map_storage::MapStorage;
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_committer_cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use starknet_committer::block_committer::input::{
};
use starknet_committer::block_committer::state_diff_generator::generate_random_state_diff;
use starknet_committer::block_committer::timing_util::{Action, TimeMeasurement};
use starknet_committer::db::facts_db::FactsDb;
use starknet_committer::db::facts_db::db::FactsDb;
use starknet_committer::db::forest_trait::ForestWriter;
use starknet_patricia_storage::storage_trait::{AsyncStorage, DbKey, Storage, StorageStats};
use starknet_types_core::felt::Felt;
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_os_flow_tests/src/initial_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use starknet_api::transaction::constants::DEPLOY_CONTRACT_FUNCTION_ENTRY_POINT_N
use starknet_api::transaction::fields::{Calldata, ContractAddressSalt, ValidResourceBounds};
use starknet_api::{calldata, deploy_account_tx_args, invoke_tx_args};
use starknet_committer::block_committer::input::StateDiff;
use starknet_committer::db::facts_db::FactsDb;
use starknet_committer::db::facts_db::db::FactsDb;
use starknet_patricia_storage::map_storage::MapStorage;
use starknet_types_core::felt::Felt;

Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_os_flow_tests/src/test_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use starknet_committer::block_committer::input::{
StarknetStorageValue,
StateDiff,
};
use starknet_committer::db::facts_db::FactsDb;
use starknet_committer::db::facts_db::db::FactsDb;
use starknet_os::hints::enum_definition::AllHints;
use starknet_os::hints::hint_implementation::state_diff_encryption::utils::compute_public_keys;
use starknet_os::io::os_input::{
Expand Down
4 changes: 2 additions & 2 deletions crates/starknet_os_flow_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ use starknet_committer::block_committer::input::{
StarknetStorageValue,
StateDiff,
};
use starknet_committer::db::create_facts_tree::get_leaves;
use starknet_committer::db::facts_db::FactsDb;
use starknet_committer::db::facts_db::create_facts_tree::get_leaves;
use starknet_committer::db::facts_db::db::FactsDb;
use starknet_committer::patricia_merkle_tree::leaf::leaf_impl::ContractState;
use starknet_committer::patricia_merkle_tree::tree::fetch_previous_and_new_patricia_paths;
use starknet_committer::patricia_merkle_tree::types::{
Expand Down
Loading