From 9b25ea5e2a776530bf70db62a78ba4cab034f26b Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 27 Aug 2025 17:57:23 -0400 Subject: [PATCH 1/6] feat: bump `blockifier` to `0.15.0-rc.3` (#248) Bumps `blockifer` to the latest [upstream] tag `v0.15.0-rc.3`. We still rely on our fork, so the version that is used for this bump is a [patched version] of the upstream tag. The patched is basically the branch `blockifier/cairo-2.11` but rebased onto the upstream tag `v0.15.0-rc.3`. The `snos-integration-test` will be removed temporarily until we have a version of SNOS using `cairo-lang-*@2.12.0-dev.1` as currently it's causing a version conflict issue with the cairo-lang deps. The test will most likely be added back once the new SNOS implementation is ready. The [current one] is pretty much deprecated and its development has stopped. [upstream]: https://github.com/starkware-libs/sequencer/releases/tag/v0.15.0-rc.3 [patched version]: https://github.com/dojoengine/sequencer/tree/blockifier/v0.15.0-rc.3 [current one]: https://github.com/keep-starknet-strange/snos --- .github/workflows/test.yml | 64 +- Cargo.lock | 1152 ++++------------- Cargo.toml | 24 +- crates/contracts/macro/Cargo.toml | 8 +- crates/executor/Cargo.toml | 2 +- .../src/implementation/blockifier/cache.rs | 2 +- .../src/implementation/blockifier/mod.rs | 9 +- .../src/implementation/blockifier/utils.rs | 19 +- crates/executor/src/utils.rs | 12 +- 9 files changed, 303 insertions(+), 989 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80e5e675f..b7d53ab1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -207,42 +207,42 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: lcov.info - snos-integration-test: - needs: [fmt, clippy] - runs-on: ubuntu-latest-32-cores - timeout-minutes: 30 - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) - container: - image: ghcr.io/dojoengine/katana-dev:latest - env: - MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ - LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ - TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - # Workaround for https://github.com/actions/runner-images/issues/6775 - - run: git config --global --add safe.directory "*" + # snos-integration-test: + # needs: [fmt, clippy] + # runs-on: ubuntu-latest-32-cores + # timeout-minutes: 30 + # if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) + # container: + # image: ghcr.io/dojoengine/katana-dev:latest + # env: + # MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ + # LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ + # TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: recursive + # # Workaround for https://github.com/actions/runner-images/issues/6775 + # - run: git config --global --add safe.directory "*" - - uses: Swatinem/rust-cache@v2 - with: - key: ci-${{ github.job }} - shared-key: katana-ci-cache + # - uses: Swatinem/rust-cache@v2 + # with: + # key: ci-${{ github.job }} + # shared-key: katana-ci-cache - - name: Download test artifacts - uses: actions/download-artifact@v5 - with: - name: test-artifacts + # - name: Download test artifacts + # uses: actions/download-artifact@v5 + # with: + # name: test-artifacts - - name: Prepare SNOS test environment - run: | - if [ ! -d "./tests/snos/snos/build" ]; then - make snos-artifacts - fi + # - name: Prepare SNOS test environment + # run: | + # if [ ! -d "./tests/snos/snos/build" ]; then + # make snos-artifacts + # fi - - run: | - cargo run -p snos-integration-test + # - run: | + # cargo run -p snos-integration-test explorer-reverse-proxy: needs: [fmt, clippy, build-katana-binary] diff --git a/Cargo.lock b/Cargo.lock index 549f3fbae..b93c538a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,131 +849,86 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] -name = "apollo_config" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" +name = "apollo_compilation_utils" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "clap", - "itertools 0.12.1", + "apollo_infra_utils", + "cairo-lang-sierra", + "cairo-lang-starknet-classes", + "cairo-lang-utils", + "rlimit", "serde", "serde_json", - "strum_macros 0.25.3", + "starknet-types-core", + "starknet_api", + "tempfile", "thiserror 1.0.69", - "tracing", - "validator", ] [[package]] -name = "apollo_config" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +name = "apollo_compile_to_native" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "clap", - "itertools 0.12.1", - "serde", - "serde_json", - "strum_macros 0.25.3", - "thiserror 1.0.69", - "tracing", - "validator", + "apollo_compilation_utils", + "apollo_compile_to_native_types", + "apollo_infra_utils", + "cairo-lang-starknet-classes", + "cairo-native", + "tempfile", ] [[package]] -name = "apollo_infra" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" +name = "apollo_compile_to_native_types" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ - "apollo_config 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_metrics 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "async-trait", - "hyper 0.14.32", - "rstest 0.17.0", + "apollo_config", "serde", - "serde_json", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "thiserror 1.0.69", - "time", - "tokio", - "tower 0.4.13", - "tracing", - "tracing-subscriber", "validator", ] [[package]] -name = "apollo_infra" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +name = "apollo_config" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ - "apollo_config 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_metrics 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "async-trait", - "hyper 0.14.32", - "rstest 0.17.0", + "apollo_infra_utils", + "clap", + "const_format", + "itertools 0.12.1", "serde", "serde_json", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "strum_macros 0.25.3", "thiserror 1.0.69", - "time", - "tokio", - "tower 0.4.13", "tracing", - "tracing-subscriber", + "url", "validator", ] [[package]] name = "apollo_infra_utils" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ + "apollo_proc_macros", "assert-json-diff", - "cached", - "colored 3.0.0", - "serde", - "serde_json", - "socket2 0.5.10", - "tokio", - "toml", - "tracing", -] - -[[package]] -name = "apollo_infra_utils" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" -dependencies = [ - "assert-json-diff", - "cached", "colored 3.0.0", + "num_enum", "serde", "serde_json", "socket2 0.5.10", + "tempfile", + "thiserror 1.0.69", "tokio", - "toml", "tracing", ] [[package]] name = "apollo_metrics" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" -dependencies = [ - "indexmap 2.10.0", - "metrics 0.24.2", - "num-traits", - "paste", - "regex", -] - -[[package]] -name = "apollo_metrics" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ "indexmap 2.10.0", "metrics 0.24.2", @@ -984,99 +939,15 @@ dependencies = [ [[package]] name = "apollo_proc_macros" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" -dependencies = [ - "quote", - "syn 2.0.104", -] - -[[package]] -name = "apollo_proc_macros" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ + "lazy_static", + "proc-macro2", "quote", "syn 2.0.104", ] -[[package]] -name = "apollo_sierra_multicompile" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" -dependencies = [ - "apollo_config 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_infra 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_sierra_multicompile_types 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "async-trait", - "cairo-lang-sierra", - "cairo-lang-starknet-classes", - "cairo-lang-utils", - "rlimit", - "serde", - "serde_json", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "tempfile", - "thiserror 1.0.69", - "tracing", - "validator", -] - -[[package]] -name = "apollo_sierra_multicompile" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" -dependencies = [ - "apollo_config 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_infra 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_sierra_multicompile_types 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "async-trait", - "cairo-lang-sierra", - "cairo-lang-starknet-classes", - "cairo-lang-utils", - "cairo-native", - "rlimit", - "serde", - "serde_json", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "tempfile", - "thiserror 1.0.69", - "tracing", - "validator", -] - -[[package]] -name = "apollo_sierra_multicompile_types" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" -dependencies = [ - "apollo_infra 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_proc_macros 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "async-trait", - "serde", - "serde_json", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "thiserror 1.0.69", -] - -[[package]] -name = "apollo_sierra_multicompile_types" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" -dependencies = [ - "apollo_infra 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_proc_macros 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "async-trait", - "serde", - "serde_json", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "thiserror 1.0.69", -] - [[package]] name = "aquamarine" version = "0.6.0" @@ -1490,8 +1361,8 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd 0.13.3", - "zstd-safe 7.2.4", + "zstd", + "zstd-safe", ] [[package]] @@ -1900,7 +1771,6 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", - "serde", "tap", "wyz", ] @@ -1916,69 +1786,28 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ "anyhow", - "apollo_config 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "apollo_sierra_multicompile 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", + "apollo_compilation_utils", + "apollo_compile_to_native", + "apollo_compile_to_native_types", + "apollo_config", + "apollo_infra_utils", + "apollo_metrics", "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-secp256k1 0.4.0", "ark-secp256r1 0.4.0", - "blockifier_test_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "cached", - "cairo-lang-casm", - "cairo-lang-runner", - "cairo-lang-starknet-classes", - "cairo-vm 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.20", - "indexmap 2.10.0", - "itertools 0.12.1", - "keccak", - "log", - "mockall", - "num-bigint", - "num-integer", - "num-rational", - "num-traits", - "paste", - "phf", - "rand 0.8.5", - "rstest 0.17.0", - "rstest_reuse 0.7.0", - "semver 1.0.26", - "serde", - "serde_json", - "sha2", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "strum 0.25.0", - "strum_macros 0.25.3", - "thiserror 1.0.69", -] - -[[package]] -name = "blockifier" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" -dependencies = [ - "anyhow", - "apollo_config 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "apollo_sierra_multicompile 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-secp256k1 0.4.0", - "ark-secp256r1 0.4.0", - "blockifier_test_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "blockifier_test_utils", "cached", "cairo-lang-casm", "cairo-lang-runner", "cairo-lang-starknet-classes", "cairo-native", - "cairo-vm 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm", + "dashmap", "derive_more 0.99.20", "indexmap 2.10.0", "itertools 0.12.1", @@ -1999,7 +1828,7 @@ dependencies = [ "serde_json", "sha2", "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "starknet_api", "strum 0.25.0", "strum_macros 0.25.3", "thiserror 1.0.69", @@ -2007,38 +1836,16 @@ dependencies = [ [[package]] name = "blockifier_test_utils" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" -dependencies = [ - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "cairo-lang-starknet-classes", - "itertools 0.12.1", - "pretty_assertions", - "rstest 0.17.0", - "serde_json", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "strum 0.25.0", - "strum_macros 0.25.3", - "tempfile", - "tokio", - "tracing", - "tracing-test", -] - -[[package]] -name = "blockifier_test_utils" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "apollo_infra_utils", "cairo-lang-starknet-classes", - "itertools 0.12.1", "pretty_assertions", "rstest 0.17.0", "serde_json", "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "starknet_api", "strum 0.25.0", "strum_macros 0.25.3", "tempfile", @@ -2199,16 +2006,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - [[package]] name = "bzip2" version = "0.5.2" @@ -2379,9 +2176,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b3c953c0321df1d7ce9101c7a94e2d4007aa8c3362ee96be54bbe77916ef60" +checksum = "88bf35a939eaed69b8a71405c5d56fa52c3b1c76701b8c1056fe22b3e2569c7d" dependencies = [ "cairo-lang-utils", "indoc", @@ -2393,9 +2190,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8cd5bec42d0c4e9f1ac6c373c177c98c73a760fabb4066757edd32ef9db467e" +checksum = "c13c2341fb2272999f6152b0fc2238148fe93c745183a07acba031b27eeb0b66" dependencies = [ "anyhow", "cairo-lang-defs", @@ -2419,19 +2216,20 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea55d64b6e7aa9186bb65ca32f50f386d6518d467930e53fcf47658dec74a2e" +checksum = "17cf782d64a29c4acb1eb2759c39783d5e92c397d5ae3775754edae5d2c665ee" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093146c748e95400230a40dc6171ac192399484addd96c6ac70ec36b0a2e45b0" +checksum = "80a146574d443e7fba848c069d7d84879c4635df5811963a18bf042df3e34e61" dependencies = [ + "bincode 1.3.3", "cairo-lang-debug", "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -2440,14 +2238,16 @@ dependencies = [ "cairo-lang-utils", "itertools 0.14.0", "rust-analyzer-salsa", + "serde", "smol_str", + "typetag", ] [[package]] name = "cairo-lang-diagnostics" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c85890af7f0d0b6e0d15686e0a5169d3396e2861cb3adac3c594f82ae5ed42c" +checksum = "cb704187b1543aa4a2e0030d13ae6e0ad63712e5362cac3ded3237623a2b1b32" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -2457,9 +2257,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a54937f1baca684547159af847ba5332ec8015de442878b8e4d6dbbaeec714c" +checksum = "a5a2e6145241a4812820948278a86e11c25adc30e9a19b2e24b2517be19eedac" dependencies = [ "cairo-lang-utils", "good_lp", @@ -2467,9 +2267,9 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e07492644cfa43e50cfc334a80c12c9e4d8e2a4248b3d2240301c99a025010a" +checksum = "3c903cdcae48aa02c0ed41e1fd54b3231da51f1edf9538327ed155463594b8be" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -2483,9 +2283,9 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26c988d6b522c45b5f70add3808fcae13c921822d1c48724c394b450adcf7f9" +checksum = "a943f0818cfc091c3302acd92053ff2a642004d32757c3b4f94c5aa18e184ac0" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -2503,10 +2303,11 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90577e4dc391e2384041763120618ed2017a8f709f20dfcaa2c1246f908dd374" +checksum = "7b86cd38af57c36b2a72a2483d04d8b17ea2f9a554fd45b9d83375773f948818" dependencies = [ + "assert_matches", "bincode 1.3.3", "cairo-lang-debug", "cairo-lang-defs", @@ -2525,14 +2326,13 @@ dependencies = [ "num-traits", "rust-analyzer-salsa", "serde", - "smol_str", ] [[package]] name = "cairo-lang-parser" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b7985c0ee345ead0e0f713474ec6490e3fac80c3c3889ab9e67b1588d30337" +checksum = "f64f0a5ca9ac54975cdec98fe8491d9b62922b7cb048e6ded00188383b841b25" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -2551,9 +2351,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697772ca0b096e36cb98cfc9b1231b115a15eebf8ac7295f7b50252f5a1e6aea" +checksum = "6230c6d37e5e8361900709112e56b42e48478806b829a086727ef59b2f7f3310" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -2576,9 +2376,9 @@ checksum = "123ac0ecadf31bacae77436d72b88fa9caef2b8e92c89ce63a125ae911a12fae" [[package]] name = "cairo-lang-proc-macros" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a956924e4f53cb1b69a7cee4758f0bcf50e23bbb8769f632625956a574f736" +checksum = "b1e4872352761cf6d7f47eeb1626e3b1d84a514017fb4251173148d8c04f36d5" dependencies = [ "cairo-lang-debug", "quote", @@ -2587,9 +2387,9 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088f29ca8d06722bd92001d098b619a25979dcbfa5face7a6de5d8c7232f0454" +checksum = "2327b8c070f9e50ac85a410f03c6aaf6a0dffee5ba8299d6af4bf2344587ac42" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -2600,9 +2400,9 @@ dependencies = [ [[package]] name = "cairo-lang-runnable-utils" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b63a8fe2e8f2ae6280392bcc8ab98b981db75832b16c98974b81978d3d1b26" +checksum = "775b064b0265e8408565b1ec9d360116015acf35753f02db255cbb13ad30670e" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -2611,16 +2411,16 @@ dependencies = [ "cairo-lang-sierra-to-casm", "cairo-lang-sierra-type-size", "cairo-lang-utils", - "cairo-vm 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm", "itertools 0.14.0", "thiserror 2.0.12", ] [[package]] name = "cairo-lang-runner" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db16efd33b13cecb1ca5b843a65f1e8e3eab4e18abf0c39522b04d741e51e7" +checksum = "e7166250692bda4b8b31f0480b8ba7fe75793b15bd4f0b6e5b5fe5d6dde01da8" dependencies = [ "ark-ff 0.5.0", "ark-secp256k1 0.5.0", @@ -2633,7 +2433,7 @@ dependencies = [ "cairo-lang-sierra-to-casm", "cairo-lang-starknet", "cairo-lang-utils", - "cairo-vm 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm", "itertools 0.14.0", "keccak", "num-bigint", @@ -2648,9 +2448,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3d35463c096f1e3ab6830e28c762b22a7b5c3fbf0df5c2e9a265d290d22ee5" +checksum = "f53a1ea47d1a0295179881d5578fc2b2c8cd5d2ac99bd81958c423d54960bb84" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -2675,14 +2475,14 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e02d4df410965f122b67967936b722352eddbfde550883b054e019dc54beeef" +checksum = "a48fe249ba77fb39363b1b40c81556c8d272083508b4618fb65b964559aca0ee" dependencies = [ "anyhow", "cairo-lang-utils", "const-fnv1a-hash", - "convert_case 0.7.1", + "convert_case 0.8.0", "derivative", "itertools 0.14.0", "lalrpop", @@ -2702,9 +2502,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c0d3be06212edb4d79be1296cd999b246d22e1541b49432db74dca16fe0c523" +checksum = "fad6cbf5cc904f4309179793fc3757c1db9615e71c1b78eff601d2e22206d1c6" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -2718,9 +2518,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7f246adb40ac69242231642cdf2571c83463068086a00b5ae9131f7dfc74b5" +checksum = "704ec6a8cb1b38f78571d5561519e87672ed5008a018a422842fa2a122ca3c34" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -2734,9 +2534,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ca1fbf8d29528d5fdf6a7e3b2ccdd4f3e9b57066057c30f9bc2c3118867571" +checksum = "2e011122028a59557ff075b22f550f7d0267b493f3db3dbefc281ff6795d108c" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -2758,9 +2558,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbb42e872cff7d050d2348978e2f12a94b4b29aee6f5ba5a7eca76a5294c900" +checksum = "6a43885fd8e806f5c50a80473798faad1a9a919f474e469d3027aece4f8b2002" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -2779,9 +2579,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8217d84f5434c36c68f54b5bbac9c91ff981a3738f2e6bc51b102f5beae3fd8" +checksum = "860006ddce78cae65babf37ff279c31358336ae76717991837d7e0868561878c" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -2789,9 +2589,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70aca831fef1f41b29c5e62a464a8ddd7964ed2414d3dafb6e1530bff1ae3cbd" +checksum = "4ba6eb0a421d3411f4948e002d3dd81ab134044465bda3131f2718f56afda409" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -2815,19 +2615,20 @@ dependencies = [ "smol_str", "starknet-types-core", "thiserror 2.0.12", + "typetag", ] [[package]] name = "cairo-lang-starknet-classes" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e9b59bb3d46e68730266b27e3f0ad524c076eebab1bcc9352256a8957d6b88" +checksum = "2cf81db2c36c1e3fe3bbf64ebc5c237f748e9f41bdd42a6ed3e03e00086d768c" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", "cairo-lang-sierra-to-casm", "cairo-lang-utils", - "convert_case 0.7.1", + "convert_case 0.8.0", "itertools 0.14.0", "num-bigint", "num-integer", @@ -2842,9 +2643,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686aea0cd9730af809010a74c0a8583b3acb99a08e5f97a07ed205f37b9e75ae" +checksum = "f36620fd45292fd0276bd581e774222fbd06e13aa8a4bf820a4be8ad3bcec100" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -2860,9 +2661,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.11.4" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c69eb6919b69a9a7bb92f79d73c568d09ef77efa0b5d265efb763234ec979d4" +checksum = "f7c3560464f6e243259a20906b0e173c7600e59e459bbc3beb620cd656b037ae" dependencies = [ "genco", "xshell", @@ -2870,9 +2671,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a6f34df0f3929bf8166c5a6d143c22ad28fd73937cfb5d7a994d56ca4a86c4" +checksum = "eb622d636da63a5cc8138dba941d9eb1918d06e297bdb5a76dc69fffdf3581d9" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -2897,9 +2698,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199eb0e7ac78ba7dfbf6551ab7eab14dd45fdcf21675fd5472ca695dc6da96f1" +checksum = "4c65df2eee1678a29b4b9dcff5c10a70b44e38d445ba2522025b1b6b7177b61f" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -2910,9 +2711,9 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.11.2" +version = "2.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e621368454b62603ae035d04864770a70952e6ca8341b78c1ac50a0088939e3f" +checksum = "5f043065d60a8a2510bfacb6c91767298fed50ed9abbd69ff7698322b7cb1e65" dependencies = [ "hashbrown 0.15.4", "indexmap 2.10.0", @@ -2922,13 +2723,14 @@ dependencies = [ "parity-scale-codec", "schemars 0.8.22", "serde", + "smol_str", ] [[package]] name = "cairo-native" -version = "0.4.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67542e31b00b8f015088c06b04095aaed96b3e35b50d396289390e9fb9c9a778" +checksum = "4d714224a1280776d90422e631790c0138d138a80b8e16231829dacea13c8289" dependencies = [ "anyhow", "aquamarine", @@ -2980,64 +2782,20 @@ dependencies = [ "utf8_iter", ] -[[package]] -name = "cairo-type-derive" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/snos?rev=c96eb9e#c96eb9e433c89da1a12a8a8474a30e6590431662" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "cairo-vm" -version = "1.0.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa8b4b56ee66cebcade4d85128e55b2bfdf046502187aeaa8c2768a427684dc" +checksum = "2afc2bb5cf948599994a1f1634edc81934c3952e2f32c8e49efbde63d767fa69" dependencies = [ "anyhow", "arbitrary", "bincode 2.0.1", "bitvec", "generic-array", - "hashbrown 0.14.5", - "hex", - "keccak", - "lazy_static", - "nom", - "num-bigint", - "num-integer", - "num-prime", - "num-traits", - "rand 0.8.5", - "rust_decimal", - "serde", - "serde_json", - "sha2", - "sha3", - "starknet-crypto 0.6.2", - "starknet-types-core", - "thiserror-no-std", - "zip 0.6.6", -] - -[[package]] -name = "cairo-vm" -version = "1.0.2" -source = "git+https://github.com/kariy/cairo-vm?branch=kariy%2F1.0.2_clear-cell#0881dafa5440b304fb000578b6f17c0a6e5f0595" -dependencies = [ - "anyhow", - "ark-ff 0.4.2", - "ark-std 0.4.0", - "bincode 2.0.1", - "bitvec", - "cairo-lang-casm", - "cairo-lang-starknet", - "cairo-lang-starknet-classes", - "generic-array", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "hex", + "indoc", "keccak", "lazy_static", "nom", @@ -3051,10 +2809,9 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto 0.6.2", + "starknet-crypto 0.7.4", "starknet-types-core", - "thiserror-no-std", - "wasm-bindgen", + "thiserror 2.0.12", "zip 0.6.6", ] @@ -3429,12 +3186,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "constant_time_eq" version = "0.3.1" @@ -4025,18 +3776,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" -[[package]] -name = "dummy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac124e13ae9aa56acc4241f8c8207501d93afdd8d8e62f0c1f2e12f6508c65" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "dunce" version = "1.0.5" @@ -4185,41 +3924,28 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "env_filter" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_home" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" -[[package]] -name = "env_logger" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "jiff", - "log", -] - [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "erased-serde" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" version = "0.3.13" @@ -4279,18 +4005,6 @@ dependencies = [ "uint", ] -[[package]] -name = "fake" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d391ba4af7f1d93f01fcf7b2f29e2bc9348e109dfdbf4dcbdc51dfa38dab0b6" -dependencies = [ - "deunicode", - "dummy", - "rand 0.8.5", - "serde_json", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -4372,7 +4086,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", - "libz-sys", "miniz_oxide", ] @@ -4910,7 +4623,6 @@ dependencies = [ "ahash 0.8.12", "allocator-api2", "rayon", - "serde", ] [[package]] @@ -5508,7 +5220,7 @@ checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" dependencies = [ "console", "number_prefix", - "portable-atomic 1.11.1", + "portable-atomic", "unicode-width 0.2.1", "web-time", ] @@ -5572,6 +5284,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "inventory" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" +dependencies = [ + "rustversion", +] + [[package]] name = "io-uring" version = "0.7.9" @@ -5689,30 +5410,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jiff" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" -dependencies = [ - "jiff-static", - "log", - "portable-atomic 1.11.1", - "portable-atomic-util", - "serde", -] - -[[package]] -name = "jiff-static" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "jni" version = "0.21.1" @@ -5996,7 +5693,7 @@ dependencies = [ "tokio", "tracing", "url", - "vergen 9.0.6", + "vergen", "vergen-gitcl", ] @@ -6160,7 +5857,7 @@ dependencies = [ "tempfile", "thiserror 1.0.69", "tracing", - "zstd 0.13.3", + "zstd", ] [[package]] @@ -6170,9 +5867,9 @@ dependencies = [ "alloy-primitives 1.3.0", "anyhow", "assert_matches", - "blockifier 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "blockifier", "cairo-native", - "cairo-vm 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm", "criterion", "katana-chain-spec", "katana-contracts", @@ -6191,7 +5888,7 @@ dependencies = [ "serde_json", "similar-asserts", "starknet", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "starknet_api", "thiserror 1.0.69", "tokio", "tracing", @@ -6431,10 +6128,10 @@ dependencies = [ "arbitrary", "assert_matches", "base64 0.21.7", - "blockifier 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "blockifier", "cainome-cairo-serde", "cairo-lang-starknet-classes", - "cairo-vm 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm", "criterion", "derive_more 0.99.20", "heapless", @@ -6453,7 +6150,7 @@ dependencies = [ "starknet", "starknet-crypto 0.7.4", "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "starknet_api", "strum 0.25.0", "strum_macros 0.25.3", "thiserror 1.0.69", @@ -6583,7 +6280,7 @@ dependencies = [ "serde_with", "similar-asserts", "starknet", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "starknet_api", "thiserror 1.0.69", ] @@ -6873,17 +6570,6 @@ dependencies = [ "libc", ] -[[package]] -name = "libz-sys" -version = "1.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -7075,17 +6761,6 @@ dependencies = [ "libc", ] -[[package]] -name = "metrics" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849" -dependencies = [ - "ahash 0.7.8", - "metrics-macros", - "portable-atomic 0.3.20", -] - [[package]] name = "metrics" version = "0.23.1" @@ -7093,7 +6768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3045b4193fbdc5b5681f32f11070da9be3609f189a79f3390706d42587f46bb5" dependencies = [ "ahash 0.8.12", - "portable-atomic 1.11.1", + "portable-atomic", ] [[package]] @@ -7103,7 +6778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25dea7ac8057892855ec285c440160265225438c3c45072613c25a4b26e98ef5" dependencies = [ "ahash 0.8.12", - "portable-atomic 1.11.1", + "portable-atomic", ] [[package]] @@ -7139,17 +6814,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "metrics-macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "metrics-process" version = "2.4.0" @@ -7311,7 +6975,7 @@ dependencies = [ "num-complex", "num-integer", "num-traits", - "portable-atomic 1.11.1", + "portable-atomic", "portable-atomic-util", "rawpointer", ] @@ -7522,6 +7186,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.104", @@ -7818,17 +7483,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "paste" version = "1.0.15" @@ -7841,56 +7495,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" -[[package]] -name = "pathfinder-common" -version = "0.14.3" -source = "git+https://github.com/Moonsong-Labs/pathfinder?rev=9c19d9a37be8f447ec4548456c440ccbd0e44260#9c19d9a37be8f447ec4548456c440ccbd0e44260" -dependencies = [ - "anyhow", - "bitvec", - "fake", - "metrics 0.20.1", - "num-bigint", - "paste", - "pathfinder-crypto", - "primitive-types", - "rand 0.8.5", - "serde", - "serde_json", - "serde_with", - "sha3", - "tagged", - "tagged-debug-derive", - "thiserror 1.0.69", - "vergen 8.3.2", -] - -[[package]] -name = "pathfinder-crypto" -version = "0.14.3" -source = "git+https://github.com/Moonsong-Labs/pathfinder?rev=9c19d9a37be8f447ec4548456c440ccbd0e44260#9c19d9a37be8f447ec4548456c440ccbd0e44260" -dependencies = [ - "bitvec", - "fake", - "rand 0.8.5", - "serde", -] - -[[package]] -name = "pathfinder-serde" -version = "0.14.3" -source = "git+https://github.com/Moonsong-Labs/pathfinder?rev=9c19d9a37be8f447ec4548456c440ccbd0e44260#9c19d9a37be8f447ec4548456c440ccbd0e44260" -dependencies = [ - "anyhow", - "num-bigint", - "pathfinder-common", - "pathfinder-crypto", - "primitive-types", - "serde", - "serde_json", - "serde_with", -] - [[package]] name = "pbkdf2" version = "0.11.0" @@ -7898,9 +7502,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac", - "password-hash", - "sha2", ] [[package]] @@ -8119,15 +7720,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "portable-atomic" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" -dependencies = [ - "portable-atomic 1.11.1", -] - [[package]] name = "portable-atomic" version = "1.11.1" @@ -8140,7 +7732,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" dependencies = [ - "portable-atomic 1.11.1", + "portable-atomic", ] [[package]] @@ -8486,52 +8078,19 @@ dependencies = [ [[package]] name = "prost-types" version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" -dependencies = [ - "prost 0.13.5", -] - -[[package]] -name = "prost-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" -dependencies = [ - "prost 0.14.1", -] - -[[package]] -name = "prove_block" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/snos?rev=c96eb9e#c96eb9e433c89da1a12a8a8474a30e6590431662" -dependencies = [ - "anyhow", - "blockifier 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "cairo-lang-starknet-classes", - "cairo-lang-utils", - "cairo-vm 1.0.2 (git+https://github.com/kariy/cairo-vm?branch=kariy%2F1.0.2_clear-cell)", - "clap", - "env_logger", - "futures-core", - "log", - "num-bigint", - "pathfinder-common", - "pathfinder-crypto", - "pathfinder-serde", - "reqwest 0.11.27", - "rpc-client", - "rpc-replay", - "serde", - "serde_json", - "serde_with", - "starknet", - "starknet-os", - "starknet-os-types", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "thiserror 1.0.69", - "tokio", +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +dependencies = [ + "prost 0.13.5", +] + +[[package]] +name = "prost-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" +dependencies = [ + "prost 0.14.1", ] [[package]] @@ -8961,11 +8520,9 @@ dependencies = [ "async-compression", "base64 0.22.1", "bytes", - "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2 0.4.12", "http 1.3.1", "http-body 1.0.1", "http-body-util", @@ -8974,7 +8531,6 @@ dependencies = [ "hyper-util", "js-sys", "log", - "mime", "mime_guess", "percent-encoding", "pin-project-lite", @@ -9134,39 +8690,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" -[[package]] -name = "rpc-client" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/snos?rev=c96eb9e#c96eb9e433c89da1a12a8a8474a30e6590431662" -dependencies = [ - "log", - "reqwest 0.11.27", - "serde", - "serde_json", - "starknet", - "starknet-crypto 0.7.4", - "starknet-os", - "starknet-types-core", - "thiserror 1.0.69", -] - -[[package]] -name = "rpc-replay" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/snos?rev=c96eb9e#c96eb9e433c89da1a12a8a8474a30e6590431662" -dependencies = [ - "blockifier 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "cairo-lang-starknet-classes", - "rpc-client", - "serde", - "serde_json", - "starknet", - "starknet-os-types", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "rsb_derive" version = "0.5.1" @@ -9992,19 +9515,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap 2.10.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "serdect" version = "0.2.0" @@ -10233,32 +9743,14 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +checksum = "9676b89cd56310a87b93dec47b11af744f34d5fc9f367b829474eec0a891350d" dependencies = [ + "borsh", "serde", ] -[[package]] -name = "snos-integration-test" -version = "1.7.0-alpha.2" -dependencies = [ - "anyhow", - "c-kzg", - "cairo-vm 1.0.2 (git+https://github.com/kariy/cairo-vm?branch=kariy%2F1.0.2_clear-cell)", - "either", - "katana-chain-spec", - "katana-messaging", - "katana-node", - "katana-primitives", - "katana-provider", - "prove_block", - "starknet", - "starknet-os", - "tokio", -] - [[package]] name = "socket2" version = "0.5.10" @@ -10525,28 +10017,6 @@ dependencies = [ "serde", ] -[[package]] -name = "starknet-gateway-types" -version = "0.14.3" -source = "git+https://github.com/Moonsong-Labs/pathfinder?rev=9c19d9a37be8f447ec4548456c440ccbd0e44260#9c19d9a37be8f447ec4548456c440ccbd0e44260" -dependencies = [ - "anyhow", - "fake", - "pathfinder-common", - "pathfinder-crypto", - "pathfinder-serde", - "primitive-types", - "rand 0.8.5", - "reqwest 0.12.22", - "rstest 0.18.2", - "serde", - "serde_json", - "serde_with", - "sha3", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "starknet-macros" version = "0.2.5-rc.2" @@ -10557,79 +10027,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "starknet-os" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/snos?rev=c96eb9e#c96eb9e433c89da1a12a8a8474a30e6590431662" -dependencies = [ - "anyhow", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-secp256k1 0.4.0", - "ark-secp256r1 0.4.0", - "base64 0.21.7", - "bitvec", - "blockifier 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "c-kzg", - "cairo-lang-casm", - "cairo-lang-starknet", - "cairo-lang-starknet-classes", - "cairo-type-derive", - "cairo-vm 1.0.2 (git+https://github.com/kariy/cairo-vm?branch=kariy%2F1.0.2_clear-cell)", - "futures", - "futures-util", - "heck 0.4.1", - "hex", - "indexmap 2.10.0", - "indoc", - "keccak", - "lazy_static", - "log", - "num-bigint", - "num-integer", - "num-traits", - "pathfinder-common", - "pathfinder-crypto", - "reqwest 0.11.27", - "serde", - "serde_json", - "serde_with", - "serde_yaml", - "sha2", - "starknet-crypto 0.7.4", - "starknet-gateway-types", - "starknet-os-types", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "thiserror 1.0.69", - "tokio", - "uuid 1.17.0", - "zip 0.6.6", -] - -[[package]] -name = "starknet-os-types" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/snos?rev=c96eb9e#c96eb9e433c89da1a12a8a8474a30e6590431662" -dependencies = [ - "blockifier 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "cairo-lang-starknet-classes", - "cairo-vm 1.0.2 (git+https://github.com/kariy/cairo-vm?branch=kariy%2F1.0.2_clear-cell)", - "flate2", - "num-bigint", - "once_cell", - "serde", - "serde_json", - "serde_with", - "starknet", - "starknet-crypto 0.7.4", - "starknet-gateway-types", - "starknet-types-core", - "starknet_api 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "starknet-providers" version = "0.16.0-rc.2" @@ -10688,48 +10085,16 @@ dependencies = [ [[package]] name = "starknet_api" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=4b1587c5e#4b1587c5e3effc4cfbbb8551cdcab6454a2dbe30" -dependencies = [ - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=4b1587c5e)", - "base64 0.13.1", - "bitvec", - "cached", - "cairo-lang-runner", - "cairo-lang-starknet-classes", - "derive_more 0.99.20", - "flate2", - "hex", - "indexmap 2.10.0", - "itertools 0.12.1", - "num-bigint", - "num-traits", - "pretty_assertions", - "primitive-types", - "rand 0.8.5", - "semver 1.0.26", - "serde", - "serde_json", - "sha3", - "size-of", - "starknet-crypto 0.7.4", - "starknet-types-core", - "strum 0.25.0", - "strum_macros 0.25.3", - "thiserror 1.0.69", -] - -[[package]] -name = "starknet_api" -version = "0.0.0" -source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +version = "0.15.0-rc.3" +source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" dependencies = [ - "apollo_infra_utils 0.0.0 (git+https://github.com/dojoengine/sequencer?rev=5d737b9c9)", + "apollo_infra_utils", "base64 0.13.1", "bitvec", "cached", "cairo-lang-runner", "cairo-lang-starknet-classes", + "cairo-lang-utils", "derive_more 0.99.20", "flate2", "hex", @@ -10750,6 +10115,7 @@ dependencies = [ "strum 0.25.0", "strum_macros 0.25.3", "thiserror 1.0.69", + "time", ] [[package]] @@ -10974,24 +10340,6 @@ dependencies = [ "libc", ] -[[package]] -name = "tagged" -version = "0.14.3" -source = "git+https://github.com/Moonsong-Labs/pathfinder?rev=9c19d9a37be8f447ec4548456c440ccbd0e44260#9c19d9a37be8f447ec4548456c440ccbd0e44260" -dependencies = [ - "fake", -] - -[[package]] -name = "tagged-debug-derive" -version = "0.14.3" -source = "git+https://github.com/Moonsong-Labs/pathfinder?rev=9c19d9a37be8f447ec4548456c440ccbd0e44260#9c19d9a37be8f447ec4548456c440ccbd0e44260" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "tap" version = "1.0.1" @@ -11078,26 +10426,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "thiserror-impl-no-std" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "thiserror-no-std" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" -dependencies = [ - "thiserror-impl-no-std", -] - [[package]] name = "thread_local" version = "1.1.9" @@ -11734,12 +11062,42 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "typenum" version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "u256-literal" version = "1.2.1" @@ -11846,12 +11204,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" @@ -11982,7 +11334,6 @@ checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ "getrandom 0.3.3", "js-sys", - "serde", "wasm-bindgen", ] @@ -12031,24 +11382,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "vergen" -version = "8.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" -dependencies = [ - "anyhow", - "cfg-if", - "rustversion", - "time", -] - [[package]] name = "vergen" version = "9.0.6" @@ -12076,7 +11409,7 @@ dependencies = [ "derive_builder", "rustversion", "time", - "vergen 9.0.6", + "vergen", "vergen-lib", ] @@ -13108,18 +12441,10 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes", "byteorder", - "bzip2 0.4.4", - "constant_time_eq 0.1.5", "crc32fast", "crossbeam-utils", "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", ] [[package]] @@ -13130,8 +12455,8 @@ checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" dependencies = [ "aes", "arbitrary", - "bzip2 0.5.2", - "constant_time_eq 0.3.1", + "bzip2", + "constant_time_eq", "crc32fast", "crossbeam-utils", "deflate64", @@ -13149,7 +12474,7 @@ dependencies = [ "xz2", "zeroize", "zopfli", - "zstd 0.13.3", + "zstd", ] [[package]] @@ -13164,32 +12489,13 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe 7.2.4", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1bed4b633..9b2a300f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ "crates/chain-spec", "crates/cli", "crates/contracts", + "crates/contracts/macro", "crates/controller", "crates/core", "crates/executor", @@ -39,7 +40,7 @@ members = [ "crates/utils", "tests/db-compat", "tests/reverse-proxy", - "tests/snos", + # "tests/snos", ] [workspace.package] @@ -95,13 +96,13 @@ katana-trie = { path = "crates/trie" } katana-utils = { path = "crates/utils" } # cairo-lang -cairo-lang-casm = "2.11.2" -cairo-lang-runner = "2.11.2" -cairo-lang-sierra = "2.11.2" -cairo-lang-sierra-to-casm = "2.11.2" -cairo-lang-starknet = "2.11.2" -cairo-lang-starknet-classes = "2.11.2" -cairo-lang-utils = "2.11.2" +cairo-lang-casm = "2.12.0-dev.1" +cairo-lang-runner = "2.12.0-dev.1" +cairo-lang-sierra = "2.12.0-dev.1" +cairo-lang-sierra-to-casm = "2.12.0-dev.1" +cairo-lang-starknet = "2.12.0-dev.1" +cairo-lang-starknet-classes = "2.12.0-dev.1" +cairo-lang-utils = "2.12.0-dev.1" anyhow = "1.0.89" arbitrary = { version = "1.3.2", features = [ "derive" ] } @@ -210,10 +211,11 @@ starknet-crypto = "0.7.4" starknet-types-core = { version = "0.1.8", features = [ "arbitrary", "hash" ] } # Some types that we used from cairo-vm implements the `Arbitrary` trait, # only under the `test_utils` feature. -cairo-vm = { version = "1.0.2", features = [ "test_utils" ] } +cairo-vm = { version = "2.3.1", features = [ "test_utils" ] } -blockifier = { git = "https://github.com/dojoengine/sequencer", rev = "5d737b9c9", default-features = false } -starknet_api = { git = "https://github.com/dojoengine/sequencer", rev = "5d737b9c9" } +blockifier = { git = "https://github.com/dojoengine/sequencer", branch = "blockifier/v0.15.0-rc.3", default-features = false } +cairo-native = "0.6" +starknet_api = { git = "https://github.com/dojoengine/sequencer", branch = "blockifier/v0.15.0-rc.3" } cainome = { git = "https://github.com/cartridge-gg/cainome", rev = "7d60de1", features = [ "abigen-rs" ] } cainome-cairo-serde = { git = "https://github.com/cartridge-gg/cainome", rev = "7d60de1" } diff --git a/crates/contracts/macro/Cargo.toml b/crates/contracts/macro/Cargo.toml index 206f1d90d..8d38691db 100644 --- a/crates/contracts/macro/Cargo.toml +++ b/crates/contracts/macro/Cargo.toml @@ -13,7 +13,7 @@ serde_json = "1.0" syn = { version = "2.0", features = [ "extra-traits", "full" ] } # Dependencies for contract class parsing and hash computation -cairo-lang-starknet-classes = "2.11.2" -katana-primitives = { path = "../../primitives" } -starknet-crypto = "0.7.4" -starknet-types-core = "0.1.8" +cairo-lang-starknet-classes.workspace = true +katana-primitives.workspace = true +starknet-crypto.workspace = true +starknet-types-core.workspace = true diff --git a/crates/executor/Cargo.toml b/crates/executor/Cargo.toml index 4636940db..fa50e5f04 100644 --- a/crates/executor/Cargo.toml +++ b/crates/executor/Cargo.toml @@ -18,7 +18,7 @@ thiserror.workspace = true tracing.workspace = true # cairo-native -cairo-native = { version = "0.4.1", optional = true } +cairo-native = { workspace = true, optional = true } cairo-vm.workspace = true parking_lot.workspace = true rayon = { workspace = true, optional = true } diff --git a/crates/executor/src/implementation/blockifier/cache.rs b/crates/executor/src/implementation/blockifier/cache.rs index d4312a178..ebeba4c29 100644 --- a/crates/executor/src/implementation/blockifier/cache.rs +++ b/crates/executor/src/implementation/blockifier/cache.rs @@ -273,7 +273,7 @@ impl ClassCache { let _span = span.enter(); let executor = - AotContractExecutor::new(&program, &entry_points, version.into(), OptLevel::Default) + AotContractExecutor::new(&program, &entry_points, version.into(), OptLevel::Default, None) .inspect_err(|error| tracing::error!(target: "class_cache", %error, "Failed to compile native class")) .unwrap(); diff --git a/crates/executor/src/implementation/blockifier/mod.rs b/crates/executor/src/implementation/blockifier/mod.rs index 20e512988..95cc659b4 100644 --- a/crates/executor/src/implementation/blockifier/mod.rs +++ b/crates/executor/src/implementation/blockifier/mod.rs @@ -3,7 +3,7 @@ use std::sync::Arc; // Re-export the blockifier crate. pub use blockifier; use blockifier::blockifier_versioned_constants::VersionedConstants; -use blockifier::bouncer::{n_steps_to_sierra_gas, Bouncer, BouncerConfig, BouncerWeights}; +use blockifier::bouncer::{n_steps_to_gas, Bouncer, BouncerConfig, BouncerWeights, BuiltinWeights}; pub mod cache; pub mod call; @@ -132,9 +132,12 @@ impl<'a> StarknetVMProcessor<'a> { // // To learn more about the L2 gas, refer to . block_max_capacity.sierra_gas = - n_steps_to_sierra_gas(limits.cairo_steps as usize, block_context.versioned_constants()); + n_steps_to_gas(limits.cairo_steps as usize, block_context.versioned_constants()); - let bouncer = Bouncer::new(BouncerConfig { block_max_capacity }); + let bouncer = Bouncer::new(BouncerConfig { + block_max_capacity, + builtin_weights: BuiltinWeights::default(), + }); Self { cfg_env, diff --git a/crates/executor/src/implementation/blockifier/utils.rs b/crates/executor/src/implementation/blockifier/utils.rs index 9ff459241..7dfe112f1 100644 --- a/crates/executor/src/implementation/blockifier/utils.rs +++ b/crates/executor/src/implementation/blockifier/utils.rs @@ -136,6 +136,7 @@ pub fn transact( &tx_state, &tx_state_changes_keys, &info.summarize(versioned_constants), + &info.summarize_builtins(), &info.receipt.resources, versioned_constants, )?; @@ -200,7 +201,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - tx: ApiInvokeTransaction::V0(starknet_api::transaction::InvokeTransactionV0 { entry_point_selector: EntryPointSelector(tx.entry_point_selector), contract_address: to_blk_address(tx.contract_address), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), calldata: Calldata(Arc::new(calldata)), max_fee: Fee(tx.max_fee), }), @@ -222,7 +223,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce), sender_address: to_blk_address(tx.sender_address), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), calldata: Calldata(Arc::new(calldata)), }), tx_hash: TransactionHash(hash), @@ -248,7 +249,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - tip: Tip(tx.tip), nonce: Nonce(tx.nonce), sender_address: to_blk_address(tx.sender_address), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), calldata: Calldata(Arc::new(calldata)), paymaster_data: PaymasterData(paymaster_data), account_deployment_data: AccountDeploymentData(account_deploy_data), @@ -278,7 +279,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - tx: ApiDeployAccountTransaction::V1(DeployAccountTransactionV1 { max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), class_hash: ClassHash(tx.class_hash), constructor_calldata: Calldata(Arc::new(calldata)), contract_address_salt: salt, @@ -306,7 +307,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - tx: ApiDeployAccountTransaction::V3(DeployAccountTransactionV3 { tip: Tip(tx.tip), nonce: Nonce(tx.nonce), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), class_hash: ClassHash(tx.class_hash), constructor_calldata: Calldata(Arc::new(calldata)), contract_address_salt: salt, @@ -333,7 +334,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - max_fee: Fee(tx.max_fee), nonce: Nonce::default(), sender_address: to_blk_address(tx.sender_address), - signature: TransactionSignature(tx.signature), + signature: TransactionSignature(tx.signature.into()), class_hash: ClassHash(tx.class_hash), }), @@ -341,7 +342,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce), sender_address: to_blk_address(tx.sender_address), - signature: TransactionSignature(tx.signature), + signature: TransactionSignature(tx.signature.into()), class_hash: ClassHash(tx.class_hash), }), @@ -352,7 +353,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce), sender_address: to_blk_address(tx.sender_address), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), class_hash: ClassHash(tx.class_hash), compiled_class_hash: CompiledClassHash(tx.compiled_class_hash), }) @@ -371,7 +372,7 @@ pub fn to_executor_tx(mut tx: ExecutableTxWithHash, mut flags: ExecutionFlags) - tip: Tip(tx.tip), nonce: Nonce(tx.nonce), sender_address: to_blk_address(tx.sender_address), - signature: TransactionSignature(signature), + signature: TransactionSignature(signature.into()), class_hash: ClassHash(tx.class_hash), account_deployment_data: AccountDeploymentData(account_deploy_data), compiled_class_hash: CompiledClassHash(tx.compiled_class_hash), diff --git a/crates/executor/src/utils.rs b/crates/executor/src/utils.rs index f26a6edf3..4ef561dbd 100644 --- a/crates/executor/src/utils.rs +++ b/crates/executor/src/utils.rs @@ -13,15 +13,17 @@ pub(crate) const LOG_TARGET: &str = "executor"; pub fn log_resources(resources: &TransactionResources) { let mut mapped_strings = Vec::new(); - for (builtin, count) in &resources.computation.vm_resources.builtin_instance_counter { + for (builtin, count) in &resources.computation.tx_vm_resources.builtin_instance_counter { mapped_strings.push(format!("{builtin}: {count}")); } // Sort the strings alphabetically mapped_strings.sort(); - mapped_strings.insert(0, format!("steps: {}", resources.computation.vm_resources.n_steps)); - mapped_strings - .insert(1, format!("memory holes: {}", resources.computation.vm_resources.n_memory_holes)); + mapped_strings.insert(0, format!("steps: {}", resources.computation.tx_vm_resources.n_steps)); + mapped_strings.insert( + 1, + format!("memory holes: {}", resources.computation.tx_vm_resources.n_memory_holes), + ); trace!(target: LOG_TARGET, usage = mapped_strings.join(" | "), "Transaction resource usage."); } @@ -74,7 +76,7 @@ pub(crate) fn build_receipt( } fn get_receipt_resources(receipt: &TransactionReceipt) -> receipt::ExecutionResources { - let computation_resources = receipt.resources.computation.vm_resources.clone(); + let computation_resources = receipt.resources.computation.tx_vm_resources.clone(); let gas = GasUsed { l2_gas: receipt.gas.l2_gas.0, From 271a37b7c2dc3037aae92bd2e0f9133e2b5693cf Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Thu, 28 Aug 2025 00:51:54 -0400 Subject: [PATCH 2/6] split cli crate --- Cargo.lock | 23 +- Cargo.toml | 2 + bin/katana/src/cli/mod.rs | 2 +- crates/cli/Cargo.toml | 3 +- crates/cli/args/Cargo.toml | 33 ++ crates/cli/args/src/config.rs | 36 ++ crates/cli/args/src/lib.rs | 177 ++++++ crates/cli/{ => args}/src/options.rs | 2 +- crates/cli/args/src/utils.rs | 68 +++ crates/cli/src/args.rs | 788 --------------------------- crates/cli/src/file.rs | 87 --- crates/cli/src/lib.rs | 319 ++++++++++- crates/cli/src/utils.rs | 194 +------ 13 files changed, 684 insertions(+), 1050 deletions(-) create mode 100644 crates/cli/args/Cargo.toml create mode 100644 crates/cli/args/src/config.rs create mode 100644 crates/cli/args/src/lib.rs rename crates/cli/{ => args}/src/options.rs (99%) create mode 100644 crates/cli/args/src/utils.rs delete mode 100644 crates/cli/src/args.rs delete mode 100644 crates/cli/src/file.rs diff --git a/Cargo.lock b/Cargo.lock index b93c538a0..5cbda57f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5731,6 +5731,7 @@ dependencies = [ "clap", "console", "katana-chain-spec", + "katana-cli-args", "katana-core", "katana-gas-price-oracle", "katana-messaging", @@ -5742,14 +5743,32 @@ dependencies = [ "katana-utils", "serde", "serde_json", - "shellexpand", "starknet", "tokio", - "toml", "tracing", "url", ] +[[package]] +name = "katana-cli-args" +version = "1.7.0-alpha.2" +dependencies = [ + "anyhow", + "clap", + "katana-chain-spec", + "katana-messaging", + "katana-node", + "katana-primitives", + "katana-rpc", + "katana-slot-controller", + "katana-tracing", + "serde", + "serde_json", + "shellexpand", + "toml", + "url", +] + [[package]] name = "katana-codecs" version = "1.7.0-alpha.2" diff --git a/Cargo.toml b/Cargo.toml index 9b2a300f3..8ba260c16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/cartridge", "crates/chain-spec", "crates/cli", + "crates/cli/args", "crates/contracts", "crates/contracts/macro", "crates/controller", @@ -65,6 +66,7 @@ cartridge = { path = "crates/cartridge" } katana-chain-spec = { path = "crates/chain-spec" } katana-cli = { path = "crates/cli" } +katana-cli-args = { path = "crates/cli/args" } katana-codecs = { path = "crates/storage/codecs" } katana-codecs-derive = { path = "crates/storage/codecs/derive" } katana-contracts = { path = "crates/contracts" } diff --git a/bin/katana/src/cli/mod.rs b/bin/katana/src/cli/mod.rs index 7c8949b2f..6352722ef 100644 --- a/bin/katana/src/cli/mod.rs +++ b/bin/katana/src/cli/mod.rs @@ -3,7 +3,7 @@ use std::future::Future; use anyhow::{Context, Result}; use clap::{Args, CommandFactory, Parser, Subcommand}; use clap_complete::Shell; -use katana_cli::NodeArgs; +use katana_cli::{NodeArgs, exec::NodeArgsExecute}; use tokio::runtime::Runtime; mod config; diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index a965de778..09c799643 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -7,6 +7,7 @@ version.workspace = true [dependencies] katana-chain-spec.workspace = true +katana-cli-args = { workspace = true, features = ["server", "cartridge"] } katana-core.workspace = true katana-messaging.workspace = true katana-node.workspace = true @@ -22,9 +23,7 @@ clap.workspace = true console.workspace = true serde.workspace = true serde_json.workspace = true -shellexpand = "3.1.0" tokio.workspace = true -toml.workspace = true tracing.workspace = true url.workspace = true diff --git a/crates/cli/args/Cargo.toml b/crates/cli/args/Cargo.toml new file mode 100644 index 000000000..7e1ee8a84 --- /dev/null +++ b/crates/cli/args/Cargo.toml @@ -0,0 +1,33 @@ +[package] +edition.workspace = true +license.workspace = true +name = "katana-cli-args" +repository.workspace = true +version.workspace = true +description = "CLI argument types for Katana" + +[dependencies] +katana-chain-spec.workspace = true +katana-messaging.workspace = true +katana-primitives.workspace = true +katana-tracing.workspace = true + +# Only import specific types we need from these crates +katana-node = { workspace = true, default-features = false } +katana-rpc = { workspace = true, optional = true, default-features = false } +katana-slot-controller = { workspace = true, optional = true } + +anyhow.workspace = true +clap.workspace = true +serde.workspace = true +shellexpand = "3.1.0" +toml.workspace = true +url.workspace = true + +[dev-dependencies] +serde_json.workspace = true + +[features] +cartridge = ["dep:katana-slot-controller"] +default = [] +server = ["dep:katana-rpc"] \ No newline at end of file diff --git a/crates/cli/args/src/config.rs b/crates/cli/args/src/config.rs new file mode 100644 index 000000000..cdbf0a658 --- /dev/null +++ b/crates/cli/args/src/config.rs @@ -0,0 +1,36 @@ +use std::path::{Path, PathBuf}; + +use anyhow::Result; +use katana_messaging::MessagingConfig; +use serde::{Deserialize, Serialize}; + +use crate::options::*; + +/// Node arguments configuration file. +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NodeArgsConfig { + pub no_mining: Option, + pub block_time: Option, + pub block_cairo_steps_limit: Option, + pub db_dir: Option, + pub messaging: Option, + pub logging: Option, + pub starknet: Option, + pub gpo: Option, + pub forking: Option, + #[serde(rename = "dev")] + pub development: Option, + #[cfg(feature = "server")] + pub server: Option, + #[cfg(feature = "server")] + pub metrics: Option, + #[cfg(feature = "cartridge")] + pub cartridge: Option, +} + +impl NodeArgsConfig { + pub fn read(path: impl AsRef) -> Result { + let file = std::fs::read_to_string(path)?; + Ok(toml::from_str(&file)?) + } +} \ No newline at end of file diff --git a/crates/cli/args/src/lib.rs b/crates/cli/args/src/lib.rs new file mode 100644 index 000000000..51c89fc7a --- /dev/null +++ b/crates/cli/args/src/lib.rs @@ -0,0 +1,177 @@ +#![cfg_attr(not(test), warn(unused_crate_dependencies))] + +use std::path::PathBuf; + +use anyhow::Result; +use clap::Parser; +use katana_chain_spec::rollup::ChainConfigDir; +use katana_messaging::MessagingConfig; +use serde::{Deserialize, Serialize}; +use url::Url; + +pub mod config; +pub mod options; +pub mod utils; + +pub use config::NodeArgsConfig; +pub use options::*; +use utils::parse_chain_config_dir; + +#[derive(Parser, Debug, Serialize, Deserialize, Default, Clone)] +#[command(next_help_heading = "Node options")] +pub struct NodeArgs { + /// Don't print anything on startup. + #[arg(long)] + pub silent: bool, + + /// Path to the chain configuration file. + #[arg(long, hide = true)] + #[arg(value_parser = parse_chain_config_dir)] + pub chain: Option, + + /// Disable auto and interval mining, and mine on demand instead via an endpoint. + #[arg(long)] + #[arg(conflicts_with = "block_time")] + pub no_mining: bool, + + /// Block time in milliseconds for interval mining. + #[arg(short, long)] + #[arg(value_name = "MILLISECONDS")] + pub block_time: Option, + + #[arg(long = "sequencing.block-max-cairo-steps")] + #[arg(value_name = "TOTAL")] + pub block_cairo_steps_limit: Option, + + /// Directory path of the database to initialize from. + /// + /// The path must either be an empty directory or a directory which already contains a + /// previously initialized Katana database. + #[arg(long)] + #[arg(value_name = "PATH")] + pub db_dir: Option, + + /// Configuration file + #[arg(long)] + pub config: Option, + + /// Configure the messaging with an other chain. + /// + /// Configure the messaging to allow Katana listening/sending messages on a + /// settlement chain that can be Ethereum or an other Starknet sequencer. + #[arg(long)] + #[arg(value_name = "PATH")] + #[arg(value_parser = katana_messaging::MessagingConfig::parse)] + #[arg(conflicts_with = "chain")] + pub messaging: Option, + + #[arg(long = "l1.provider", value_name = "URL", alias = "l1-provider")] + #[arg(help = "The Ethereum RPC provider to sample the gas prices from to enable the gas \ + price oracle.")] + pub l1_provider_url: Option, + + #[command(flatten)] + pub logging: LoggingOptions, + + #[command(flatten)] + pub tracer: TracerOptions, + + #[cfg(feature = "server")] + #[command(flatten)] + pub metrics: MetricsOptions, + + #[cfg(feature = "server")] + #[command(flatten)] + pub server: ServerOptions, + + #[command(flatten)] + pub starknet: StarknetOptions, + + #[command(flatten)] + pub gpo: GasPriceOracleOptions, + + #[command(flatten)] + pub forking: ForkingOptions, + + #[command(flatten)] + pub development: DevOptions, + + #[cfg(feature = "explorer")] + #[command(flatten)] + pub explorer: ExplorerOptions, + + #[cfg(feature = "cartridge")] + #[command(flatten)] + pub cartridge: CartridgeOptions, +} + +impl NodeArgs { + /// Parse the node config from the command line arguments and the config file, + /// and merge them together prioritizing the command line arguments. + pub fn with_config_file(mut self) -> Result { + let config = if let Some(path) = &self.config { + NodeArgsConfig::read(path)? + } else { + return Ok(self); + }; + + // the CLI (self) takes precedence over the config file. + // Currently, the merge is made at the top level of the commands. + // We may add recursive merging in the future. + + if !self.no_mining { + self.no_mining = config.no_mining.unwrap_or_default(); + } + + if self.block_time.is_none() { + self.block_time = config.block_time; + } + + if self.db_dir.is_none() { + self.db_dir = config.db_dir; + } + + if self.logging == LoggingOptions::default() { + if let Some(logging) = config.logging { + self.logging = logging; + } + } + + if self.messaging.is_none() { + self.messaging = config.messaging; + } + + #[cfg(feature = "server")] + { + self.server.merge(config.server.as_ref()); + + if self.metrics == MetricsOptions::default() { + if let Some(metrics) = config.metrics { + self.metrics = metrics; + } + } + } + + self.starknet.merge(config.starknet.as_ref()); + self.development.merge(config.development.as_ref()); + + if self.gpo == GasPriceOracleOptions::default() { + if let Some(gpo) = config.gpo { + self.gpo = gpo; + } + } + + if self.forking == ForkingOptions::default() { + if let Some(forking) = config.forking { + self.forking = forking; + } + } + + #[cfg(feature = "cartridge")] + { + self.cartridge.merge(config.cartridge.as_ref()); + } + + Ok(self) + } +} diff --git a/crates/cli/src/options.rs b/crates/cli/args/src/options.rs similarity index 99% rename from crates/cli/src/options.rs rename to crates/cli/args/src/options.rs index e09fe1d26..c26a43e5b 100644 --- a/crates/cli/src/options.rs +++ b/crates/cli/args/src/options.rs @@ -669,4 +669,4 @@ impl TracerOptions { } self } -} +} \ No newline at end of file diff --git a/crates/cli/args/src/utils.rs b/crates/cli/args/src/utils.rs new file mode 100644 index 000000000..f6f7c45fd --- /dev/null +++ b/crates/cli/args/src/utils.rs @@ -0,0 +1,68 @@ +use std::path::PathBuf; + +use anyhow::{Context, Result}; +use katana_chain_spec::rollup::ChainConfigDir; +use katana_primitives::block::{BlockHash, BlockHashOrNumber, BlockNumber}; +use katana_primitives::genesis::json::GenesisJson; +use katana_primitives::genesis::Genesis; +#[cfg(feature = "server")] +use katana_rpc::cors::HeaderValue; +use serde::{Deserialize, Deserializer, Serializer}; + +pub fn parse_seed(seed: &str) -> [u8; 32] { + let seed = seed.as_bytes(); + + if seed.len() >= 32 { + unsafe { *(seed[..32].as_ptr() as *const [u8; 32]) } + } else { + let mut actual_seed = [0u8; 32]; + seed.iter().enumerate().for_each(|(i, b)| actual_seed[i] = *b); + actual_seed + } +} + +/// Used as clap value parser for [Genesis]. +pub fn parse_genesis(value: &str) -> Result { + let path = PathBuf::from(shellexpand::full(value)?.into_owned()); + let genesis = Genesis::try_from(GenesisJson::load(path)?)?; + Ok(genesis) +} + +/// If the value starts with `0x`, it is parsed as a [`BlockHash`], otherwise as a [`BlockNumber`]. +pub fn parse_block_hash_or_number(value: &str) -> Result { + if value.starts_with("0x") { + Ok(BlockHashOrNumber::Hash(BlockHash::from_hex(value)?)) + } else { + let num = value.parse::().context("could not parse block number")?; + Ok(BlockHashOrNumber::Num(num)) + } +} + +pub fn parse_chain_config_dir(value: &str) -> Result { + let path = PathBuf::from(shellexpand::full(value)?.into_owned()); + Ok(ChainConfigDir(path)) +} + +#[cfg(feature = "server")] +pub fn serialize_cors_origins( + values: &[HeaderValue], + serializer: S, +) -> Result +where + S: Serializer, +{ + let strings: Vec = values.iter().map(|v| v.to_str().unwrap().to_string()).collect(); + strings.serialize(serializer) +} + +#[cfg(feature = "server")] +pub fn deserialize_cors_origins<'de, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + let strings: Vec = Vec::deserialize(deserializer)?; + strings + .into_iter() + .map(|s| HeaderValue::from_str(&s).map_err(serde::de::Error::custom)) + .collect() +} \ No newline at end of file diff --git a/crates/cli/src/args.rs b/crates/cli/src/args.rs deleted file mode 100644 index 536f430cf..000000000 --- a/crates/cli/src/args.rs +++ /dev/null @@ -1,788 +0,0 @@ -//! Katana node CLI options and configuration. - -use std::path::PathBuf; -use std::sync::Arc; - -use alloy_primitives::U256; -#[cfg(feature = "server")] -use anyhow::bail; -use anyhow::{Context, Result}; -pub use clap::Parser; -use katana_chain_spec::rollup::ChainConfigDir; -use katana_chain_spec::ChainSpec; -use katana_core::constants::DEFAULT_SEQUENCER_ADDRESS; -use katana_messaging::MessagingConfig; -use katana_node::config::db::DbConfig; -use katana_node::config::dev::{DevConfig, FixedL1GasPriceConfig}; -use katana_node::config::execution::ExecutionConfig; -use katana_node::config::fork::ForkingConfig; -use katana_node::config::metrics::MetricsConfig; -#[cfg(feature = "cartridge")] -use katana_node::config::paymaster::PaymasterConfig; -use katana_node::config::rpc::RpcConfig; -#[cfg(feature = "server")] -use katana_node::config::rpc::{RpcModuleKind, RpcModulesList}; -use katana_node::config::sequencing::SequencingConfig; -use katana_node::config::Config; -use katana_node::Node; -use katana_primitives::genesis::allocation::DevAllocationsGenerator; -use katana_primitives::genesis::constant::DEFAULT_PREFUNDED_ACCOUNT_BALANCE; -use serde::{Deserialize, Serialize}; -use tracing::info; -use url::Url; - -use crate::file::NodeArgsConfig; -use crate::options::*; -use crate::utils::{self, parse_chain_config_dir, parse_seed}; - -pub(crate) const LOG_TARGET: &str = "katana::cli"; - -#[derive(Parser, Debug, Serialize, Deserialize, Default, Clone)] -#[command(next_help_heading = "Node options")] -pub struct NodeArgs { - /// Don't print anything on startup. - #[arg(long)] - pub silent: bool, - - /// Path to the chain configuration file. - #[arg(long, hide = true)] - #[arg(value_parser = parse_chain_config_dir)] - pub chain: Option, - - /// Disable auto and interval mining, and mine on demand instead via an endpoint. - #[arg(long)] - #[arg(conflicts_with = "block_time")] - pub no_mining: bool, - - /// Block time in milliseconds for interval mining. - #[arg(short, long)] - #[arg(value_name = "MILLISECONDS")] - pub block_time: Option, - - #[arg(long = "sequencing.block-max-cairo-steps")] - #[arg(value_name = "TOTAL")] - pub block_cairo_steps_limit: Option, - - /// Directory path of the database to initialize from. - /// - /// The path must either be an empty directory or a directory which already contains a - /// previously initialized Katana database. - #[arg(long)] - #[arg(value_name = "PATH")] - pub db_dir: Option, - - /// Configuration file - #[arg(long)] - pub config: Option, - - /// Configure the messaging with an other chain. - /// - /// Configure the messaging to allow Katana listening/sending messages on a - /// settlement chain that can be Ethereum or an other Starknet sequencer. - #[arg(long)] - #[arg(value_name = "PATH")] - #[arg(value_parser = katana_messaging::MessagingConfig::parse)] - #[arg(conflicts_with = "chain")] - pub messaging: Option, - - #[arg(long = "l1.provider", value_name = "URL", alias = "l1-provider")] - #[arg(help = "The Ethereum RPC provider to sample the gas prices from to enable the gas \ - price oracle.")] - pub l1_provider_url: Option, - - #[command(flatten)] - pub logging: LoggingOptions, - - #[command(flatten)] - pub tracer: TracerOptions, - - #[cfg(feature = "server")] - #[command(flatten)] - pub metrics: MetricsOptions, - - #[cfg(feature = "server")] - #[command(flatten)] - pub server: ServerOptions, - - #[command(flatten)] - pub starknet: StarknetOptions, - - #[command(flatten)] - pub gpo: GasPriceOracleOptions, - - #[command(flatten)] - pub forking: ForkingOptions, - - #[command(flatten)] - pub development: DevOptions, - - #[cfg(feature = "explorer")] - #[command(flatten)] - pub explorer: ExplorerOptions, - - #[cfg(feature = "cartridge")] - #[command(flatten)] - pub cartridge: CartridgeOptions, -} - -impl NodeArgs { - pub async fn execute(&self) -> Result<()> { - // Initialize logging with tracer - let tracer_config = self.tracer_config(); - katana_tracing::init(self.logging.log_format, tracer_config).await?; - self.start_node().await - } - - async fn start_node(&self) -> Result<()> { - // Build the node - let config = self.config()?; - let node = Node::build(config).await.context("failed to build node")?; - - if !self.silent { - utils::print_intro(self, &node.backend().chain_spec); - } - - // Launch the node - let handle = node.launch().await.context("failed to launch node")?; - - // Wait until an OS signal (ie SIGINT, SIGTERM) is received or the node is shutdown. - tokio::select! { - _ = katana_utils::wait_shutdown_signals() => { - // Gracefully shutdown the node before exiting - handle.stop().await?; - }, - - _ = handle.stopped() => { } - } - - info!("Shutting down."); - - Ok(()) - } - - pub fn config(&self) -> Result { - let db = self.db_config(); - let rpc = self.rpc_config()?; - let dev = self.dev_config(); - let (chain, cs_messaging) = self.chain_spec()?; - let metrics = self.metrics_config(); - let forking = self.forking_config()?; - let execution = self.execution_config(); - let sequencing = self.sequencer_config(); - - // the `katana init` will automatically generate a messaging config. so if katana is run - // with `--chain` then the `--messaging` flag is not required. this is temporary and - // the messagign config will eventually be removed slowly. - let messaging = if cs_messaging.is_some() { cs_messaging } else { self.messaging.clone() }; - - #[cfg(feature = "cartridge")] - { - let paymaster = self.cartridge_config(); - - Ok(Config { - db, - dev, - rpc, - chain, - metrics, - forking, - execution, - messaging, - paymaster, - sequencing, - }) - } - - #[cfg(not(feature = "cartridge"))] - Ok(Config { metrics, db, dev, rpc, chain, execution, sequencing, messaging, forking }) - } - - fn sequencer_config(&self) -> SequencingConfig { - SequencingConfig { - block_time: self.block_time, - no_mining: self.no_mining, - block_cairo_steps_limit: self.block_cairo_steps_limit, - } - } - - pub fn rpc_config(&self) -> Result { - #[cfg(feature = "server")] - { - use std::time::Duration; - - #[allow(unused_mut)] - let mut modules = if let Some(modules) = &self.server.http_modules { - // TODO: This check should be handled in the `katana-node` level. Right now if you - // instantiate katana programmatically, you can still add the dev module without - // enabling dev mode. - // - // We only allow the `dev` module in dev mode (ie `--dev` flag) - if !self.development.dev && modules.contains(&RpcModuleKind::Dev) { - bail!("The `dev` module can only be enabled in dev mode (ie `--dev` flag)") - } - - modules.clone() - } else { - // Expose the default modules if none is specified. - let mut modules = RpcModulesList::default(); - - // Ensures the `--dev` flag enabled the dev module. - if self.development.dev { - modules.add(RpcModuleKind::Dev); - } - - modules - }; - - // The cartridge rpc must be enabled if the paymaster is enabled. - // We put it here so that even when the individual api are explicitly specified - // (ie `--rpc.api`) we guarantee that the cartridge rpc is enabled. - #[cfg(feature = "cartridge")] - if self.cartridge.paymaster { - modules.add(RpcModuleKind::Cartridge); - } - - let cors_origins = self.server.http_cors_origins.clone(); - - Ok(RpcConfig { - apis: modules, - port: self.server.http_port, - addr: self.server.http_addr, - max_connections: self.server.max_connections, - max_concurrent_estimate_fee_requests: None, - max_request_body_size: None, - max_response_body_size: None, - timeout: self.server.timeout.map(Duration::from_secs), - cors_origins, - #[cfg(feature = "explorer")] - explorer: self.explorer.explorer, - max_event_page_size: Some(self.server.max_event_page_size), - max_proof_keys: Some(self.server.max_proof_keys), - max_call_gas: Some(self.server.max_call_gas), - }) - } - - #[cfg(not(feature = "server"))] - { - Ok(RpcConfig::default()) - } - } - - fn chain_spec(&self) -> Result<(Arc, Option)> { - if let Some(path) = &self.chain { - let mut cs = katana_chain_spec::rollup::read(path)?; - cs.genesis.sequencer_address = *DEFAULT_SEQUENCER_ADDRESS; - let messaging_config = MessagingConfig::from_chain_spec(&cs); - Ok((Arc::new(ChainSpec::Rollup(cs)), Some(messaging_config))) - } - // exclusively for development mode - else { - let mut chain_spec = katana_chain_spec::dev::DEV_UNALLOCATED.clone(); - - if let Some(id) = self.starknet.environment.chain_id { - chain_spec.id = id; - } - - if let Some(genesis) = &self.starknet.genesis { - chain_spec.genesis = genesis.clone(); - } else { - chain_spec.genesis.sequencer_address = *DEFAULT_SEQUENCER_ADDRESS; - } - - // Generate dev accounts. - // If `cartridge` is enabled, the first account will be the paymaster. - let accounts = DevAllocationsGenerator::new(self.development.total_accounts) - .with_seed(parse_seed(&self.development.seed)) - .with_balance(U256::from(DEFAULT_PREFUNDED_ACCOUNT_BALANCE)) - .generate(); - - chain_spec.genesis.extend_allocations(accounts.into_iter().map(|(k, v)| (k, v.into()))); - - #[cfg(feature = "cartridge")] - if self.cartridge.controllers || self.cartridge.paymaster { - katana_slot_controller::add_controller_classes(&mut chain_spec.genesis); - katana_slot_controller::add_vrf_provider_class(&mut chain_spec.genesis); - } - - Ok((Arc::new(ChainSpec::Dev(chain_spec)), None)) - } - } - - fn dev_config(&self) -> DevConfig { - let mut fixed_gas_prices = None; - - if let Some(eth) = self.gpo.l2_eth_gas_price { - let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l2_gas_prices.eth = eth; - } - - if let Some(strk) = self.gpo.l2_strk_gas_price { - let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l2_gas_prices.strk = strk; - } - - if let Some(eth) = self.gpo.l1_eth_gas_price { - let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_gas_prices.eth = eth; - } - - if let Some(strk) = self.gpo.l1_strk_gas_price { - let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_gas_prices.strk = strk; - } - - if let Some(eth) = self.gpo.l1_eth_data_gas_price { - let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_data_gas_prices.eth = eth; - } - - if let Some(strk) = self.gpo.l1_strk_data_gas_price { - let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_data_gas_prices.strk = strk; - } - - DevConfig { - fixed_gas_prices, - fee: !self.development.no_fee, - account_validation: !self.development.no_account_validation, - } - } - - fn execution_config(&self) -> ExecutionConfig { - ExecutionConfig { - invocation_max_steps: self.starknet.environment.invoke_max_steps, - validation_max_steps: self.starknet.environment.validate_max_steps, - #[cfg(feature = "native")] - compile_native: self.starknet.environment.compile_native, - ..Default::default() - } - } - - fn forking_config(&self) -> Result> { - if let Some(ref url) = self.forking.fork_provider { - let cfg = ForkingConfig { url: url.clone(), block: self.forking.fork_block }; - return Ok(Some(cfg)); - } - - Ok(None) - } - - fn db_config(&self) -> DbConfig { - DbConfig { dir: self.db_dir.clone() } - } - - fn metrics_config(&self) -> Option { - #[cfg(feature = "server")] - if self.metrics.metrics { - Some(MetricsConfig { addr: self.metrics.metrics_addr, port: self.metrics.metrics_port }) - } else { - None - } - - #[cfg(not(feature = "server"))] - None - } - - #[cfg(feature = "cartridge")] - fn cartridge_config(&self) -> Option { - if self.cartridge.paymaster { - Some(PaymasterConfig { cartridge_api_url: self.cartridge.api.clone() }) - } else { - None - } - } - - /// Parse the node config from the command line arguments and the config file, - /// and merge them together prioritizing the command line arguments. - pub fn with_config_file(mut self) -> Result { - let config = if let Some(path) = &self.config { - NodeArgsConfig::read(path)? - } else { - return Ok(self); - }; - - // the CLI (self) takes precedence over the config file. - // Currently, the merge is made at the top level of the commands. - // We may add recursive merging in the future. - - if !self.no_mining { - self.no_mining = config.no_mining.unwrap_or_default(); - } - - if self.block_time.is_none() { - self.block_time = config.block_time; - } - - if self.db_dir.is_none() { - self.db_dir = config.db_dir; - } - - if self.logging == LoggingOptions::default() { - if let Some(logging) = config.logging { - self.logging = logging; - } - } - - if self.messaging.is_none() { - self.messaging = config.messaging; - } - - #[cfg(feature = "server")] - { - self.server.merge(config.server.as_ref()); - - if self.metrics == MetricsOptions::default() { - if let Some(metrics) = config.metrics { - self.metrics = metrics; - } - } - } - - self.starknet.merge(config.starknet.as_ref()); - self.development.merge(config.development.as_ref()); - - if self.gpo == GasPriceOracleOptions::default() { - if let Some(gpo) = config.gpo { - self.gpo = gpo; - } - } - - if self.forking == ForkingOptions::default() { - if let Some(forking) = config.forking { - self.forking = forking; - } - } - - #[cfg(feature = "cartridge")] - { - self.cartridge.merge(config.cartridge.as_ref()); - } - - Ok(self) - } - - fn tracer_config(&self) -> Option { - self.tracer.config() - } -} - -#[cfg(test)] -mod test { - use std::str::FromStr; - - use assert_matches::assert_matches; - use katana_gas_price_oracle::{ - DEFAULT_ETH_L1_DATA_GAS_PRICE, DEFAULT_ETH_L1_GAS_PRICE, DEFAULT_ETH_L2_GAS_PRICE, - DEFAULT_STRK_L1_DATA_GAS_PRICE, DEFAULT_STRK_L1_GAS_PRICE, - }; - use katana_node::config::execution::{ - DEFAULT_INVOCATION_MAX_STEPS, DEFAULT_VALIDATION_MAX_STEPS, - }; - use katana_node::config::rpc::RpcModuleKind; - use katana_primitives::chain::ChainId; - use katana_primitives::{address, felt, ContractAddress, Felt}; - - use super::*; - - #[test] - fn test_starknet_config_default() { - let args = NodeArgs::parse_from(["katana"]); - let config = args.config().unwrap(); - - assert!(config.dev.fee); - assert!(config.dev.account_validation); - assert!(config.forking.is_none()); - assert_eq!(config.execution.invocation_max_steps, DEFAULT_INVOCATION_MAX_STEPS); - assert_eq!(config.execution.validation_max_steps, DEFAULT_VALIDATION_MAX_STEPS); - assert_eq!(config.db.dir, None); - assert_eq!(config.chain.id(), ChainId::parse("KATANA").unwrap()); - assert_eq!(config.chain.genesis().sequencer_address, *DEFAULT_SEQUENCER_ADDRESS); - } - - #[test] - fn test_starknet_config_custom() { - let args = NodeArgs::parse_from([ - "katana", - "--dev", - "--dev.no-fee", - "--dev.no-account-validation", - "--chain-id", - "SN_GOERLI", - "--invoke-max-steps", - "200", - "--validate-max-steps", - "100", - "--db-dir", - "/path/to/db", - ]); - let config = args.config().unwrap(); - - assert!(!config.dev.fee); - assert!(!config.dev.account_validation); - assert_eq!(config.execution.invocation_max_steps, 200); - assert_eq!(config.execution.validation_max_steps, 100); - assert_eq!(config.db.dir, Some(PathBuf::from("/path/to/db"))); - assert_eq!(config.chain.id(), ChainId::GOERLI); - assert_eq!(config.chain.genesis().sequencer_address, *DEFAULT_SEQUENCER_ADDRESS); - } - - #[test] - fn custom_fixed_gas_prices() { - let config = NodeArgs::parse_from(["katana"]).config().unwrap(); - assert!(config.dev.fixed_gas_prices.is_none()); - - let config = - NodeArgs::parse_from(["katana", "--gpo.l1-eth-gas-price", "10"]).config().unwrap(); - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth.get(), 10); - assert_eq!(prices.l1_gas_prices.strk, DEFAULT_ETH_L2_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.eth, DEFAULT_ETH_L1_DATA_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.strk, DEFAULT_STRK_L1_DATA_GAS_PRICE); - }); - - let config = - NodeArgs::parse_from(["katana", "--gpo.l1-strk-gas-price", "20"]).config().unwrap(); - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth, DEFAULT_ETH_L1_GAS_PRICE); - assert_eq!(prices.l1_gas_prices.strk.get(), 20); - assert_eq!(prices.l1_data_gas_prices.eth, DEFAULT_ETH_L1_DATA_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.strk, DEFAULT_STRK_L1_DATA_GAS_PRICE); - }); - - let config = - NodeArgs::parse_from(["katana", "--gpo.l1-eth-data-gas-price", "2"]).config().unwrap(); - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth, DEFAULT_ETH_L1_GAS_PRICE); - assert_eq!(prices.l1_gas_prices.strk, DEFAULT_STRK_L1_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.eth.get(), 2); - assert_eq!(prices.l1_data_gas_prices.strk, DEFAULT_STRK_L1_DATA_GAS_PRICE); - }); - - let config = - NodeArgs::parse_from(["katana", "--gpo.l1-strk-data-gas-price", "2"]).config().unwrap(); - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth, DEFAULT_ETH_L1_GAS_PRICE); - assert_eq!(prices.l1_gas_prices.strk, DEFAULT_STRK_L1_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.eth, DEFAULT_ETH_L1_DATA_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.strk.get(), 2); - }); - - let config = NodeArgs::parse_from([ - "katana", - "--gpo.l1-eth-gas-price", - "10", - "--gpo.l1-strk-data-gas-price", - "2", - ]) - .config() - .unwrap(); - - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth.get(), 10); - assert_eq!(prices.l1_gas_prices.strk, DEFAULT_STRK_L1_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.eth, DEFAULT_ETH_L1_DATA_GAS_PRICE); - assert_eq!(prices.l1_data_gas_prices.strk.get(), 2); - }); - - // Set all the gas prices options - - let config = NodeArgs::parse_from([ - "katana", - "--gpo.l1-eth-gas-price", - "10", - "--gpo.l1-strk-gas-price", - "20", - "--gpo.l1-eth-data-gas-price", - "1", - "--gpo.l1-strk-data-gas-price", - "2", - ]) - .config() - .unwrap(); - - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth.get(), 10); - assert_eq!(prices.l1_gas_prices.strk.get(), 20); - assert_eq!(prices.l1_data_gas_prices.eth.get(), 1); - assert_eq!(prices.l1_data_gas_prices.strk.get(), 2); - }) - } - - #[test] - fn genesis_with_fixed_gas_prices() { - let config = NodeArgs::parse_from([ - "katana", - "--genesis", - "./test-data/genesis.json", - "--gpo.l1-eth-gas-price", - "100", - "--gpo.l1-strk-gas-price", - "200", - "--gpo.l1-eth-data-gas-price", - "111", - "--gpo.l1-strk-data-gas-price", - "222", - ]) - .config() - .unwrap(); - - assert_eq!(config.chain.genesis().number, 0); - assert_eq!(config.chain.genesis().parent_hash, felt!("0x999")); - assert_eq!(config.chain.genesis().timestamp, 5123512314); - assert_eq!(config.chain.genesis().state_root, felt!("0x99")); - assert_eq!(config.chain.genesis().sequencer_address, address!("0x100")); - assert_eq!(config.chain.genesis().gas_prices.eth.get(), 9999); - assert_eq!(config.chain.genesis().gas_prices.strk.get(), 8888); - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth.get(), 100); - assert_eq!(prices.l1_gas_prices.strk.get(), 200); - assert_eq!(prices.l1_data_gas_prices.eth.get(), 111); - assert_eq!(prices.l1_data_gas_prices.strk.get(), 222); - }) - } - - #[test] - fn config_from_file_and_cli() { - // CLI args must take precedence over the config file. - let content = r#" -[gpo] -l1_eth_gas_price = "0xfe" -l1_strk_gas_price = "200" -l1_eth_data_gas_price = "111" -l1_strk_data_gas_price = "222" - -[dev] -total_accounts = 20 - -[starknet.env] -validate_max_steps = 500 -invoke_max_steps = 9988 -chain_id.Named = "Mainnet" - "#; - let path = std::env::temp_dir().join("katana-config.json"); - std::fs::write(&path, content).unwrap(); - - let path_str = path.to_string_lossy().to_string(); - - let args = vec![ - "katana", - "--config", - path_str.as_str(), - "--genesis", - "./test-data/genesis.json", - "--validate-max-steps", - "1234", - "--dev", - "--dev.no-fee", - "--chain-id", - "0x123", - ]; - - let config = - NodeArgs::parse_from(args.clone()).with_config_file().unwrap().config().unwrap(); - - assert_eq!(config.execution.validation_max_steps, 1234); - assert_eq!(config.execution.invocation_max_steps, 9988); - assert!(!config.dev.fee); - assert_matches!(config.dev.fixed_gas_prices, Some(prices) => { - assert_eq!(prices.l1_gas_prices.eth.get(), 254); - assert_eq!(prices.l1_gas_prices.strk.get(), 200); - assert_eq!(prices.l1_data_gas_prices.eth.get(), 111); - assert_eq!(prices.l1_data_gas_prices.strk.get(), 222); - }); - assert_eq!(config.chain.genesis().number, 0); - assert_eq!(config.chain.genesis().parent_hash, felt!("0x999")); - assert_eq!(config.chain.genesis().timestamp, 5123512314); - assert_eq!(config.chain.genesis().state_root, felt!("0x99")); - assert_eq!(config.chain.genesis().sequencer_address, address!("0x100")); - assert_eq!(config.chain.genesis().gas_prices.eth.get(), 9999); - assert_eq!(config.chain.genesis().gas_prices.strk.get(), 8888); - assert_eq!(config.chain.id(), ChainId::Id(Felt::from_str("0x123").unwrap())); - } - - #[test] - #[cfg(feature = "server")] - fn parse_cors_origins() { - use katana_rpc::cors::HeaderValue; - - let config = NodeArgs::parse_from([ - "katana", - "--http.cors_origins", - "*,http://localhost:3000,https://example.com", - ]) - .config() - .unwrap(); - - let cors_origins = config.rpc.cors_origins; - - assert_eq!(cors_origins.len(), 3); - assert!(cors_origins.contains(&HeaderValue::from_static("*"))); - assert!(cors_origins.contains(&HeaderValue::from_static("http://localhost:3000"))); - assert!(cors_origins.contains(&HeaderValue::from_static("https://example.com"))); - } - - #[test] - fn http_modules() { - // If the `--http.api` isn't specified, only starknet module will be exposed. - let config = NodeArgs::parse_from(["katana"]).config().unwrap(); - let modules = config.rpc.apis; - assert_eq!(modules.len(), 1); - assert!(modules.contains(&RpcModuleKind::Starknet)); - - // If the `--http.api` is specified, only the ones in the list will be exposed. - let config = NodeArgs::parse_from(["katana", "--http.api", "starknet"]).config().unwrap(); - let modules = config.rpc.apis; - assert_eq!(modules.len(), 1); - assert!(modules.contains(&RpcModuleKind::Starknet)); - - // Specifiying the dev module without enabling dev mode is forbidden. - let err = - NodeArgs::parse_from(["katana", "--http.api", "starknet,dev"]).config().unwrap_err(); - assert!(err - .to_string() - .contains("The `dev` module can only be enabled in dev mode (ie `--dev` flag)")); - } - - #[test] - fn test_dev_api_enabled() { - let args = NodeArgs::parse_from(["katana", "--dev"]); - let config = args.config().unwrap(); - - assert!(config.rpc.apis.contains(&RpcModuleKind::Dev)); - } - - #[cfg(feature = "cartridge")] - #[test] - fn cartridge_paymaster() { - let args = NodeArgs::parse_from(["katana", "--cartridge.paymaster"]); - let config = args.config().unwrap(); - - // Verify cartridge module is automatically enabled - assert!(config.rpc.apis.contains(&RpcModuleKind::Cartridge)); - - // Test with paymaster explicitly specified in RPC modules - let args = - NodeArgs::parse_from(["katana", "--cartridge.paymaster", "--http.api", "starknet"]); - let config = args.config().unwrap(); - - // Verify cartridge module is still enabled even when not in explicit RPC list - assert!(config.rpc.apis.contains(&RpcModuleKind::Cartridge)); - assert!(config.rpc.apis.contains(&RpcModuleKind::Starknet)); - - // Verify that all the Controller classes are added to the genesis - for (_, class) in katana_slot_controller::CONTROLLERS.iter() { - assert!(config.chain.genesis().classes.get(&class.hash).is_some()); - } - - // Test without paymaster enabled - let args = NodeArgs::parse_from(["katana"]); - let config = args.config().unwrap(); - - // Verify cartridge module is not enabled by default - assert!(!config.rpc.apis.contains(&RpcModuleKind::Cartridge)); - - for (_, class) in katana_slot_controller::CONTROLLERS.iter() { - assert!(config.chain.genesis().classes.get(&class.hash).is_none()); - } - } -} diff --git a/crates/cli/src/file.rs b/crates/cli/src/file.rs deleted file mode 100644 index 9a4dd5809..000000000 --- a/crates/cli/src/file.rs +++ /dev/null @@ -1,87 +0,0 @@ -use std::path::{Path, PathBuf}; - -use anyhow::Result; -use katana_messaging::MessagingConfig; -use serde::{Deserialize, Serialize}; - -use crate::options::*; -use crate::NodeArgs; - -/// Node arguments configuration file. -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct NodeArgsConfig { - pub no_mining: Option, - pub block_time: Option, - pub block_cairo_steps_limit: Option, - pub db_dir: Option, - pub messaging: Option, - pub logging: Option, - pub starknet: Option, - pub gpo: Option, - pub forking: Option, - #[serde(rename = "dev")] - pub development: Option, - #[cfg(feature = "server")] - pub server: Option, - #[cfg(feature = "server")] - pub metrics: Option, - #[cfg(feature = "cartridge")] - pub cartridge: Option, -} - -impl NodeArgsConfig { - pub fn read(path: impl AsRef) -> Result { - let file = std::fs::read_to_string(path)?; - Ok(toml::from_str(&file)?) - } -} - -impl TryFrom for NodeArgsConfig { - type Error = anyhow::Error; - - fn try_from(args: NodeArgs) -> Result { - // Ensure the config file is merged with the CLI arguments. - let args = args.with_config_file()?; - - let mut node_config = NodeArgsConfig { - no_mining: if args.no_mining { Some(true) } else { None }, - block_time: args.block_time, - block_cairo_steps_limit: args.block_cairo_steps_limit, - db_dir: args.db_dir, - messaging: args.messaging, - ..Default::default() - }; - - // Only include the following options if they are not the default. - // This makes the config file more readable. - node_config.logging = - if args.logging == LoggingOptions::default() { None } else { Some(args.logging) }; - node_config.starknet = - if args.starknet == StarknetOptions::default() { None } else { Some(args.starknet) }; - node_config.gpo = - if args.gpo == GasPriceOracleOptions::default() { None } else { Some(args.gpo) }; - node_config.forking = - if args.forking == ForkingOptions::default() { None } else { Some(args.forking) }; - node_config.development = - if args.development == DevOptions::default() { None } else { Some(args.development) }; - - #[cfg(feature = "server")] - { - node_config.server = - if args.server == ServerOptions::default() { None } else { Some(args.server) }; - node_config.metrics = - if args.metrics == MetricsOptions::default() { None } else { Some(args.metrics) }; - } - - #[cfg(feature = "cartridge")] - { - node_config.cartridge = if args.cartridge == CartridgeOptions::default() { - None - } else { - Some(args.cartridge) - }; - } - - Ok(node_config) - } -} diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index b8a2a0a70..169909a6c 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -1,9 +1,318 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] -pub mod args; -pub mod file; -pub mod options; pub mod utils; -pub use args::NodeArgs; -pub use options::*; +use std::sync::Arc; + +use alloy_primitives::U256; +use anyhow::{Context, Result}; +use clap::Parser; +use katana_chain_spec::{rollup::ChainConfigDir, ChainSpec}; +pub use katana_cli_args::{options::*, NodeArgs, NodeArgsConfig}; +use katana_cli_args::{NodeArgs, NodeArgsConfig}; +use katana_core::constants::DEFAULT_SEQUENCER_ADDRESS; +use katana_messaging::MessagingConfig; +use katana_node::config::db::DbConfig; +use katana_node::config::dev::{DevConfig, FixedL1GasPriceConfig}; +use katana_node::config::execution::ExecutionConfig; +use katana_node::config::fork::ForkingConfig; +use katana_node::config::metrics::MetricsConfig; +#[cfg(feature = "cartridge")] +use katana_node::config::paymaster::PaymasterConfig; +use katana_node::config::rpc::RpcConfig; +#[cfg(feature = "server")] +use katana_node::config::rpc::{RpcModuleKind, RpcModulesList}; +use katana_node::config::sequencing::SequencingConfig; +use katana_node::config::Config; +use katana_node::Node; +use katana_primitives::genesis::allocation::DevAllocationsGenerator; +use katana_primitives::genesis::constant::DEFAULT_PREFUNDED_ACCOUNT_BALANCE; +use tracing::info; + +use crate::utils; +use katana_cli_args::utils::parse_seed; + +pub(crate) const LOG_TARGET: &str = "katana::cli"; + +#[derive(Parser, Debug, Serialize, Deserialize, Default, Clone)] +pub struct Cli { + #[command(flatten)] + pub args: NodeArgs, +} + +impl Cli { + async fn execute(&self) -> Result<()> { + // Initialize logging with tracer + let tracer_config = self.tracer_config(); + katana_tracing::init(self.logging.log_format, tracer_config).await?; + start_node(self).await + } + + async fn start_node(&self) -> Result<()> { + // Build the node + let config = self.build_config()?; + let node = Node::build(config).await.context("failed to build node")?; + + if !args.silent { + utils::print_intro(&self.args, &node.backend().chain_spec); + } + + // Launch the node + let handle = node.launch().await.context("failed to launch node")?; + + // Wait until an OS signal (ie SIGINT, SIGTERM) is received or the node is shutdown. + tokio::select! { + _ = katana_utils::wait_shutdown_signals() => { + // Gracefully shutdown the node before exiting + handle.stop().await?; + }, + + _ = handle.stopped() => { } + } + + info!("Shutting down."); + + Ok(()) + } + + pub fn build_config(&self) -> Result { + let db = self.db_config(); + let rpc = self.rpc_config()?; + let dev = self.dev_config(); + let (chain, cs_messaging) = self.chain_spec()?; + let metrics = self.metrics_config(); + let forking = self.forking_config()?; + let execution = self.execution_config(); + let sequencing = self.sequencer_config(); + + // the `katana init` will automatically generate a messaging config. so if katana is run + // with `--chain` then the `--messaging` flag is not required. this is temporary and + // the messagign config will eventually be removed slowly. + let messaging = if cs_messaging.is_some() { cs_messaging } else { args.messaging.clone() }; + + #[cfg(feature = "cartridge")] + { + let paymaster = self.cartridge_config(); + + Ok(Config { + db, + dev, + rpc, + chain, + metrics, + forking, + execution, + messaging, + paymaster, + sequencing, + }) + } + + #[cfg(not(feature = "cartridge"))] + Ok(Config { metrics, db, dev, rpc, chain, execution, sequencing, messaging, forking }) + } + + fn sequencer_config(&self) -> SequencingConfig { + SequencingConfig { + block_time: self.args.block_time, + no_mining: self.args.no_mining, + block_cairo_steps_limit: self.args.block_cairo_steps_limit, + } + } + + pub fn rpc_config(&self) -> Result { + #[cfg(feature = "server")] + { + use std::time::Duration; + + #[allow(unused_mut)] + let mut modules = if let Some(modules) = &self.args.server.http_modules { + // TODO: This check should be handled in the `katana-node` level. Right now if you + // instantiate katana programmatically, you can still add the dev module without + // enabling dev mode. + // + // We only allow the `dev` module in dev mode (ie `--dev` flag) + if !self.args.development.dev && modules.contains(&RpcModuleKind::Dev) { + anyhow::bail!( + "The `dev` module can only be enabled in dev mode (ie `--dev` flag)" + ) + } + + modules.clone() + } else { + // Expose the default modules if none is specified. + let mut modules = RpcModulesList::default(); + + // Ensures the `--dev` flag enabled the dev module. + if self.args.development.dev { + modules.add(RpcModuleKind::Dev); + } + + modules + }; + + // The cartridge rpc must be enabled if the paymaster is enabled. + // We put it here so that even when the individual api are explicitly specified + // (ie `--rpc.api`) we guarantee that the cartridge rpc is enabled. + #[cfg(feature = "cartridge")] + if self.args.cartridge.paymaster { + modules.add(RpcModuleKind::Cartridge); + } + + let cors_origins = self.args.server.http_cors_origins.clone(); + + Ok(RpcConfig { + apis: modules, + port: self.args.server.http_port, + addr: self.args.server.http_addr, + max_connections: self.args.server.max_connections, + max_concurrent_estimate_fee_requests: None, + max_request_body_size: None, + max_response_body_size: None, + timeout: self.args.server.timeout.map(Duration::from_secs), + cors_origins, + #[cfg(feature = "explorer")] + explorer: self.args.explorer.explorer, + max_event_page_size: Some(self.args.server.max_event_page_size), + max_proof_keys: Some(self.args.server.max_proof_keys), + max_call_gas: Some(self.args.server.max_call_gas), + }) + } + + #[cfg(not(feature = "server"))] + { + Ok(RpcConfig::default()) + } + } + + fn chain_spec(&self) -> Result<(Arc, Option)> { + if let Some(path) = &self.args.chain { + let mut cs = katana_chain_spec::rollup::read(path)?; + cs.genesis.sequencer_address = *DEFAULT_SEQUENCER_ADDRESS; + let messaging_config = MessagingConfig::from_chain_spec(&cs); + Ok((Arc::new(ChainSpec::Rollup(cs)), Some(messaging_config))) + } + // exclusively for development mode + else { + let mut chain_spec = katana_chain_spec::dev::DEV_UNALLOCATED.clone(); + + if let Some(id) = self.args.starknet.environment.chain_id { + chain_spec.id = id; + } + + if let Some(genesis) = &self.args.starknet.genesis { + chain_spec.genesis = genesis.clone(); + } else { + chain_spec.genesis.sequencer_address = *DEFAULT_SEQUENCER_ADDRESS; + } + + // Generate dev accounts. + // If `cartridge` is enabled, the first account will be the paymaster. + let accounts = DevAllocationsGenerator::new(self.args.development.total_accounts) + .with_seed(parse_seed(&self.args.development.seed)) + .with_balance(U256::from(DEFAULT_PREFUNDED_ACCOUNT_BALANCE)) + .generate(); + + chain_spec.genesis.extend_allocations(accounts.into_iter().map(|(k, v)| (k, v.into()))); + + #[cfg(feature = "cartridge")] + if self.args.cartridge.controllers || self.args.cartridge.paymaster { + katana_slot_controller::add_controller_classes(&mut chain_spec.genesis); + katana_slot_controller::add_vrf_provider_class(&mut chain_spec.genesis); + } + + Ok((Arc::new(ChainSpec::Dev(chain_spec)), None)) + } + } + + fn dev_config(&self) -> DevConfig { + let mut fixed_gas_prices = None; + + if let Some(eth) = self.args.gpo.l2_eth_gas_price { + let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); + prices.l2_gas_prices.eth = eth; + } + + if let Some(strk) = self.args.gpo.l2_strk_gas_price { + let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); + prices.l2_gas_prices.strk = strk; + } + + if let Some(eth) = self.args.gpo.l1_eth_gas_price { + let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); + prices.l1_gas_prices.eth = eth; + } + + if let Some(strk) = self.args.gpo.l1_strk_gas_price { + let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); + prices.l1_gas_prices.strk = strk; + } + + if let Some(eth) = self.args.gpo.l1_eth_data_gas_price { + let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); + prices.l1_data_gas_prices.eth = eth; + } + + if let Some(strk) = self.args.gpo.l1_strk_data_gas_price { + let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); + prices.l1_data_gas_prices.strk = strk; + } + + DevConfig { + fixed_gas_prices, + fee: !self.args.development.no_fee, + account_validation: !args.development.no_account_validation, + } + } + + fn execution_config(&self) -> ExecutionConfig { + ExecutionConfig { + invocation_max_steps: self.args.starknet.environment.invoke_max_steps, + validation_max_steps: self.args.starknet.environment.validate_max_steps, + #[cfg(feature = "native")] + compile_native: self.args.starknet.environment.compile_native, + ..Default::default() + } + } + + fn forking_config(&self) -> Result> { + if let Some(ref url) = self.args.forking.fork_provider { + let cfg = ForkingConfig { url: url.clone(), block: self.args.forking.fork_block }; + return Ok(Some(cfg)); + } + + Ok(None) + } + + fn db_config(&self) -> DbConfig { + DbConfig { dir: self.args.db_dir.clone() } + } + + fn metrics_config(&self) -> Option { + #[cfg(feature = "server")] + if self.args.metrics.metrics { + Some(MetricsConfig { + addr: self.args.metrics.metrics_addr, + port: self.args.metrics.metrics_port, + }) + } else { + None + } + + #[cfg(not(feature = "server"))] + None + } + + #[cfg(feature = "cartridge")] + fn cartridge_config(&self) -> Option { + if self.args.cartridge.paymaster { + Some(PaymasterConfig { cartridge_api_url: self.args.cartridge.api.clone() }) + } else { + None + } + } + + fn tracer_config(&self) -> Option { + self.args.tracer.config() + } +} diff --git a/crates/cli/src/utils.rs b/crates/cli/src/utils.rs index a1f6cde48..5694c31d2 100644 --- a/crates/cli/src/utils.rs +++ b/crates/cli/src/utils.rs @@ -1,55 +1,16 @@ -use std::path::PathBuf; - -use anyhow::{anyhow, Context, Result}; use console::Style; -use katana_chain_spec::rollup::ChainConfigDir; use katana_chain_spec::ChainSpec; -use katana_primitives::block::{BlockHash, BlockHashOrNumber, BlockNumber}; -use katana_primitives::chain::ChainId; +use katana_cli_args::NodeArgs; use katana_primitives::class::ClassHash; use katana_primitives::contract::ContractAddress; use katana_primitives::genesis::allocation::GenesisAccountAlloc; use katana_primitives::genesis::constant::{ DEFAULT_LEGACY_ERC20_CLASS_HASH, DEFAULT_LEGACY_UDC_CLASS_HASH, DEFAULT_UDC_ADDRESS, }; -use katana_primitives::genesis::json::GenesisJson; -use katana_primitives::genesis::Genesis; -use katana_rpc::cors::HeaderValue; use katana_tracing::LogFormat; -use serde::{Deserialize, Deserializer, Serializer}; use tracing::info; -use crate::args::LOG_TARGET; -use crate::NodeArgs; - -pub fn parse_seed(seed: &str) -> [u8; 32] { - let seed = seed.as_bytes(); - - if seed.len() >= 32 { - unsafe { *(seed[..32].as_ptr() as *const [u8; 32]) } - } else { - let mut actual_seed = [0u8; 32]; - seed.iter().enumerate().for_each(|(i, b)| actual_seed[i] = *b); - actual_seed - } -} - -/// Used as clap value parser for [Genesis]. -pub fn parse_genesis(value: &str) -> Result { - let path = PathBuf::from(shellexpand::full(value)?.into_owned()); - let genesis = Genesis::try_from(GenesisJson::load(path)?)?; - Ok(genesis) -} - -/// If the value starts with `0x`, it is parsed as a [`BlockHash`], otherwise as a [`BlockNumber`]. -pub fn parse_block_hash_or_number(value: &str) -> Result { - if value.starts_with("0x") { - Ok(BlockHashOrNumber::Hash(BlockHash::from_hex(value)?)) - } else { - let num = value.parse::().context("could not parse block number")?; - Ok(BlockHashOrNumber::Num(num)) - } -} +use crate::exec::LOG_TARGET; pub fn print_intro(args: &NodeArgs, chain: &ChainSpec) { let mut accounts = chain.genesis().accounts().peekable(); @@ -98,142 +59,47 @@ ACCOUNTS SEED fn print_genesis_contracts(chain: &ChainSpec, account_class_hash: Option) { match chain { - ChainSpec::Dev(cs) => { + ChainSpec::Dev(_) | ChainSpec::Rollup(_) => { println!( r" -PREDEPLOYED CONTRACTS -================== - -| Contract | ETH Fee Token -| Address | {} -| Class Hash | {:#064x} - -| Contract | STRK Fee Token -| Address | {} -| Class Hash | {:#064x}", - cs.fee_contracts.eth, - DEFAULT_LEGACY_ERC20_CLASS_HASH, - cs.fee_contracts.strk, - DEFAULT_LEGACY_ERC20_CLASS_HASH - ); - } - ChainSpec::Rollup(cs) => { - println!( - r" -PREDEPLOYED CONTRACTS -================== - -| Contract | STRK Fee Token -| Address | {} -| Class Hash | {:#064x}", - cs.fee_contract.strk, DEFAULT_LEGACY_ERC20_CLASS_HASH, +PREFUNDED ACCOUNTS +==================" ); - } - } - - println!( - r" -| Contract | Universal Deployer -| Address | {} -| Class Hash | {:#064x}", - DEFAULT_UDC_ADDRESS, DEFAULT_LEGACY_UDC_CLASS_HASH - ); - if let Some(hash) = account_class_hash { - println!( - r" -| Contract | Account Contract -| Class Hash | {hash:#064x}" - ) + if let Some(hash) = account_class_hash { + println!("Class hash: {:#x}\n", hash); + } + } } } -fn print_genesis_accounts<'a, Accounts>(accounts: Accounts) -where - Accounts: Iterator, -{ - println!( - r" - -PREFUNDED ACCOUNTS -==================" - ); - +fn print_genesis_accounts( + accounts: impl Iterator, +) { for (addr, account) in accounts { if let Some(pk) = account.private_key() { - println!( - r" -| Account address | {addr} -| Private key | {pk:#x} -| Public key | {:#x}", - account.public_key() - ) + println!("| Account address | {addr:#x}"); + println!("| Private key | {pk:#x}"); + println!("| Public key | {:#x}", account.public_key()); } else { - println!( - r" -| Account address | {addr} -| Public key | {:#x}", - account.public_key() - ) + println!("| Account address | {addr:#x}"); + println!("| Public key | {:#x}", account.public_key()); } - } -} -pub fn serialize_cors_origins(values: &[HeaderValue], serializer: S) -> Result -where - S: Serializer, -{ - let string = values - .iter() - .map(|v| v.to_str()) - .collect::, _>>() - .map_err(serde::ser::Error::custom)? - .join(","); - - serializer.serialize_str(&string) -} - -pub fn deserialize_cors_origins<'de, D>(deserializer: D) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - String::deserialize(deserializer)? - .split(',') - .map(|s| s.trim()) - .filter(|s| !s.is_empty()) - .map(HeaderValue::from_str) - .collect::, _>>() - .map_err(serde::de::Error::custom) -} - -// Chain IDs can be arbitrary ASCII strings, making them indistinguishable from filesystem paths. -// To handle this ambiguity, we first try parsing single-component inputs as paths, then as chain -// IDs. Multi-component inputs are always treated as paths. -pub fn parse_chain_config_dir(value: &str) -> Result { - let path = PathBuf::from(value); - - if path.components().count() == 1 { - if path.exists() { - Ok(ChainConfigDir::open(path)?) - } else if let Ok(id) = ChainId::parse(value) { - Ok(ChainConfigDir::open_local(&id)?) - } else { - Err(anyhow!("Invalid path or chain id")) - } - } else { - let path = PathBuf::from(shellexpand::tilde(value).as_ref()); - Ok(ChainConfigDir::open(path)?) + println!(); } -} -#[cfg(test)] -mod tests { - use super::*; + println!( + r" +PREFUNDED CONTRACTS +=================== - #[test] - fn parse_genesis_file() { - let path = "./test-data/genesis.json"; - parse_genesis(path).unwrap(); - } -} +| Contract | Udc +| Address | {DEFAULT_UDC_ADDRESS:#x} +| Class hash | {DEFAULT_LEGACY_UDC_CLASS_HASH:#x} + +| Contract | ERC20 Mock +| Class hash | {DEFAULT_LEGACY_ERC20_CLASS_HASH:#x}", + ); +} \ No newline at end of file From 5840f9ca019b9187ddee4044e8bf5298c6481136 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 3 Sep 2025 15:07:30 -0400 Subject: [PATCH 3/6] save --- .gitignore | 1 - Cargo.lock | 10 ++++- Cargo.toml | 18 +++++---- crates/{ => node}/node-bindings/Cargo.toml | 0 .../node-bindings/benches/startup.rs | 0 crates/{ => node}/node-bindings/src/json.rs | 0 crates/{ => node}/node-bindings/src/lib.rs | 0 .../args => node/node-cli-args}/Cargo.toml | 9 ++--- .../args => node/node-cli-args}/src/file.rs | 0 .../args => node/node-cli-args}/src/lib.rs | 0 .../node-cli-args}/src/options.rs | 40 +++++++++---------- .../args => node/node-cli-args}/src/utils.rs | 11 ++--- crates/{ => node}/node-cli/Cargo.toml | 0 crates/{ => node}/node-cli/src/lib.rs | 16 ++++---- crates/{ => node}/node-cli/src/utils.rs | 0 .../node-cli/test-data/genesis.json | 0 crates/node/node-defaults/Cargo.toml | 9 +++++ crates/node/node-defaults/src/lib.rs | 30 ++++++++++++++ crates/node/{ => node}/Cargo.toml | 1 + crates/node/{ => node}/src/config/db.rs | 0 crates/node/{ => node}/src/config/dev.rs | 0 .../node/{ => node}/src/config/execution.rs | 8 +--- crates/node/{ => node}/src/config/fork.rs | 0 crates/node/{ => node}/src/config/metrics.rs | 7 +--- crates/node/{ => node}/src/config/mod.rs | 0 .../node/{ => node}/src/config/paymaster.rs | 0 crates/node/{ => node}/src/config/rpc.rs | 38 ++++++++++++------ .../node/{ => node}/src/config/sequencing.rs | 0 crates/node/{ => node}/src/exit.rs | 0 crates/node/{ => node}/src/full/exit.rs | 0 crates/node/{ => node}/src/full/mod.rs | 0 crates/node/{ => node}/src/full/node.rs | 0 .../node/{ => node}/src/full/tip_watcher.rs | 0 crates/node/{ => node}/src/lib.rs | 0 crates/primitives/Cargo.toml | 13 +++--- crates/primitives/src/block.rs | 6 +++ crates/primitives/src/lib.rs | 2 +- 37 files changed, 138 insertions(+), 81 deletions(-) rename crates/{ => node}/node-bindings/Cargo.toml (100%) rename crates/{ => node}/node-bindings/benches/startup.rs (100%) rename crates/{ => node}/node-bindings/src/json.rs (100%) rename crates/{ => node}/node-bindings/src/lib.rs (100%) rename crates/{node-cli/args => node/node-cli-args}/Cargo.toml (72%) rename crates/{node-cli/args => node/node-cli-args}/src/file.rs (100%) rename crates/{node-cli/args => node/node-cli-args}/src/lib.rs (100%) rename crates/{node-cli/args => node/node-cli-args}/src/options.rs (95%) rename crates/{node-cli/args => node/node-cli-args}/src/utils.rs (91%) rename crates/{ => node}/node-cli/Cargo.toml (100%) rename crates/{ => node}/node-cli/src/lib.rs (95%) rename crates/{ => node}/node-cli/src/utils.rs (100%) rename crates/{ => node}/node-cli/test-data/genesis.json (100%) create mode 100644 crates/node/node-defaults/Cargo.toml create mode 100644 crates/node/node-defaults/src/lib.rs rename crates/node/{ => node}/Cargo.toml (97%) rename crates/node/{ => node}/src/config/db.rs (100%) rename crates/node/{ => node}/src/config/dev.rs (100%) rename crates/node/{ => node}/src/config/execution.rs (71%) rename crates/node/{ => node}/src/config/fork.rs (100%) rename crates/node/{ => node}/src/config/metrics.rs (64%) rename crates/node/{ => node}/src/config/mod.rs (100%) rename crates/node/{ => node}/src/config/paymaster.rs (100%) rename crates/node/{ => node}/src/config/rpc.rs (87%) rename crates/node/{ => node}/src/config/sequencing.rs (100%) rename crates/node/{ => node}/src/exit.rs (100%) rename crates/node/{ => node}/src/full/exit.rs (100%) rename crates/node/{ => node}/src/full/mod.rs (100%) rename crates/node/{ => node}/src/full/node.rs (100%) rename crates/node/{ => node}/src/full/tip_watcher.rs (100%) rename crates/node/{ => node}/src/lib.rs (100%) diff --git a/.gitignore b/.gitignore index 8ee46c026..856d0f9ec 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ output.txt crates/benches/bench_results.txt **/generated .vscode -bindings justfile spawn-and-move-db types-test-db diff --git a/Cargo.lock b/Cargo.lock index 213fa6cbf..fcbc50b09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5998,6 +5998,7 @@ dependencies = [ "katana-gas-price-oracle", "katana-messaging", "katana-metrics", + "katana-node-defaults", "katana-pipeline", "katana-pool", "katana-primitives", @@ -6072,19 +6073,24 @@ version = "1.7.0-alpha.3" dependencies = [ "anyhow", "clap", + "http 1.3.1", "katana-chain-spec", "katana-messaging", - "katana-node", + "katana-node-defaults", "katana-primitives", - "katana-rpc", "katana-tracing", "serde", "serde_json", "shellexpand", + "starknet-types-core", "toml", "url", ] +[[package]] +name = "katana-node-defaults" +version = "1.7.0-alpha.3" + [[package]] name = "katana-pipeline" version = "1.7.0-alpha.3" diff --git a/Cargo.toml b/Cargo.toml index 9b5aafacd..6a149b20d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,11 @@ members = [ "crates/grpc", "crates/messaging", "crates/metrics", - "crates/node", - "crates/node-bindings", - "crates/node-cli", - "crates/node-cli/args", + "crates/node/node", + "crates/node/node-bindings", + "crates/node/node-cli", + "crates/node/node-cli-args", + "crates/node/node-defaults", "crates/oracle/gas", "crates/pool", "crates/primitives", @@ -77,10 +78,11 @@ katana-fork = { path = "crates/storage/fork" } katana-gas-price-oracle = { path = "crates/oracle/gas" } katana-messaging = { path = "crates/messaging" } katana-metrics = { path = "crates/metrics" } -katana-node = { path = "crates/node" } -katana-node-bindings = { path = "crates/node-bindings" } -katana-node-cli = { path = "crates/node-cli" } -katana-node-cli-args = { path = "crates/node-cli/args" } +katana-node = { path = "crates/node/node" } +katana-node-bindings = { path = "crates/node/node-bindings" } +katana-node-cli = { path = "crates/node/node-cli" } +katana-node-cli-args = { path = "crates/node/node-cli-args" } +katana-node-defaults = { path = "crates/node/node-defaults" } katana-pipeline = { path = "crates/sync/pipeline" } katana-pool = { path = "crates/pool" } katana-primitives = { path = "crates/primitives" } diff --git a/crates/node-bindings/Cargo.toml b/crates/node/node-bindings/Cargo.toml similarity index 100% rename from crates/node-bindings/Cargo.toml rename to crates/node/node-bindings/Cargo.toml diff --git a/crates/node-bindings/benches/startup.rs b/crates/node/node-bindings/benches/startup.rs similarity index 100% rename from crates/node-bindings/benches/startup.rs rename to crates/node/node-bindings/benches/startup.rs diff --git a/crates/node-bindings/src/json.rs b/crates/node/node-bindings/src/json.rs similarity index 100% rename from crates/node-bindings/src/json.rs rename to crates/node/node-bindings/src/json.rs diff --git a/crates/node-bindings/src/lib.rs b/crates/node/node-bindings/src/lib.rs similarity index 100% rename from crates/node-bindings/src/lib.rs rename to crates/node/node-bindings/src/lib.rs diff --git a/crates/node-cli/args/Cargo.toml b/crates/node/node-cli-args/Cargo.toml similarity index 72% rename from crates/node-cli/args/Cargo.toml rename to crates/node/node-cli-args/Cargo.toml index 01faf549c..d4b1f90a4 100644 --- a/crates/node-cli/args/Cargo.toml +++ b/crates/node/node-cli-args/Cargo.toml @@ -9,17 +9,16 @@ version.workspace = true [dependencies] katana-chain-spec.workspace = true katana-messaging.workspace = true +katana-node-defaults.workspace = true katana-primitives.workspace = true katana-tracing.workspace = true -# Only import specific types we need from these crates -katana-node = { workspace = true, default-features = false } -katana-rpc = { workspace = true, optional = true, default-features = false } - anyhow.workspace = true clap.workspace = true +http = { workspace = true, optional = true } serde.workspace = true shellexpand = "3.1.0" +starknet-types-core.workspace = true toml.workspace = true url.workspace = true @@ -31,4 +30,4 @@ cartridge = [ ] default = [ ] explorer = [ ] native = [ ] -server = [ "dep:katana-rpc" ] +server = [ "dep:http" ] diff --git a/crates/node-cli/args/src/file.rs b/crates/node/node-cli-args/src/file.rs similarity index 100% rename from crates/node-cli/args/src/file.rs rename to crates/node/node-cli-args/src/file.rs diff --git a/crates/node-cli/args/src/lib.rs b/crates/node/node-cli-args/src/lib.rs similarity index 100% rename from crates/node-cli/args/src/lib.rs rename to crates/node/node-cli-args/src/lib.rs diff --git a/crates/node-cli/args/src/options.rs b/crates/node/node-cli-args/src/options.rs similarity index 95% rename from crates/node-cli/args/src/options.rs rename to crates/node/node-cli-args/src/options.rs index e09fe1d26..c9d244155 100644 --- a/crates/node-cli/args/src/options.rs +++ b/crates/node/node-cli-args/src/options.rs @@ -12,20 +12,18 @@ use std::net::IpAddr; use std::num::NonZeroU128; use clap::Args; -use katana_node::config::execution::{DEFAULT_INVOCATION_MAX_STEPS, DEFAULT_VALIDATION_MAX_STEPS}; +use katana_node_defaults::execution::{DEFAULT_INVOCATION_MAX_STEPS, DEFAULT_VALIDATION_MAX_STEPS}; #[cfg(feature = "server")] -use katana_node::config::metrics::{DEFAULT_METRICS_ADDR, DEFAULT_METRICS_PORT}; +use katana_node_defaults::metrics::{DEFAULT_METRICS_ADDR, DEFAULT_METRICS_PORT}; #[cfg(feature = "server")] -use katana_node::config::rpc::{RpcModulesList, DEFAULT_RPC_MAX_PROOF_KEYS}; +use katana_node_defaults::rpc::DEFAULT_RPC_MAX_PROOF_KEYS; #[cfg(feature = "server")] -use katana_node::config::rpc::{ +use katana_node_defaults::rpc::{ DEFAULT_RPC_ADDR, DEFAULT_RPC_MAX_CALL_GAS, DEFAULT_RPC_MAX_EVENT_PAGE_SIZE, DEFAULT_RPC_PORT, }; -use katana_primitives::block::{BlockHashOrNumber, GasPrice}; +use katana_primitives::block::BlockHashOrNumber; use katana_primitives::chain::ChainId; use katana_primitives::genesis::Genesis; -#[cfg(feature = "server")] -use katana_rpc::cors::HeaderValue; use katana_tracing::{gcloud, otlp, LogFormat, TracerConfig}; use serde::{Deserialize, Serialize}; use url::Url; @@ -99,13 +97,13 @@ pub struct ServerOptions { serialize_with = "serialize_cors_origins", deserialize_with = "deserialize_cors_origins" )] - pub http_cors_origins: Vec, + pub http_cors_origins: Vec, /// API's offered over the HTTP-RPC interface. #[arg(long = "http.api", value_name = "MODULES")] - #[arg(value_parser = RpcModulesList::parse)] + // #[arg(value_parser = RpcModulesList::parse)] #[serde(default)] - pub http_modules: Option, + pub http_modules: Option>, /// Maximum number of concurrent connections allowed. #[arg(long = "rpc.max-connections", value_name = "MAX")] @@ -390,6 +388,7 @@ pub struct LoggingOptions { #[arg(default_value_t = LogFormat::Full)] pub log_format: LogFormat, } + #[derive(Debug, Args, Default, Clone, Serialize, Deserialize, PartialEq)] #[command(next_help_heading = "Gas Price Oracle Options")] pub struct GasPriceOracleOptions { @@ -398,42 +397,42 @@ pub struct GasPriceOracleOptions { #[serde(serialize_with = "serialize_option_as_hex")] #[serde(deserialize_with = "deserialize_gas_price")] #[serde(default)] - pub l2_eth_gas_price: Option, + pub l2_eth_gas_price: Option, /// The L2 STRK gas price. (denominated in fri) #[arg(long = "gpo.l2-strk-gas-price", value_name = "FRI")] #[serde(serialize_with = "serialize_option_as_hex")] #[serde(deserialize_with = "deserialize_gas_price")] #[serde(default)] - pub l2_strk_gas_price: Option, + pub l2_strk_gas_price: Option, /// The L1 ETH gas price. (denominated in wei) #[arg(long = "gpo.l1-eth-gas-price", value_name = "WEI")] #[serde(serialize_with = "serialize_option_as_hex")] #[serde(default)] #[serde(deserialize_with = "deserialize_gas_price")] - pub l1_eth_gas_price: Option, + pub l1_eth_gas_price: Option, /// The L1 STRK gas price. (denominated in fri) #[arg(long = "gpo.l1-strk-gas-price", value_name = "FRI")] #[serde(serialize_with = "serialize_option_as_hex")] #[serde(deserialize_with = "deserialize_gas_price")] #[serde(default)] - pub l1_strk_gas_price: Option, + pub l1_strk_gas_price: Option, /// The L1 ETH data gas price. (denominated in wei) #[arg(long = "gpo.l1-eth-data-gas-price", value_name = "WEI")] #[serde(serialize_with = "serialize_option_as_hex")] #[serde(deserialize_with = "deserialize_gas_price")] #[serde(default)] - pub l1_eth_data_gas_price: Option, + pub l1_eth_data_gas_price: Option, /// The L1 STRK data gas price. (denominated in fri) #[arg(long = "gpo.l1-strk-data-gas-price", value_name = "FRI")] #[serde(serialize_with = "serialize_option_as_hex")] #[serde(deserialize_with = "deserialize_gas_price")] #[serde(default)] - pub l1_strk_data_gas_price: Option, + pub l1_strk_data_gas_price: Option, } #[cfg(feature = "cartridge")] @@ -543,7 +542,7 @@ fn default_page_size() -> u64 { #[cfg(feature = "server")] fn default_proof_keys() -> u64 { - katana_node::config::rpc::DEFAULT_RPC_MAX_PROOF_KEYS + katana_node_defaults::rpc::DEFAULT_RPC_MAX_PROOF_KEYS } #[cfg(feature = "server")] @@ -562,7 +561,7 @@ fn default_max_call_gas() -> u64 { } /// Deserialize a string (hex or decimal) into a [`GasPrice`] -fn deserialize_gas_price<'de, D>(deserializer: D) -> Result, D::Error> +fn deserialize_gas_price<'de, D>(deserializer: D) -> Result, D::Error> where D: serde::Deserializer<'de>, { @@ -579,10 +578,7 @@ where u128::from_str(&s).map_err(D::Error::custom)? }; - NonZeroU128::new(value) - .map(GasPrice::new) - .map(Some) - .ok_or_else(|| D::Error::custom("value cannot be zero")) + NonZeroU128::new(value).map(Some).ok_or_else(|| D::Error::custom("gas price cannot be zero")) } fn serialize_option_as_hex( diff --git a/crates/node-cli/args/src/utils.rs b/crates/node/node-cli-args/src/utils.rs similarity index 91% rename from crates/node-cli/args/src/utils.rs rename to crates/node/node-cli-args/src/utils.rs index 91805fa49..4c2f8edb2 100644 --- a/crates/node-cli/args/src/utils.rs +++ b/crates/node/node-cli-args/src/utils.rs @@ -6,8 +6,6 @@ use katana_primitives::block::{BlockHash, BlockHashOrNumber, BlockNumber}; use katana_primitives::chain::ChainId; use katana_primitives::genesis::json::GenesisJson; use katana_primitives::genesis::Genesis; -#[cfg(feature = "server")] -use katana_rpc::cors::HeaderValue; use serde::{Deserialize, Deserializer, Serializer}; pub fn parse_seed(seed: &str) -> [u8; 32] { @@ -60,7 +58,10 @@ pub fn parse_chain_config_dir(value: &str) -> Result { } #[cfg(feature = "server")] -pub fn serialize_cors_origins(values: &[HeaderValue], serializer: S) -> Result +pub fn serialize_cors_origins( + values: &[http::HeaderValue], + serializer: S, +) -> Result where S: Serializer, { @@ -71,14 +72,14 @@ where } #[cfg(feature = "server")] -pub fn deserialize_cors_origins<'de, D>(deserializer: D) -> Result, D::Error> +pub fn deserialize_cors_origins<'de, D>(deserializer: D) -> Result, D::Error> where D: Deserializer<'de>, { let strings: Vec = Vec::deserialize(deserializer)?; strings .into_iter() - .map(|s| HeaderValue::from_str(&s).map_err(serde::de::Error::custom)) + .map(|s| http::HeaderValue::from_str(&s).map_err(serde::de::Error::custom)) .collect() } diff --git a/crates/node-cli/Cargo.toml b/crates/node/node-cli/Cargo.toml similarity index 100% rename from crates/node-cli/Cargo.toml rename to crates/node/node-cli/Cargo.toml diff --git a/crates/node-cli/src/lib.rs b/crates/node/node-cli/src/lib.rs similarity index 95% rename from crates/node-cli/src/lib.rs rename to crates/node/node-cli/src/lib.rs index dcf0f8424..fda02173e 100644 --- a/crates/node-cli/src/lib.rs +++ b/crates/node/node-cli/src/lib.rs @@ -139,7 +139,9 @@ impl Cli { use std::time::Duration; #[allow(unused_mut)] - let mut modules = if let Some(modules) = &self.args.server.http_modules { + let mut modules = if let Some(modules_str) = &self.args.server.http_modules { + let modules = RpcModulesList::parse_from_iter(modules_str)?; + // TODO: This check should be handled in the `katana-node` level. Right now if you // instantiate katana programmatically, you can still add the dev module without // enabling dev mode. @@ -243,32 +245,32 @@ impl Cli { if let Some(eth) = self.args.gpo.l2_eth_gas_price { let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l2_gas_prices.eth = eth; + prices.l2_gas_prices.eth = eth.into(); } if let Some(strk) = self.args.gpo.l2_strk_gas_price { let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l2_gas_prices.strk = strk; + prices.l2_gas_prices.strk = strk.into(); } if let Some(eth) = self.args.gpo.l1_eth_gas_price { let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_gas_prices.eth = eth; + prices.l1_gas_prices.eth = eth.into(); } if let Some(strk) = self.args.gpo.l1_strk_gas_price { let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_gas_prices.strk = strk; + prices.l1_gas_prices.strk = strk.into(); } if let Some(eth) = self.args.gpo.l1_eth_data_gas_price { let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_data_gas_prices.eth = eth; + prices.l1_data_gas_prices.eth = eth.into(); } if let Some(strk) = self.args.gpo.l1_strk_data_gas_price { let prices = fixed_gas_prices.get_or_insert(FixedL1GasPriceConfig::default()); - prices.l1_data_gas_prices.strk = strk; + prices.l1_data_gas_prices.strk = strk.into(); } DevConfig { diff --git a/crates/node-cli/src/utils.rs b/crates/node/node-cli/src/utils.rs similarity index 100% rename from crates/node-cli/src/utils.rs rename to crates/node/node-cli/src/utils.rs diff --git a/crates/node-cli/test-data/genesis.json b/crates/node/node-cli/test-data/genesis.json similarity index 100% rename from crates/node-cli/test-data/genesis.json rename to crates/node/node-cli/test-data/genesis.json diff --git a/crates/node/node-defaults/Cargo.toml b/crates/node/node-defaults/Cargo.toml new file mode 100644 index 000000000..16d835f6a --- /dev/null +++ b/crates/node/node-defaults/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "katana-node-defaults" +edition.workspace = true +license.workspace = true +license-file.workspace = true +repository.workspace = true +version.workspace = true + +[dependencies] diff --git a/crates/node/node-defaults/src/lib.rs b/crates/node/node-defaults/src/lib.rs new file mode 100644 index 000000000..63c579d43 --- /dev/null +++ b/crates/node/node-defaults/src/lib.rs @@ -0,0 +1,30 @@ +pub mod rpc { + use std::net::{IpAddr, Ipv4Addr}; + + /// Default RPC server address. + pub const DEFAULT_RPC_ADDR: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); + /// Default RPC server port. + pub const DEFAULT_RPC_PORT: u16 = 5050; + /// Default maximmum page size for the `starknet_getEvents` RPC method. + pub const DEFAULT_RPC_MAX_EVENT_PAGE_SIZE: u64 = 1024; + /// Default maximmum number of keys for the `starknet_getStorageProof` RPC method. + pub const DEFAULT_RPC_MAX_PROOF_KEYS: u64 = 100; + /// Default maximum gas for the `starknet_call` RPC method. + pub const DEFAULT_RPC_MAX_CALL_GAS: u64 = 1_000_000_000; +} + +pub mod metrics { + use std::net::{IpAddr, Ipv4Addr}; + + /// Metrics server default address. + pub const DEFAULT_METRICS_ADDR: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); + /// Metrics server default port. + pub const DEFAULT_METRICS_PORT: u16 = 9100; +} + +pub mod execution { + pub const MAX_RECURSION_DEPTH: usize = 1000; + pub const DEFAULT_INVOCATION_MAX_STEPS: u32 = 10_000_000; + pub const DEFAULT_VALIDATION_MAX_STEPS: u32 = 1_000_000; + pub const DEFAULT_ENABLE_NATIVE_COMPILATION: bool = false; +} diff --git a/crates/node/Cargo.toml b/crates/node/node/Cargo.toml similarity index 97% rename from crates/node/Cargo.toml rename to crates/node/node/Cargo.toml index b87703851..6fe49523c 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/node/Cargo.toml @@ -13,6 +13,7 @@ katana-executor.workspace = true katana-gas-price-oracle.workspace = true katana-messaging.workspace = true katana-metrics.workspace = true +katana-node-defaults.workspace = true katana-pipeline.workspace = true katana-pool.workspace = true katana-primitives.workspace = true diff --git a/crates/node/src/config/db.rs b/crates/node/node/src/config/db.rs similarity index 100% rename from crates/node/src/config/db.rs rename to crates/node/node/src/config/db.rs diff --git a/crates/node/src/config/dev.rs b/crates/node/node/src/config/dev.rs similarity index 100% rename from crates/node/src/config/dev.rs rename to crates/node/node/src/config/dev.rs diff --git a/crates/node/src/config/execution.rs b/crates/node/node/src/config/execution.rs similarity index 71% rename from crates/node/src/config/execution.rs rename to crates/node/node/src/config/execution.rs index 5e1b52620..ef2e05053 100644 --- a/crates/node/src/config/execution.rs +++ b/crates/node/node/src/config/execution.rs @@ -1,10 +1,4 @@ -pub const MAX_RECURSION_DEPTH: usize = 1000; - -pub const DEFAULT_INVOCATION_MAX_STEPS: u32 = 10_000_000; -pub const DEFAULT_VALIDATION_MAX_STEPS: u32 = 1_000_000; - -#[cfg(feature = "native")] -pub const DEFAULT_ENABLE_NATIVE_COMPILATION: bool = false; +pub use katana_node_defaults::execution::*; #[derive(Debug, Clone)] pub struct ExecutionConfig { diff --git a/crates/node/src/config/fork.rs b/crates/node/node/src/config/fork.rs similarity index 100% rename from crates/node/src/config/fork.rs rename to crates/node/node/src/config/fork.rs diff --git a/crates/node/src/config/metrics.rs b/crates/node/node/src/config/metrics.rs similarity index 64% rename from crates/node/src/config/metrics.rs rename to crates/node/node/src/config/metrics.rs index ddceb8480..aaeb9e8de 100644 --- a/crates/node/src/config/metrics.rs +++ b/crates/node/node/src/config/metrics.rs @@ -1,9 +1,6 @@ -use std::net::{IpAddr, Ipv4Addr, SocketAddr}; +use std::net::{IpAddr, SocketAddr}; -/// Metrics server default address. -pub const DEFAULT_METRICS_ADDR: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); -/// Metrics server default port. -pub const DEFAULT_METRICS_PORT: u16 = 9100; +pub use katana_node_defaults::metrics::*; /// Node metrics configurations. #[derive(Debug, Copy, Clone)] diff --git a/crates/node/src/config/mod.rs b/crates/node/node/src/config/mod.rs similarity index 100% rename from crates/node/src/config/mod.rs rename to crates/node/node/src/config/mod.rs diff --git a/crates/node/src/config/paymaster.rs b/crates/node/node/src/config/paymaster.rs similarity index 100% rename from crates/node/src/config/paymaster.rs rename to crates/node/node/src/config/paymaster.rs diff --git a/crates/node/src/config/rpc.rs b/crates/node/node/src/config/rpc.rs similarity index 87% rename from crates/node/src/config/rpc.rs rename to crates/node/node/src/config/rpc.rs index 2299f3327..78e05c132 100644 --- a/crates/node/src/config/rpc.rs +++ b/crates/node/node/src/config/rpc.rs @@ -1,20 +1,11 @@ use std::collections::HashSet; -use std::net::{IpAddr, Ipv4Addr, SocketAddr}; +use std::net::{IpAddr, SocketAddr}; use std::time::Duration; +pub use katana_node_defaults::rpc::*; use katana_rpc::cors::HeaderValue; use serde::{Deserialize, Serialize}; -pub const DEFAULT_RPC_ADDR: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); -pub const DEFAULT_RPC_PORT: u16 = 5050; - -/// Default maximmum page size for the `starknet_getEvents` RPC method. -pub const DEFAULT_RPC_MAX_EVENT_PAGE_SIZE: u64 = 1024; -/// Default maximmum number of keys for the `starknet_getStorageProof` RPC method. -pub const DEFAULT_RPC_MAX_PROOF_KEYS: u64 = 100; -/// Default maximum gas for the `starknet_call` RPC method. -pub const DEFAULT_RPC_MAX_CALL_GAS: u64 = 1_000_000_000; - /// List of RPC modules supported by Katana. #[derive( Debug, @@ -127,6 +118,30 @@ impl RpcModulesList { self.0.is_empty() } + /// Parses from an iterator of strings. + pub fn parse_from_iter(iter: I) -> Result + where + I: IntoIterator, + S: AsRef, + { + let mut modules = HashSet::new(); + for module_name in iter { + let trimmed_module_name = module_name.as_ref().trim(); + + if trimmed_module_name.is_empty() { + continue; + } + + let module: RpcModuleKind = trimmed_module_name + .parse() + .map_err(|_| InvalidRpcModuleError(trimmed_module_name.to_string()))?; + + modules.insert(module); + } + + Ok(Self(modules)) + } + /// Used as the value parser for `clap`. pub fn parse(value: &str) -> Result { if value.is_empty() { @@ -157,7 +172,6 @@ impl Default for RpcModulesList { Self(HashSet::from([RpcModuleKind::Starknet])) } } - #[cfg(test)] mod tests { use super::*; diff --git a/crates/node/src/config/sequencing.rs b/crates/node/node/src/config/sequencing.rs similarity index 100% rename from crates/node/src/config/sequencing.rs rename to crates/node/node/src/config/sequencing.rs diff --git a/crates/node/src/exit.rs b/crates/node/node/src/exit.rs similarity index 100% rename from crates/node/src/exit.rs rename to crates/node/node/src/exit.rs diff --git a/crates/node/src/full/exit.rs b/crates/node/node/src/full/exit.rs similarity index 100% rename from crates/node/src/full/exit.rs rename to crates/node/node/src/full/exit.rs diff --git a/crates/node/src/full/mod.rs b/crates/node/node/src/full/mod.rs similarity index 100% rename from crates/node/src/full/mod.rs rename to crates/node/node/src/full/mod.rs diff --git a/crates/node/src/full/node.rs b/crates/node/node/src/full/node.rs similarity index 100% rename from crates/node/src/full/node.rs rename to crates/node/node/src/full/node.rs diff --git a/crates/node/src/full/tip_watcher.rs b/crates/node/node/src/full/tip_watcher.rs similarity index 100% rename from crates/node/src/full/tip_watcher.rs rename to crates/node/node/src/full/tip_watcher.rs diff --git a/crates/node/src/lib.rs b/crates/node/node/src/lib.rs similarity index 100% rename from crates/node/src/lib.rs rename to crates/node/node/src/lib.rs diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 0d54e567f..895b19ce9 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -10,10 +10,7 @@ version.workspace = true anyhow.workspace = true arbitrary = { workspace = true, optional = true } base64.workspace = true -blockifier = { workspace = true, features = [ "testing" ] } # some Clone derives are gated behind 'testing' feature cainome-cairo-serde.workspace = true -cairo-lang-starknet-classes.workspace = true -cairo-vm.workspace = true derive_more.workspace = true heapless = { version = "0.8.0", features = [ "serde" ] } lazy_static.workspace = true @@ -25,7 +22,6 @@ serde_with.workspace = true starknet.workspace = true starknet-crypto.workspace = true starknet-types-core.workspace = true -starknet_api.workspace = true thiserror.workspace = true alloy-primitives = { workspace = true, features = [ "arbitrary" ] } @@ -34,6 +30,12 @@ serde_json_pythonic = "0.1.2" strum.workspace = true strum_macros.workspace = true +# some Clone derives are gated behind 'testing' feature +blockifier = { workspace = true, features = [ "testing" ] } +cairo-lang-starknet-classes.workspace = true +cairo-vm.workspace = true +starknet_api.workspace = true + [dev-dependencies] assert_matches.workspace = true postcard.workspace = true @@ -44,13 +46,12 @@ criterion.workspace = true pprof.workspace = true [features] -default = [ "serde" ] - arbitrary = [ "alloy-primitives/arbitrary", "cairo-vm/test_utils", "dep:arbitrary", ] +default = [ "serde" ] serde = [ "alloy-primitives/serde", "blockifier/transaction_serde" ] [[bench]] diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index 56fbe4024..113e32efd 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -111,6 +111,12 @@ impl LowerHex for GasPrice { } } +impl From for GasPrice { + fn from(value: NonZeroU128) -> Self { + Self(value) + } +} + #[derive(thiserror::Error, Debug)] #[error("gas price cannot be zero")] pub struct GasPriceIsZeroError; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index d5a276560..2149c4ae1 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -20,8 +20,8 @@ pub mod version; pub mod state; pub mod utils; +pub use ::starknet::macros::felt; pub use alloy_primitives::U256; pub use contract::ContractAddress; -pub use starknet::macros::felt; pub use starknet_types_core::felt::{Felt, FromStrError}; pub use starknet_types_core::hash; From e587ceb4f2752efda961e58ae5a54f455c8a7f2f Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 3 Sep 2025 15:43:05 -0400 Subject: [PATCH 4/6] remove messaging config from cli --- Cargo.lock | 2 -- crates/node/node-cli-args/Cargo.toml | 2 -- crates/node/node-cli-args/src/file.rs | 9 +++++--- crates/node/node-cli-args/src/lib.rs | 29 +++++++++++++----------- crates/node/node-cli-args/src/options.rs | 11 +++++++++ crates/node/node-cli/src/lib.rs | 12 +++++----- 6 files changed, 39 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcbc50b09..0833dcb0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6075,14 +6075,12 @@ dependencies = [ "clap", "http 1.3.1", "katana-chain-spec", - "katana-messaging", "katana-node-defaults", "katana-primitives", "katana-tracing", "serde", "serde_json", "shellexpand", - "starknet-types-core", "toml", "url", ] diff --git a/crates/node/node-cli-args/Cargo.toml b/crates/node/node-cli-args/Cargo.toml index d4b1f90a4..8d930ffb2 100644 --- a/crates/node/node-cli-args/Cargo.toml +++ b/crates/node/node-cli-args/Cargo.toml @@ -8,7 +8,6 @@ version.workspace = true [dependencies] katana-chain-spec.workspace = true -katana-messaging.workspace = true katana-node-defaults.workspace = true katana-primitives.workspace = true katana-tracing.workspace = true @@ -18,7 +17,6 @@ clap.workspace = true http = { workspace = true, optional = true } serde.workspace = true shellexpand = "3.1.0" -starknet-types-core.workspace = true toml.workspace = true url.workspace = true diff --git a/crates/node/node-cli-args/src/file.rs b/crates/node/node-cli-args/src/file.rs index 0315d0a11..31c7d6215 100644 --- a/crates/node/node-cli-args/src/file.rs +++ b/crates/node/node-cli-args/src/file.rs @@ -1,7 +1,7 @@ use std::path::{Path, PathBuf}; use anyhow::Result; -use katana_messaging::MessagingConfig; +// use katana_messaging::MessagingConfig; use serde::{Deserialize, Serialize}; use crate::options::*; @@ -14,8 +14,9 @@ pub struct NodeArgsConfig { pub block_time: Option, pub block_cairo_steps_limit: Option, pub db_dir: Option, - pub messaging: Option, + // pub messaging: Option, pub logging: Option, + pub messaging: Option, pub starknet: Option, pub gpo: Option, pub forking: Option, @@ -48,12 +49,14 @@ impl TryFrom for NodeArgsConfig { block_time: args.block_time, block_cairo_steps_limit: args.block_cairo_steps_limit, db_dir: args.db_dir, - messaging: args.messaging, + // messaging: args.messaging, ..Default::default() }; // Only include the following options if they are not the default. // This makes the config file more readable. + node_config.messaging = + if args.messaging == MessagingOptions::default() { None } else { Some(args.messaging) }; node_config.logging = if args.logging == LoggingOptions::default() { None } else { Some(args.logging) }; node_config.starknet = diff --git a/crates/node/node-cli-args/src/lib.rs b/crates/node/node-cli-args/src/lib.rs index 36f839bc7..8bf42c124 100644 --- a/crates/node/node-cli-args/src/lib.rs +++ b/crates/node/node-cli-args/src/lib.rs @@ -5,7 +5,6 @@ use std::path::PathBuf; use anyhow::Result; use clap::Parser; use katana_chain_spec::rollup::ChainConfigDir; -use katana_messaging::MessagingConfig; use serde::{Deserialize, Serialize}; use url::Url; @@ -55,21 +54,23 @@ pub struct NodeArgs { #[arg(long)] pub config: Option, - /// Configure the messaging with an other chain. - /// - /// Configure the messaging to allow Katana listening/sending messages on a - /// settlement chain that can be Ethereum or an other Starknet sequencer. - #[arg(long)] - #[arg(value_name = "PATH")] - #[arg(value_parser = katana_messaging::MessagingConfig::parse)] - #[arg(conflicts_with = "chain")] - pub messaging: Option, - + // /// Configure the messaging with an other chain. + // /// + // /// Configure the messaging to allow Katana listening/sending messages on a + // /// settlement chain that can be Ethereum or an other Starknet sequencer. + // #[arg(long)] + // #[arg(value_name = "PATH")] + // #[arg(value_parser = katana_messaging::MessagingConfig::parse)] + // #[arg(conflicts_with = "chain")] + // pub messaging: Option, #[arg(long = "l1.provider", value_name = "URL", alias = "l1-provider")] #[arg(help = "The Ethereum RPC provider to sample the gas prices from to enable the gas \ price oracle.")] pub l1_provider_url: Option, + #[command(flatten)] + pub messaging: MessagingOptions, + #[command(flatten)] pub logging: LoggingOptions, @@ -137,8 +138,10 @@ impl NodeArgs { } } - if self.messaging.is_none() { - self.messaging = config.messaging; + if self.messaging == MessagingOptions::default() { + if let Some(messaging) = config.messaging { + self.messaging = messaging; + } } #[cfg(feature = "server")] diff --git a/crates/node/node-cli-args/src/options.rs b/crates/node/node-cli-args/src/options.rs index c9d244155..69185b1dc 100644 --- a/crates/node/node-cli-args/src/options.rs +++ b/crates/node/node-cli-args/src/options.rs @@ -666,3 +666,14 @@ impl TracerOptions { self } } + +#[derive(Debug, Default, Args, Clone, Serialize, Deserialize, PartialEq)] +#[command(next_help_heading = "Messaging options")] +pub struct MessagingOptions { + /// Frequency (in seconds) of message collection. + /// + /// This controls how often messages are collected from the settlement chain. + #[arg(long = "messaging.interval")] + #[serde(default)] + pub interval: u64, +} diff --git a/crates/node/node-cli/src/lib.rs b/crates/node/node-cli/src/lib.rs index fda02173e..ce1017887 100644 --- a/crates/node/node-cli/src/lib.rs +++ b/crates/node/node-cli/src/lib.rs @@ -91,17 +91,17 @@ impl Cli { let db = self.db_config(); let rpc = self.rpc_config()?; let dev = self.dev_config(); - let (chain, cs_messaging) = self.chain_spec()?; + let (chain, messaging) = self.chain_spec()?; let metrics = self.metrics_config(); let forking = self.forking_config()?; let execution = self.execution_config(); let sequencing = self.sequencer_config(); - // the `katana init` will automatically generate a messaging config. so if katana is run - // with `--chain` then the `--messaging` flag is not required. this is temporary and - // the messagign config will eventually be removed slowly. - let messaging = - if cs_messaging.is_some() { cs_messaging } else { self.args.messaging.clone() }; + // // the `katana init` will automatically generate a messaging config. so if katana is run + // // with `--chain` then the `--messaging` flag is not required. this is temporary and + // // the messagign config will eventually be removed slowly. + // let messaging = + // if cs_messaging.is_some() { cs_messaging } else { self.args.messaging.clone() }; #[cfg(feature = "cartridge")] { From 2aec3bcb3ead6c270ca861ad97323c0b28e24ad8 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 3 Sep 2025 17:29:07 -0400 Subject: [PATCH 5/6] save --- crates/node/node-cli-args/src/file.rs | 1 - crates/node/node-cli-args/src/lib.rs | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/node/node-cli-args/src/file.rs b/crates/node/node-cli-args/src/file.rs index 31c7d6215..11432f645 100644 --- a/crates/node/node-cli-args/src/file.rs +++ b/crates/node/node-cli-args/src/file.rs @@ -14,7 +14,6 @@ pub struct NodeArgsConfig { pub block_time: Option, pub block_cairo_steps_limit: Option, pub db_dir: Option, - // pub messaging: Option, pub logging: Option, pub messaging: Option, pub starknet: Option, diff --git a/crates/node/node-cli-args/src/lib.rs b/crates/node/node-cli-args/src/lib.rs index 8bf42c124..523b8b033 100644 --- a/crates/node/node-cli-args/src/lib.rs +++ b/crates/node/node-cli-args/src/lib.rs @@ -6,7 +6,6 @@ use anyhow::Result; use clap::Parser; use katana_chain_spec::rollup::ChainConfigDir; use serde::{Deserialize, Serialize}; -use url::Url; pub mod file; pub mod options; @@ -63,11 +62,10 @@ pub struct NodeArgs { // #[arg(value_parser = katana_messaging::MessagingConfig::parse)] // #[arg(conflicts_with = "chain")] // pub messaging: Option, - #[arg(long = "l1.provider", value_name = "URL", alias = "l1-provider")] - #[arg(help = "The Ethereum RPC provider to sample the gas prices from to enable the gas \ - price oracle.")] - pub l1_provider_url: Option, - + // #[arg(long = "l1.provider", value_name = "URL", alias = "l1-provider")] + // #[arg(help = "The Ethereum RPC provider to sample the gas prices from to enable the gas \ + // price oracle.")] + // pub l1_provider_url: Option, #[command(flatten)] pub messaging: MessagingOptions, From c2b63df53593190dc90b756cd10368d5ecd089f2 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Mon, 8 Sep 2025 23:38:12 -0400 Subject: [PATCH 6/6] revert blockifier bump --- Cargo.lock | 431 ++++++++++-------- Cargo.toml | 22 +- .../src/implementation/blockifier/mod.rs | 9 +- .../src/implementation/blockifier/utils.rs | 1 - crates/executor/src/utils.rs | 12 +- crates/node/node-cli-args/Cargo.toml | 1 + crates/node/node-cli/Cargo.toml | 1 - 7 files changed, 251 insertions(+), 226 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd54b4f20..0168bb66c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -760,86 +760,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] -name = "apollo_compilation_utils" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +name = "apollo_config" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ "apollo_infra_utils", - "cairo-lang-sierra", - "cairo-lang-starknet-classes", - "cairo-lang-utils", - "rlimit", + "clap", + "itertools 0.12.1", "serde", "serde_json", - "starknet-types-core", - "starknet_api", - "tempfile", + "strum_macros 0.25.3", "thiserror 1.0.69", -] - -[[package]] -name = "apollo_compile_to_native" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" -dependencies = [ - "apollo_compilation_utils", - "apollo_compile_to_native_types", - "apollo_infra_utils", - "cairo-lang-starknet-classes", - "cairo-native", - "tempfile", -] - -[[package]] -name = "apollo_compile_to_native_types" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" -dependencies = [ - "apollo_config", - "serde", + "tracing", "validator", ] [[package]] -name = "apollo_config" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +name = "apollo_infra" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ + "apollo_config", "apollo_infra_utils", - "clap", - "const_format", - "itertools 0.12.1", + "apollo_metrics", + "async-trait", + "hyper 0.14.32", + "rstest 0.17.0", "serde", "serde_json", - "strum_macros 0.25.3", + "starknet_api", "thiserror 1.0.69", + "time", + "tokio", + "tower 0.4.13", "tracing", - "url", + "tracing-subscriber", "validator", ] [[package]] name = "apollo_infra_utils" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ - "apollo_proc_macros", "assert-json-diff", + "cached", "colored 3.0.0", - "num_enum", "serde", "serde_json", "socket2 0.5.10", - "tempfile", - "thiserror 1.0.69", "tokio", + "toml", "tracing", ] [[package]] name = "apollo_metrics" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ "indexmap 2.10.0", "metrics 0.24.2", @@ -850,15 +828,52 @@ dependencies = [ [[package]] name = "apollo_proc_macros" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ - "lazy_static", - "proc-macro2", "quote", "syn 2.0.104", ] +[[package]] +name = "apollo_sierra_multicompile" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +dependencies = [ + "apollo_config", + "apollo_infra", + "apollo_infra_utils", + "apollo_sierra_multicompile_types", + "async-trait", + "cairo-lang-sierra", + "cairo-lang-starknet-classes", + "cairo-lang-utils", + "cairo-native", + "rlimit", + "serde", + "serde_json", + "starknet-types-core", + "starknet_api", + "tempfile", + "thiserror 1.0.69", + "tracing", + "validator", +] + +[[package]] +name = "apollo_sierra_multicompile_types" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" +dependencies = [ + "apollo_infra", + "apollo_proc_macros", + "async-trait", + "serde", + "serde_json", + "starknet_api", + "thiserror 1.0.69", +] + [[package]] name = "aquamarine" version = "0.6.0" @@ -1266,8 +1281,8 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd", - "zstd-safe", + "zstd 0.13.3", + "zstd-safe 7.2.4", ] [[package]] @@ -1687,16 +1702,13 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ "anyhow", - "apollo_compilation_utils", - "apollo_compile_to_native", - "apollo_compile_to_native_types", "apollo_config", "apollo_infra_utils", - "apollo_metrics", + "apollo_sierra_multicompile", "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-secp256k1 0.4.0", @@ -1708,7 +1720,6 @@ dependencies = [ "cairo-lang-starknet-classes", "cairo-native", "cairo-vm", - "dashmap", "derive_more 0.99.20", "indexmap 2.10.0", "itertools 0.12.1", @@ -1737,11 +1748,12 @@ dependencies = [ [[package]] name = "blockifier_test_utils" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ "apollo_infra_utils", "cairo-lang-starknet-classes", + "itertools 0.12.1", "pretty_assertions", "rstest 0.17.0", "serde_json", @@ -1907,6 +1919,16 @@ dependencies = [ "serde", ] +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + [[package]] name = "bzip2" version = "0.5.2" @@ -2077,9 +2099,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bf35a939eaed69b8a71405c5d56fa52c3b1c76701b8c1056fe22b3e2569c7d" +checksum = "99b3c953c0321df1d7ce9101c7a94e2d4007aa8c3362ee96be54bbe77916ef60" dependencies = [ "cairo-lang-utils", "indoc", @@ -2091,9 +2113,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13c2341fb2272999f6152b0fc2238148fe93c745183a07acba031b27eeb0b66" +checksum = "e8cd5bec42d0c4e9f1ac6c373c177c98c73a760fabb4066757edd32ef9db467e" dependencies = [ "anyhow", "cairo-lang-defs", @@ -2117,20 +2139,19 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cf782d64a29c4acb1eb2759c39783d5e92c397d5ae3775754edae5d2c665ee" +checksum = "9ea55d64b6e7aa9186bb65ca32f50f386d6518d467930e53fcf47658dec74a2e" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80a146574d443e7fba848c069d7d84879c4635df5811963a18bf042df3e34e61" +checksum = "093146c748e95400230a40dc6171ac192399484addd96c6ac70ec36b0a2e45b0" dependencies = [ - "bincode 1.3.3", "cairo-lang-debug", "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -2139,16 +2160,14 @@ dependencies = [ "cairo-lang-utils", "itertools 0.14.0", "rust-analyzer-salsa", - "serde", "smol_str", - "typetag", ] [[package]] name = "cairo-lang-diagnostics" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb704187b1543aa4a2e0030d13ae6e0ad63712e5362cac3ded3237623a2b1b32" +checksum = "4c85890af7f0d0b6e0d15686e0a5169d3396e2861cb3adac3c594f82ae5ed42c" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -2158,9 +2177,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a2e6145241a4812820948278a86e11c25adc30e9a19b2e24b2517be19eedac" +checksum = "3a54937f1baca684547159af847ba5332ec8015de442878b8e4d6dbbaeec714c" dependencies = [ "cairo-lang-utils", "good_lp", @@ -2168,9 +2187,9 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c903cdcae48aa02c0ed41e1fd54b3231da51f1edf9538327ed155463594b8be" +checksum = "5e07492644cfa43e50cfc334a80c12c9e4d8e2a4248b3d2240301c99a025010a" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -2184,9 +2203,9 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a943f0818cfc091c3302acd92053ff2a642004d32757c3b4f94c5aa18e184ac0" +checksum = "c26c988d6b522c45b5f70add3808fcae13c921822d1c48724c394b450adcf7f9" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -2204,11 +2223,10 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b86cd38af57c36b2a72a2483d04d8b17ea2f9a554fd45b9d83375773f948818" +checksum = "90577e4dc391e2384041763120618ed2017a8f709f20dfcaa2c1246f908dd374" dependencies = [ - "assert_matches", "bincode 1.3.3", "cairo-lang-debug", "cairo-lang-defs", @@ -2227,13 +2245,14 @@ dependencies = [ "num-traits", "rust-analyzer-salsa", "serde", + "smol_str", ] [[package]] name = "cairo-lang-parser" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64f0a5ca9ac54975cdec98fe8491d9b62922b7cb048e6ded00188383b841b25" +checksum = "b6b7985c0ee345ead0e0f713474ec6490e3fac80c3c3889ab9e67b1588d30337" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -2252,9 +2271,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6230c6d37e5e8361900709112e56b42e48478806b829a086727ef59b2f7f3310" +checksum = "697772ca0b096e36cb98cfc9b1231b115a15eebf8ac7295f7b50252f5a1e6aea" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -2277,9 +2296,9 @@ checksum = "123ac0ecadf31bacae77436d72b88fa9caef2b8e92c89ce63a125ae911a12fae" [[package]] name = "cairo-lang-proc-macros" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4872352761cf6d7f47eeb1626e3b1d84a514017fb4251173148d8c04f36d5" +checksum = "23a956924e4f53cb1b69a7cee4758f0bcf50e23bbb8769f632625956a574f736" dependencies = [ "cairo-lang-debug", "quote", @@ -2288,9 +2307,9 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2327b8c070f9e50ac85a410f03c6aaf6a0dffee5ba8299d6af4bf2344587ac42" +checksum = "088f29ca8d06722bd92001d098b619a25979dcbfa5face7a6de5d8c7232f0454" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -2301,9 +2320,9 @@ dependencies = [ [[package]] name = "cairo-lang-runnable-utils" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775b064b0265e8408565b1ec9d360116015acf35753f02db255cbb13ad30670e" +checksum = "03b63a8fe2e8f2ae6280392bcc8ab98b981db75832b16c98974b81978d3d1b26" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -2319,9 +2338,9 @@ dependencies = [ [[package]] name = "cairo-lang-runner" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7166250692bda4b8b31f0480b8ba7fe75793b15bd4f0b6e5b5fe5d6dde01da8" +checksum = "c4db16efd33b13cecb1ca5b843a65f1e8e3eab4e18abf0c39522b04d741e51e7" dependencies = [ "ark-ff 0.5.0", "ark-secp256k1 0.5.0", @@ -2349,9 +2368,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f53a1ea47d1a0295179881d5578fc2b2c8cd5d2ac99bd81958c423d54960bb84" +checksum = "8a3d35463c096f1e3ab6830e28c762b22a7b5c3fbf0df5c2e9a265d290d22ee5" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -2376,14 +2395,14 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a48fe249ba77fb39363b1b40c81556c8d272083508b4618fb65b964559aca0ee" +checksum = "7e02d4df410965f122b67967936b722352eddbfde550883b054e019dc54beeef" dependencies = [ "anyhow", "cairo-lang-utils", "const-fnv1a-hash", - "convert_case 0.8.0", + "convert_case 0.7.1", "derivative", "itertools 0.14.0", "lalrpop", @@ -2403,9 +2422,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad6cbf5cc904f4309179793fc3757c1db9615e71c1b78eff601d2e22206d1c6" +checksum = "8c0d3be06212edb4d79be1296cd999b246d22e1541b49432db74dca16fe0c523" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -2419,9 +2438,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704ec6a8cb1b38f78571d5561519e87672ed5008a018a422842fa2a122ca3c34" +checksum = "9a7f246adb40ac69242231642cdf2571c83463068086a00b5ae9131f7dfc74b5" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -2435,9 +2454,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e011122028a59557ff075b22f550f7d0267b493f3db3dbefc281ff6795d108c" +checksum = "c2ca1fbf8d29528d5fdf6a7e3b2ccdd4f3e9b57066057c30f9bc2c3118867571" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -2459,9 +2478,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a43885fd8e806f5c50a80473798faad1a9a919f474e469d3027aece4f8b2002" +checksum = "efbb42e872cff7d050d2348978e2f12a94b4b29aee6f5ba5a7eca76a5294c900" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -2480,9 +2499,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "860006ddce78cae65babf37ff279c31358336ae76717991837d7e0868561878c" +checksum = "b8217d84f5434c36c68f54b5bbac9c91ff981a3738f2e6bc51b102f5beae3fd8" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -2490,9 +2509,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba6eb0a421d3411f4948e002d3dd81ab134044465bda3131f2718f56afda409" +checksum = "70aca831fef1f41b29c5e62a464a8ddd7964ed2414d3dafb6e1530bff1ae3cbd" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -2516,20 +2535,19 @@ dependencies = [ "smol_str", "starknet-types-core", "thiserror 2.0.12", - "typetag", ] [[package]] name = "cairo-lang-starknet-classes" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf81db2c36c1e3fe3bbf64ebc5c237f748e9f41bdd42a6ed3e03e00086d768c" +checksum = "b8e9b59bb3d46e68730266b27e3f0ad524c076eebab1bcc9352256a8957d6b88" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", "cairo-lang-sierra-to-casm", "cairo-lang-utils", - "convert_case 0.8.0", + "convert_case 0.7.1", "itertools 0.14.0", "num-bigint", "num-integer", @@ -2544,9 +2562,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36620fd45292fd0276bd581e774222fbd06e13aa8a4bf820a4be8ad3bcec100" +checksum = "686aea0cd9730af809010a74c0a8583b3acb99a08e5f97a07ed205f37b9e75ae" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -2562,9 +2580,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.12.1" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c3560464f6e243259a20906b0e173c7600e59e459bbc3beb620cd656b037ae" +checksum = "9c69eb6919b69a9a7bb92f79d73c568d09ef77efa0b5d265efb763234ec979d4" dependencies = [ "genco", "xshell", @@ -2572,9 +2590,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb622d636da63a5cc8138dba941d9eb1918d06e297bdb5a76dc69fffdf3581d9" +checksum = "c1a6f34df0f3929bf8166c5a6d143c22ad28fd73937cfb5d7a994d56ca4a86c4" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -2599,9 +2617,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c65df2eee1678a29b4b9dcff5c10a70b44e38d445ba2522025b1b6b7177b61f" +checksum = "199eb0e7ac78ba7dfbf6551ab7eab14dd45fdcf21675fd5472ca695dc6da96f1" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -2612,9 +2630,9 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.12.0-dev.1" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f043065d60a8a2510bfacb6c91767298fed50ed9abbd69ff7698322b7cb1e65" +checksum = "e621368454b62603ae035d04864770a70952e6ca8341b78c1ac50a0088939e3f" dependencies = [ "hashbrown 0.15.4", "indexmap 2.10.0", @@ -2624,14 +2642,13 @@ dependencies = [ "parity-scale-codec", "schemars 0.8.22", "serde", - "smol_str", ] [[package]] name = "cairo-native" -version = "0.6.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d714224a1280776d90422e631790c0138d138a80b8e16231829dacea13c8289" +checksum = "67542e31b00b8f015088c06b04095aaed96b3e35b50d396289390e9fb9c9a778" dependencies = [ "anyhow", "aquamarine", @@ -2685,18 +2702,17 @@ dependencies = [ [[package]] name = "cairo-vm" -version = "2.3.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2afc2bb5cf948599994a1f1634edc81934c3952e2f32c8e49efbde63d767fa69" +checksum = "7fa8b4b56ee66cebcade4d85128e55b2bfdf046502187aeaa8c2768a427684dc" dependencies = [ "anyhow", "arbitrary", "bincode 2.0.1", "bitvec", "generic-array", - "hashbrown 0.15.4", + "hashbrown 0.14.5", "hex", - "indoc", "keccak", "lazy_static", "nom", @@ -2710,9 +2726,9 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto 0.6.2", "starknet-types-core", - "thiserror 2.0.12", + "thiserror-no-std", "zip 0.6.6", ] @@ -3083,6 +3099,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "constant_time_eq" version = "0.3.1" @@ -3797,16 +3819,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "erased-serde" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" -dependencies = [ - "serde", - "typeid", -] - [[package]] name = "errno" version = "0.3.13" @@ -4426,6 +4438,7 @@ dependencies = [ "ahash 0.8.12", "allocator-api2", "rayon", + "serde", ] [[package]] @@ -5063,15 +5076,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "inventory" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" -dependencies = [ - "rustversion", -] - [[package]] name = "io-uring" version = "0.7.9" @@ -5609,7 +5613,7 @@ dependencies = [ "tempfile", "thiserror 1.0.69", "tracing", - "zstd", + "zstd 0.13.3", ] [[package]] @@ -5861,7 +5865,6 @@ dependencies = [ "katana-tracing", "katana-utils", "serde", - "serde-utils", "serde_json", "starknet", "tokio", @@ -5880,6 +5883,7 @@ dependencies = [ "katana-primitives", "katana-tracing", "serde", + "serde-utils", "serde_json", "shellexpand", "toml", @@ -7016,7 +7020,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.104", @@ -7313,6 +7316,17 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -7332,6 +7346,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", + "hmac", + "password-hash", + "sha2", ] [[package]] @@ -9460,11 +9477,10 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.3.2" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9676b89cd56310a87b93dec47b11af744f34d5fc9f367b829474eec0a891350d" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" dependencies = [ - "borsh", "serde", ] @@ -9820,8 +9836,8 @@ dependencies = [ [[package]] name = "starknet_api" -version = "0.15.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?branch=blockifier%2Fv0.15.0-rc.3#b62241574f059534cb4d52d3dd6218ec07f84e2b" +version = "0.0.0" +source = "git+https://github.com/dojoengine/sequencer?rev=5d737b9c9#5d737b9c90a14bdf4483d759d1a1d4ce64aa9fd2" dependencies = [ "apollo_infra_utils", "base64 0.13.1", @@ -9829,7 +9845,6 @@ dependencies = [ "cached", "cairo-lang-runner", "cairo-lang-starknet-classes", - "cairo-lang-utils", "derive_more 0.99.20", "flate2", "hex", @@ -9850,7 +9865,6 @@ dependencies = [ "strum 0.25.0", "strum_macros 0.25.3", "thiserror 1.0.69", - "time", ] [[package]] @@ -10140,6 +10154,26 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "thiserror-impl-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thiserror-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" +dependencies = [ + "thiserror-impl-no-std", +] + [[package]] name = "thread_local" version = "1.1.9" @@ -10729,42 +10763,12 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" -[[package]] -name = "typeid" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" - [[package]] name = "typenum" version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" -[[package]] -name = "typetag" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "ucd-trie" version = "0.1.7" @@ -12052,10 +12056,18 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ + "aes", "byteorder", + "bzip2 0.4.4", + "constant_time_eq 0.1.5", "crc32fast", "crossbeam-utils", "flate2", + "hmac", + "pbkdf2 0.11.0", + "sha1", + "time", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] @@ -12066,8 +12078,8 @@ checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" dependencies = [ "aes", "arbitrary", - "bzip2", - "constant_time_eq", + "bzip2 0.5.2", + "constant_time_eq 0.3.1", "crc32fast", "crossbeam-utils", "deflate64", @@ -12085,7 +12097,7 @@ dependencies = [ "xz2", "zeroize", "zopfli", - "zstd", + "zstd 0.13.3", ] [[package]] @@ -12100,13 +12112,32 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe", + "zstd-safe 7.2.4", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8bd349803..92bb661c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,13 +108,13 @@ katana-trie = { path = "crates/trie" } katana-utils = { path = "crates/utils" } # cairo-lang -cairo-lang-casm = "2.12.0-dev.1" -cairo-lang-runner = "2.12.0-dev.1" -cairo-lang-sierra = "2.12.0-dev.1" -cairo-lang-sierra-to-casm = "2.12.0-dev.1" -cairo-lang-starknet = "2.12.0-dev.1" -cairo-lang-starknet-classes = "2.12.0-dev.1" -cairo-lang-utils = "2.12.0-dev.1" +cairo-lang-casm = "2.11.2" +cairo-lang-runner = "2.11.2" +cairo-lang-sierra = "2.11.2" +cairo-lang-sierra-to-casm = "2.11.2" +cairo-lang-starknet = "2.11.2" +cairo-lang-starknet-classes = "2.11.2" +cairo-lang-utils = "2.11.2" anyhow = "1.0.89" arbitrary = { version = "1.3.2", features = [ "derive" ] } @@ -223,11 +223,11 @@ starknet-crypto = "0.7.4" starknet-types-core = { version = "0.1.8", features = [ "arbitrary", "hash" ] } # Some types that we used from cairo-vm implements the `Arbitrary` trait, # only under the `test_utils` feature. -cairo-vm = { version = "2.3.1", features = [ "test_utils" ] } +cairo-vm = { version = "1.0.2", features = [ "test_utils" ] } -blockifier = { git = "https://github.com/dojoengine/sequencer", branch = "blockifier/v0.15.0-rc.3", default-features = false } -cairo-native = "0.6" -starknet_api = { git = "https://github.com/dojoengine/sequencer", branch = "blockifier/v0.15.0-rc.3" } +blockifier = { git = "https://github.com/dojoengine/sequencer", rev = "5d737b9c9", default-features = false } +cairo-native = "0.4" +starknet_api = { git = "https://github.com/dojoengine/sequencer", rev = "5d737b9c9" } cainome = { git = "https://github.com/cartridge-gg/cainome", rev = "7d60de1", features = [ "abigen-rs" ] } cainome-cairo-serde = { git = "https://github.com/cartridge-gg/cainome", rev = "7d60de1" } diff --git a/crates/executor/src/implementation/blockifier/mod.rs b/crates/executor/src/implementation/blockifier/mod.rs index e1d83461f..7dfdbc687 100644 --- a/crates/executor/src/implementation/blockifier/mod.rs +++ b/crates/executor/src/implementation/blockifier/mod.rs @@ -3,7 +3,7 @@ use std::sync::Arc; // Re-export the blockifier crate. pub use blockifier; use blockifier::blockifier_versioned_constants::VersionedConstants; -use blockifier::bouncer::{n_steps_to_gas, Bouncer, BouncerConfig, BouncerWeights, BuiltinWeights}; +use blockifier::bouncer::{n_steps_to_sierra_gas, Bouncer, BouncerConfig, BouncerWeights}; pub mod cache; pub mod call; @@ -132,12 +132,9 @@ impl<'a> StarknetVMProcessor<'a> { // // To learn more about the L2 gas, refer to . block_max_capacity.sierra_gas = - n_steps_to_gas(limits.cairo_steps as usize, block_context.versioned_constants()); + n_steps_to_sierra_gas(limits.cairo_steps as usize, block_context.versioned_constants()); - let bouncer = Bouncer::new(BouncerConfig { - block_max_capacity, - builtin_weights: BuiltinWeights::default(), - }); + let bouncer = Bouncer::new(BouncerConfig { block_max_capacity }); Self { cfg_env, diff --git a/crates/executor/src/implementation/blockifier/utils.rs b/crates/executor/src/implementation/blockifier/utils.rs index bd4a5d9a1..fd3b9d277 100644 --- a/crates/executor/src/implementation/blockifier/utils.rs +++ b/crates/executor/src/implementation/blockifier/utils.rs @@ -136,7 +136,6 @@ pub fn transact( &tx_state, &tx_state_changes_keys, &info.summarize(versioned_constants), - &info.summarize_builtins(), &info.receipt.resources, versioned_constants, )?; diff --git a/crates/executor/src/utils.rs b/crates/executor/src/utils.rs index 4ef561dbd..f26a6edf3 100644 --- a/crates/executor/src/utils.rs +++ b/crates/executor/src/utils.rs @@ -13,17 +13,15 @@ pub(crate) const LOG_TARGET: &str = "executor"; pub fn log_resources(resources: &TransactionResources) { let mut mapped_strings = Vec::new(); - for (builtin, count) in &resources.computation.tx_vm_resources.builtin_instance_counter { + for (builtin, count) in &resources.computation.vm_resources.builtin_instance_counter { mapped_strings.push(format!("{builtin}: {count}")); } // Sort the strings alphabetically mapped_strings.sort(); - mapped_strings.insert(0, format!("steps: {}", resources.computation.tx_vm_resources.n_steps)); - mapped_strings.insert( - 1, - format!("memory holes: {}", resources.computation.tx_vm_resources.n_memory_holes), - ); + mapped_strings.insert(0, format!("steps: {}", resources.computation.vm_resources.n_steps)); + mapped_strings + .insert(1, format!("memory holes: {}", resources.computation.vm_resources.n_memory_holes)); trace!(target: LOG_TARGET, usage = mapped_strings.join(" | "), "Transaction resource usage."); } @@ -76,7 +74,7 @@ pub(crate) fn build_receipt( } fn get_receipt_resources(receipt: &TransactionReceipt) -> receipt::ExecutionResources { - let computation_resources = receipt.resources.computation.tx_vm_resources.clone(); + let computation_resources = receipt.resources.computation.vm_resources.clone(); let gas = GasUsed { l2_gas: receipt.gas.l2_gas.0, diff --git a/crates/node/node-cli-args/Cargo.toml b/crates/node/node-cli-args/Cargo.toml index 8d930ffb2..56c007494 100644 --- a/crates/node/node-cli-args/Cargo.toml +++ b/crates/node/node-cli-args/Cargo.toml @@ -11,6 +11,7 @@ katana-chain-spec.workspace = true katana-node-defaults.workspace = true katana-primitives.workspace = true katana-tracing.workspace = true +serde-utils.workspace = true anyhow.workspace = true clap.workspace = true diff --git a/crates/node/node-cli/Cargo.toml b/crates/node/node-cli/Cargo.toml index 5dbcf20fb..973df20e6 100644 --- a/crates/node/node-cli/Cargo.toml +++ b/crates/node/node-cli/Cargo.toml @@ -15,7 +15,6 @@ katana-primitives.workspace = true katana-slot-controller = { workspace = true, optional = true } katana-tracing.workspace = true katana-utils.workspace = true -serde-utils.workspace = true alloy-primitives.workspace = true anyhow.workspace = true