Skip to content

Commit

Permalink
Merge pull request #124 from Trantorian1/feat/scripts
Browse files Browse the repository at this point in the history
feat(script): 🔨 Added new CI scrips
  • Loading branch information
antiyro authored Feb 27, 2024
2 parents 3118703 + e0ff27a commit 5ee2774
Show file tree
Hide file tree
Showing 14 changed files with 334 additions and 51 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ starknet-e2e-test/contracts/build
# vscode settings
.vscode/settings.json

# script files
output_deoxys.json
output_pathfinder.json

tmp/
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ git # Madara Changelog

## Next release

- 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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
4 changes: 2 additions & 2 deletions crates/client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"]
16 changes: 8 additions & 8 deletions crates/client/deoxys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@ 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"
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"] }
Expand All @@ -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 }
Expand All @@ -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" }
4 changes: 2 additions & 2 deletions crates/client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions crates/pallets/starknet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
58 changes: 29 additions & 29 deletions crates/primitives/contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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",
]
2 changes: 1 addition & 1 deletion crates/primitives/felt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [] }
Expand Down
85 changes: 85 additions & 0 deletions deoxys
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash

if [ "$#" -lt 1 ]; then
echo "Usage: $0 [start|reset|reboot|lint|help] [KEY for start/reboot]"
exit 1
fi

start_deoxys(){
local key=$1
echo "🚀 start deoxys..."
cargo run \
--release \
-- \
--deoxys \
--rpc-port 9944 \
--network main \
--rpc-cors all \
--pruning archive \
--cache \
--l1-endpoint="$key"
}

clear_db(){
echo "🛠️ clear end rebuild DB..."
read -p "Are you sure? [y/N] " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
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/[email protected] fmt --config ./taplo/taplo.toml
npx prettier --write .
}

ACTION=$1

case $ACTION in
start)
if [ "$#" -ne 2 ]; then
echo "Usage for start: $0 start [KEY]"
exit 1
fi
start_deoxys "$2"
;;
reset)
if [ "$#" -ne 1 ]; then
echo "Usage for reset: $0 reset"
exit 1
fi
clear_db
;;
reboot)
if [ "$#" -ne 2 ]; then
echo "Usage for reboot: $0 reboot [KEY]"
exit 1
fi
clear_db
start_deoxys "$2"
;;
lint)
lint
;;
help)
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"
exit 1
;;
esac

exit 0
Loading

0 comments on commit 5ee2774

Please sign in to comment.