Skip to content

Commit

Permalink
chore: split crate primitives in multiples smaller crates (keep-stark…
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro authored Sep 20, 2023
1 parent da06a2a commit 18683e5
Show file tree
Hide file tree
Showing 102 changed files with 867 additions and 617 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
as source of data in the client
- perf: use perfect hash function in calculate_l1_gas_by_vm_usage
- chore: add tests for tx hashing
- split `primitives` crates into multiple smaller crates

## v0.2.0

Expand Down
148 changes: 128 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ members = [
"crates/node",
"crates/runtime",
"crates/pallets/starknet",
"crates/primitives/starknet",
"crates/primitives/digest-log",
"crates/primitives/transactions",
"crates/primitives/felt",
"crates/primitives/hashers",
"crates/primitives/fee",
"crates/primitives/state",
"crates/primitives/block",
"crates/primitives/sequencer-address",
"crates/primitives/storage",
"crates/primitives/commitments",
"crates/client/block-proposer",
"crates/client/db",
"crates/client/rpc-core",
Expand Down Expand Up @@ -112,8 +120,16 @@ pallet-timestamp = { default-features = false, git = "https://github.com/parityt
pallet-starknet = { path = "crates/pallets/starknet", default-features = false }

# Madara primtitives
mp-starknet = { path = "crates/primitives/starknet", default-features = false }
mp-digest-log = { path = "crates/primitives/digest-log", default-features = false }
mp-block = { path = "crates/primitives/block", default-features = false }
mp-fee = { path = "crates/primitives/fee", default-features = false }
mp-felt = { path = "crates/primitives/felt", default-features = false }
mp-hashers = { path = "crates/primitives/hashers", default-features = false }
mp-sequencer-address = { path = "crates/primitives/sequencer-address", default-features = false }
mp-state = { path = "crates/primitives/state", default-features = false }
mp-storage = { path = "crates/primitives/storage", default-features = false }
mp-transactions = { path = "crates/primitives/transactions", default-features = false }
mp-commitments = { path = "crates/primitives/commitments", default-features = false }

# Madara client
mc-mapping-sync = { path = "crates/client/mapping-sync" }
Expand Down Expand Up @@ -186,3 +202,4 @@ async-trait = "0.1.73"
indexmap = { git = "https://github.com/bluss/indexmap", rev = "ca5f848e10c31e80aeaad0720d14aa2f6dd6cfb1", default-features = false }
num-traits = "0.2.16"
num-bigint = "0.4.4"
phf = { version = "0.11", default-features = false }
4 changes: 3 additions & 1 deletion crates/client/data-availability/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ sp-runtime = { workspace = true }

# Starknet
mc-db = { workspace = true, default-features = true }
mp-starknet = { workspace = true, default-features = true }
starknet_api = { workspace = true, default-features = true }

# Ethereum
Expand All @@ -55,3 +54,6 @@ subxt = "0.29"
# Celestia
celestia-rpc = { git = "https://github.com/eigerco/celestia-node-rs", rev = "bd6394b66b11065c543ab3f19fd66000a72b6236" }
celestia-types = { git = "https://github.com/eigerco/celestia-node-rs", rev = "bd6394b66b11065c543ab3f19fd66000a72b6236" }

# Madara
mp-storage = { workspace = true, default-features = true }
2 changes: 1 addition & 1 deletion crates/client/data-availability/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashMap;

use ethers::types::U256;
use lazy_static::lazy_static;
use mp_starknet::storage::{
use mp_storage::{
PALLET_STARKNET, STARKNET_CONTRACT_CLASS, STARKNET_CONTRACT_CLASS_HASH, STARKNET_NONCE, STARKNET_STORAGE,
};
use sp_io::hashing::twox_128;
Expand Down
3 changes: 2 additions & 1 deletion crates/client/mapping-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ mc-db = { workspace = true }
mc-rpc-core = { workspace = true }
mc-storage = { workspace = true }
mp-digest-log = { workspace = true }
mp-starknet = { workspace = true }
mp-hashers = { workspace = true }
mp-transactions = { workspace = true }
pallet-starknet = { workspace = true }
sc-client-api = { workspace = true }
sp-api = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/client/mapping-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use futures::prelude::*;
use futures::task::{Context, Poll};
use futures_timer::Delay;
use log::debug;
use mp_starknet::traits::hash::HasherT;
use mp_hashers::HasherT;
use pallet_starknet::runtime_api::StarknetRuntimeApi;
use sc_client_api::backend::{Backend, StorageProvider};
use sc_client_api::client::ImportNotifications;
Expand Down
4 changes: 2 additions & 2 deletions crates/client/mapping-sync/src/sync_blocks.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use mc_rpc_core::utils::get_block_by_block_hash;
use mp_digest_log::{find_starknet_block, FindLogError};
use mp_starknet::traits::hash::HasherT;
use mp_starknet::transaction::compute_hash::ComputeTransactionHash;
use mp_hashers::HasherT;
use mp_transactions::compute_hash::ComputeTransactionHash;
use pallet_starknet::runtime_api::StarknetRuntimeApi;
use sc_client_api::backend::{Backend, StorageProvider};
use sp_api::ProvideRuntimeApi;
Expand Down
4 changes: 1 addition & 3 deletions crates/client/rpc-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ jsonrpsee = { workspace = true, features = [
"server",
"macros",
], default-features = true }
mp-block = { workspace = true }
mp-digest-log = { workspace = true }
mp-starknet = { workspace = true, default-features = true, features = [
"serde",
] }
num-bigint = { workspace = true }
serde = { workspace = true, default-features = true }
serde_json = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/client/rpc-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use cairo_lang_starknet::contract_class::{
};
use cairo_lang_starknet::contract_class_into_casm_contract_class::StarknetSierraCompilationError;
use cairo_lang_utils::bigint::BigUintAsHex;
use mp_block::Block as StarknetBlock;
use mp_digest_log::find_starknet_block;
use mp_starknet::block::Block as StarknetBlock;
use num_bigint::{BigInt, BigUint, Sign};
use sp_api::{BlockT, HeaderT};
use sp_blockchain::HeaderBackend;
Expand Down
5 changes: 4 additions & 1 deletion crates/client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mc-db = { workspace = true }
mc-rpc-core = { workspace = true }
mc-storage = { workspace = true }
mc-transaction-pool = { workspace = true }
mp-starknet = { workspace = true, features = ["client"] }
# Substate primitives
frame-support = { workspace = true }
frame-system = { workspace = true }
Expand All @@ -50,6 +49,10 @@ jsonrpsee = { workspace = true, default-features = true, features = [
"macros",
] }
log = { workspace = true, default-features = true }
mp-block = { workspace = true }
mp-felt = { workspace = true }
mp-hashers = { workspace = true }
mp-transactions = { workspace = true, features = ["client"] }
serde_json = { workspace = true, default-features = true }
thiserror = { workspace = true }

Expand Down
Loading

0 comments on commit 18683e5

Please sign in to comment.