diff --git a/CHANGELOG.md b/CHANGELOG.md index b834751d55..51a1483d1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ git # Madara Changelog ## Next release -- feat(script): added CI scripts for starting Deoxys and comparing JSON RPC calls +- feat(script): added CI scripts for starting Deoxys and comparing JSON RPC + calls - perf(verify_l2): parallelized l2 state root update - perf(state_commitment): parallelized state commitment hash computations - fix(L1): fix l1 thread with battle tested implementation + removed l1-l2 diff --git a/Cargo.toml b/Cargo.toml index 17bdaf323d..7b2e7e3f93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -294,7 +294,7 @@ cairo-lang-utils = { git = "https://github.com/keep-starknet-strange/cairo.git", ] } # Ethers: using the same versions as in Anvil -ethers = { git = "https://github.com/gakonst/ethers-rs"} +ethers = { git = "https://github.com/gakonst/ethers-rs" } # Zaun starknet-core-contract-client = { git = "https://github.com/keep-starknet-strange/zaun" } diff --git a/crates/client/db/Cargo.toml b/crates/client/db/Cargo.toml index 4afd997f16..259b96404d 100644 --- a/crates/client/db/Cargo.toml +++ b/crates/client/db/Cargo.toml @@ -16,7 +16,9 @@ repository = "https://github.com/keep-starknet-strange/madara" targets = ["x86_64-unknown-linux-gnu"] [dependencies] +bonsai-trie = { workspace = true } ethers = { workspace = true } +kvdb = "0.13.0" kvdb-rocksdb = { version = "0.19.0", optional = true } log = { workspace = true, default-features = true } parity-db = { version = "0.4.12", optional = true } @@ -32,8 +34,6 @@ starknet_api = { workspace = true, default-features = true, features = [ ] } thiserror = { workspace = true } uuid = "1.4.1" -bonsai-trie = { workspace = true } -kvdb = "0.13.0" [features] default = ["kvdb-rocksdb", "parity-db"] diff --git a/crates/client/deoxys/Cargo.toml b/crates/client/deoxys/Cargo.toml index de23a0951c..748fa11511 100644 --- a/crates/client/deoxys/Cargo.toml +++ b/crates/client/deoxys/Cargo.toml @@ -18,16 +18,17 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] anyhow = "1.0.75" +ethers = { workspace = true } lazy_static = "1.4.0" reqwest = "0.11" serde_json = "1" tokio-tungstenite = "0.20.1" -ethers = { workspace = true } blockifier = { workspace = true, default-features = false, features = [ "testing", ] } +crossbeam-skiplist = { workspace = true } env_logger = "0.10.0" futures = { workspace = true, default-features = true } hex = "0.4" @@ -35,14 +36,13 @@ indexmap = { workspace = true } itertools = { workspace = true } log = { version = "0.4.14" } mockito = { workspace = true } +primitive-types = { version = "0.12.2" } rand = { version = "0.8.5" } -primitive-types = { version = "0.12.2"} rodio = { version = "0.17", optional = true } serde = { workspace = true, default-features = true } tokio = { workspace = true, features = ["macros", "parking_lot", "test-util"] } url = { workspace = true } validator = { workspace = true, features = ["derive"] } -crossbeam-skiplist ={ workspace = true } madara-runtime = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive"] } @@ -60,7 +60,10 @@ sc-service = { workspace = true } sp-core = { workspace = true, features = ["std"] } sp-runtime = { workspace = true } +bitvec = "1.0.1" +bonsai-trie = { workspace = true } mc-commitment-state-diff = { workspace = true } +mc-db = { workspace = true } mc-rpc-core = { workspace = true } mc-storage = { workspace = true } mp-block = { workspace = true } @@ -70,13 +73,10 @@ mp-felt = { workspace = true } mp-hashers = { workspace = true } mp-storage = { workspace = true, default-features = true } mp-transactions = { workspace = true, features = ["client"] } -mc-db = { workspace = true } -bonsai-trie = { workspace = true } starknet-types-core = { workspace = true, default-features = false, features = [ - "hash", - "parity-scale-codec", + "hash", + "parity-scale-codec", ] } -bitvec = "1.0.1" [dev-dependencies] # test_utils = { path = "./test_utils" } diff --git a/crates/client/rpc/Cargo.toml b/crates/client/rpc/Cargo.toml index 64a77c80d7..b3476875d0 100644 --- a/crates/client/rpc/Cargo.toml +++ b/crates/client/rpc/Cargo.toml @@ -12,8 +12,8 @@ publish = false repository = "https://github.com/keep-starknet-strange/madara" version.workspace = true - [package.metadata.docs.rs] - targets = ["x86_64-unknown-linux-gnu"] +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] # Madara utils diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index d14692da2c..c8e00140ef 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -14,8 +14,8 @@ publish = false repository = "https://github.com/kasarlabs/deoxys" version.workspace = true - [package.metadata.docs.rs] - targets = ["x86_64-unknown-linux-gnu"] +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [[bin]] name = "deoxys" diff --git a/crates/pallets/starknet/Cargo.toml b/crates/pallets/starknet/Cargo.toml index f8a2a2ce03..19285fdc00 100644 --- a/crates/pallets/starknet/Cargo.toml +++ b/crates/pallets/starknet/Cargo.toml @@ -9,8 +9,8 @@ publish = false repository = "https://github.com/keep-starknet-strange/madara" version.workspace = true - [package.metadata.docs.rs] - targets = ["x86_64-unknown-linux-gnu"] +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] # Madara primitives diff --git a/crates/primitives/block/Cargo.toml b/crates/primitives/block/Cargo.toml index f4b3c6ef4a..c95461184c 100644 --- a/crates/primitives/block/Cargo.toml +++ b/crates/primitives/block/Cargo.toml @@ -7,8 +7,8 @@ name = "mp-block" repository = { workspace = true } version.workspace = true - [package.metadata.docs.rs] - targets = ["x86_64-unknown-linux-gnu"] +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] blockifier = { workspace = true } diff --git a/crates/primitives/contract/Cargo.toml b/crates/primitives/contract/Cargo.toml index f84763d25a..98c1d2d041 100644 --- a/crates/primitives/contract/Cargo.toml +++ b/crates/primitives/contract/Cargo.toml @@ -7,15 +7,15 @@ name = "mp-contract" repository.workspace = true version.workspace = true - [package.metadata.docs.rs] - targets = ["x86_64-unknown-linux-gnu"] +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] blockifier = { workspace = true } mp-fee = { workspace = true, features = [ - "parity-scale-codec", - "scale-info", - "serde", + "parity-scale-codec", + "scale-info", + "serde", ] } mp-felt = { workspace = true } mp-hashers = { workspace = true } @@ -30,38 +30,38 @@ starknet_api = { workspace = true } anyhow = { workspace = true, optional = true } mp-convert = { workspace = true, optional = true } parity-scale-codec = { workspace = true, features = [ - "derive", + "derive", ], optional = true } scale-info = { workspace = true, features = ["derive"], optional = true } [features] default = ["std"] parity-scale-codec = [ - "blockifier/parity-scale-codec", - "dep:parity-scale-codec", - "mp-fee/parity-scale-codec", - "mp-felt/parity-scale-codec", - "mp-transactions/parity-scale-codec", - "starknet_api/parity-scale-codec", + "blockifier/parity-scale-codec", + "dep:parity-scale-codec", + "mp-fee/parity-scale-codec", + "mp-felt/parity-scale-codec", + "mp-transactions/parity-scale-codec", + "starknet_api/parity-scale-codec", ] scale-info = [ - "blockifier/scale-info", - "dep:scale-info", - "mp-felt/scale-info", - "starknet_api/scale-info", + "blockifier/scale-info", + "dep:scale-info", + "mp-felt/scale-info", + "starknet_api/scale-info", ] std = [ - "blockifier/std", - "mp-fee/std", - "mp-felt/std", - "mp-hashers/std", - "mp-transactions/std", - "serde/std", - "sp-core/std", - "starknet_api/std", - # Optionals - "anyhow/std", - "mp-convert/std", - "parity-scale-codec?/std", - "scale-info?/std", + "blockifier/std", + "mp-fee/std", + "mp-felt/std", + "mp-hashers/std", + "mp-transactions/std", + "serde/std", + "sp-core/std", + "starknet_api/std", + # Optionals + "anyhow/std", + "mp-convert/std", + "parity-scale-codec?/std", + "scale-info?/std", ] diff --git a/crates/primitives/felt/Cargo.toml b/crates/primitives/felt/Cargo.toml index ce8e02f3c5..29048607ed 100644 --- a/crates/primitives/felt/Cargo.toml +++ b/crates/primitives/felt/Cargo.toml @@ -15,8 +15,8 @@ cairo-vm = { workspace = true } sp-core = { workspace = true } starknet-core = { workspace = true } starknet-ff = { workspace = true } -starknet_api = { workspace = true } starknet-types-core = { workspace = true } +starknet_api = { workspace = true } thiserror-no-std = { workspace = true } # Optional diff --git a/crates/runtime/Cargo.toml b/crates/runtime/Cargo.toml index 3776bdb952..00febdcf17 100644 --- a/crates/runtime/Cargo.toml +++ b/crates/runtime/Cargo.toml @@ -12,8 +12,8 @@ publish = false repository = "https://github.com/keep-starknet-strange/madara" version.workspace = true - [package.metadata.docs.rs] - targets = ["x86_64-unknown-linux-gnu"] +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] parity-scale-codec = { workspace = true, features = [] } diff --git a/deoxys b/deoxys index efd4b654fd..bc653b453d 100755 --- a/deoxys +++ b/deoxys @@ -1,7 +1,7 @@ #!/bin/bash if [ "$#" -lt 1 ]; then - echo "Usage: $0 [start|reset|reboot|help] [KEY]" + echo "Usage: $0 [start|reset|reboot|lint|help] [KEY for start/reboot]" exit 1 fi @@ -30,6 +30,17 @@ clear_db(){ rm -rf /tmp/deoxys } +lint(){ + echo "๐Ÿ“ Running linters..." + read -p "Are you sure? [y/N] " -n 1 -r + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + exit 1 + fi + npx @taplo/cli@0.5.2 fmt --config ./taplo/taplo.toml + npx prettier --write . +} + ACTION=$1 case $ACTION in @@ -55,11 +66,15 @@ case $ACTION in clear_db start_deoxys "$2" ;; + lint) + lint + ;; help) - echo "Usage: $0 [start|reset|reboot|help] [KEY for start/reboot]" + echo "Usage: $0 [start|reset|reboot|lint|help] [KEY for start/reboot]" echo "start: start deoxys with KEY" echo "reset: clear and rebuild DB" echo "reboot: clear and rebuild DB, then start deoxys with KEY" + echo "lint: run CI linter on project" ;; *) echo "Invalid argument: $ACTION" diff --git a/rpc_cmp b/rpc_cmp index 32d82dda4d..58453a255f 100755 --- a/rpc_cmp +++ b/rpc_cmp @@ -166,6 +166,10 @@ case $COMMAND in get_class_hash_at "$PROVIDER_PATHFINDER" "$1" "$2" "$OUTPUT_PATHFINDER" ;; getBlockWithTxs) + echo "๐Ÿงช Testing starknet_getBlockWithTxs" + validate_args $# 2 + get_block_with_tx "$PROVIDER_DEOXYS" "$1" "$OUTPUT_DEOXYS" + get_block_with_tx "$PROVIDER_PATHFINDER" "$1" "$OUTPUT_PATHFINDER" ;; *) echo "Invalid argument: $COMMAND"