diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml deleted file mode 100644 index 8df11765cc..0000000000 --- a/.github/workflows/benchmarks.yml +++ /dev/null @@ -1,104 +0,0 @@ ---- -name: Task - Benchmark - -on: - workflow_dispatch: - workflow_call: - -jobs: - benchmark: - runs-on: [self-hosted, linux, benchmark] - steps: - - uses: actions/checkout@v3 - with: - clean: false - - name: Build tests and install benchmark projects - run: |- - cd tests - npm clean-install - npm run build - cd ../benchmarking - npm i - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: - ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ - github.run_id }} - fail-on-cache-miss: true - - name: Run benchmark - run: | - cd benchmarking - npm run test:ci - - name: Compare result - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: "customBiggerIsBetter" - output-file-path: ./benchmarking/reports/metrics.json - alert-threshold: "120%" - github-token: ${{ secrets.GITHUB_TOKEN }} - fail-on-alert: true - summary-always: ${{ github.ref == 'refs/heads/main' }} - comment-always: false - comment-on-alert: false - auto-push: ${{ github.ref == 'refs/heads/main' }} - - benchmark-with-state-root: - runs-on: [self-hosted, linux, benchmark] - steps: - - uses: actions/checkout@v3 - with: - clean: false - - name: Build tests and install benchmark projects - run: |- - cd tests - npm clean-install - npm run build - cd ../benchmarking - npm i - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: - ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ - github.run_id }} - fail-on-cache-miss: true - restore-keys: | - ${{ runner.os }}-cargo - - name: Setup rust toolchain - if: steps.cache.outputs.cache-hit != 'true' - run: rustup show - - name: Setup build deps - run: | - sudo apt-get update - sudo apt-get install -y clang llvm libudev-dev protobuf-compiler - - name: Build the project - run: | - cargo build --release --workspace - - name: Run benchmark - run: | - cd benchmarking - npm run test:ci-state-root:erc20 - - name: Compare result - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: "customBiggerIsBetter" - output-file-path: ./benchmarking/reports/metrics-state-root.json - alert-threshold: "120%" - github-token: ${{ secrets.GITHUB_TOKEN }} - fail-on-alert: true - summary-always: ${{ github.ref == 'refs/heads/main' }} - comment-always: false - comment-on-alert: false - benchmark-data-dir-path: "dev/bench-with-state-root" - auto-push: ${{ github.ref == 'refs/heads/main' }} diff --git a/.github/workflows/configs-verifier.yml b/.github/workflows/configs-verifier.yml index 708e187c67..1bbecf155b 100644 --- a/.github/workflows/configs-verifier.yml +++ b/.github/workflows/configs-verifier.yml @@ -9,7 +9,7 @@ jobs: genesis-docs: name: Genesis documentation runs-on: ubuntu-latest - if: ${{ github.event.label.name != 'ignore-docs' }} + if: startsWith(github.event.ref, 'refs/tags/ignore-docs') steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/madara-commands.yml b/.github/workflows/madara-commands.yml index c88c5e21d3..15244e5a9e 100644 --- a/.github/workflows/madara-commands.yml +++ b/.github/workflows/madara-commands.yml @@ -14,7 +14,6 @@ jobs: with: path: | target/release/madara - configs key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} @@ -24,10 +23,10 @@ jobs: target/release/madara setup --chain local --from-local=configs - name: Create build-spec (plain) run: | - target/release/madara build-spec --chain local > chain-plain.json + RUST_LOG=debug target/release/madara build-spec --chain local > chain-plain.json - name: Create build-spec (raw) run: | - target/release/madara build-spec --chain chain-plain.json --raw > chain-raw.json + RUST_LOG=debug target/release/madara build-spec --chain chain-plain.json --raw > chain-raw.json - name: Generate Sr25519 key for Aura (Leader Election) id: key-gen run: | diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index eab45ac9aa..ec480d14e4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -54,16 +54,3 @@ jobs: SCARB_VERSION: "2.3.1" steps: - uses: keep-starknet-strange/starknet-foundry-compatibility-tests@main - - # https://github.com/keep-starknet-strange/madara/issues/1097 - # benchmark: - # name: Run benchmarks - # uses: ./.github/workflows/benchmarks.yml - # needs: [rust_build, tests] - # permissions: - # # deployments permission to deploy GitHub pages website - # deployments: write - # # contents permission to update benchmark contents in gh-pages branch - # contents: write - # # post on the pull-request page - # pull-requests: write diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 67f6b8de13..ea2dc26d74 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -45,19 +45,6 @@ jobs: steps: - uses: keep-starknet-strange/starknet-foundry-compatibility-tests@main - # https://github.com/keep-starknet-strange/madara/issues/1097 - # benchmark: - # name: Run benchmarks - # uses: ./.github/workflows/benchmarks.yml - # needs: [rust_build, tests] - # permissions: - # # deployments permission to deploy GitHub pages website - # deployments: write - # # contents permission to update benchmark contents in gh-pages branch - # contents: write - # # post on the pull-request page - # pull-requests: write - rustdoc: name: Deploy docs to GitHub Pages uses: ./.github/workflows/rustdoc.yml diff --git a/.github/workflows/rust-build-test.yml b/.github/workflows/rust-build-test.yml index 73d63fca59..59f98ca330 100644 --- a/.github/workflows/rust-build-test.yml +++ b/.github/workflows/rust-build-test.yml @@ -17,7 +17,6 @@ jobs: with: path: | target/release/madara - configs key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} diff --git a/.github/workflows/starknet-js-tests.yml b/.github/workflows/starknet-js-tests.yml index 18432d93eb..c18721cb5c 100644 --- a/.github/workflows/starknet-js-tests.yml +++ b/.github/workflows/starknet-js-tests.yml @@ -15,7 +15,6 @@ jobs: with: path: | target/release/madara - configs key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} diff --git a/.github/workflows/starknet-rpc-tests.yml b/.github/workflows/starknet-rpc-tests.yml index f56f35a692..dc6300b2d1 100644 --- a/.github/workflows/starknet-rpc-tests.yml +++ b/.github/workflows/starknet-rpc-tests.yml @@ -20,7 +20,6 @@ jobs: with: path: | target/release/madara - configs key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 8578967d59..7f7100cb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## Next release +- chore: feature flags for avail and celestia DA +- feat(rpc): added support for v0.5.1 JSON-RPC specs +- feat(rpc): added ordered messages/events in trace fields +- feat(rpc): support for starknet.rs v0.5.1 version +- feat(rpc): added execution resources in trace fields +- feat(rpc): added state diff field in trace fields +- refactor: removed benchmarking folder and traces of CI pipeline +- fix: decouple is_query into is_query and offset_version - feat: add sierra to casm class hash mapping to genesis assets - chore: remove ArgentMulticall from genesis assets - feat: remove `seq_addr_updated` from `GenesisData` @@ -34,6 +42,7 @@ - feat(settlement): e2e test with Madara node settling on Ethereum contract - refactor: use `map` in `estimate_fee` to stop computation on error - fix: `tempdir` crate has been deprecated; use `tempfile` instead +- dev: add avail and celestia crates behind a feature flag ## v0.6.0 diff --git a/Cargo.lock b/Cargo.lock index 252caf0a0f..fcb39856c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.0", + "gimli 0.28.1", ] [[package]] @@ -36,25 +36,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", -] - [[package]] name = "aead" version = "0.5.2" @@ -65,29 +46,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.0", -] - [[package]] name = "aes" version = "0.8.3" @@ -99,52 +57,18 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle 2.4.1", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.3", + "aead", + "aes", "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", - "subtle 2.4.1", -] - -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", + "ctr", + "ghash", + "subtle 2.5.0", ] [[package]] @@ -153,19 +77,19 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", - "getrandom 0.2.11", + "getrandom 0.2.12", "once_cell", "version_check", "zerocopy", @@ -234,9 +158,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -254,37 +178,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "approx" @@ -297,9 +221,9 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" dependencies = [ "include_dir", "itertools 0.10.5", @@ -309,12 +233,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "arc-swap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" - [[package]] name = "ark-bls12-377" version = "0.4.0" @@ -517,9 +435,9 @@ checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.2.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de17a919934ad8c5cc99a1a74de4e2dab95d6121a8f27f94755ff525b630382c" +checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" [[package]] name = "arrayref" @@ -548,29 +466,13 @@ dependencies = [ "term", ] -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits 0.2.17", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -580,18 +482,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -644,22 +534,21 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" +checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" dependencies = [ - "async-lock 3.1.1", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite", "parking", "polling", - "rustix 0.38.25", + "rustix 0.38.28", "slab", "tracing", - "waker-fn", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -673,24 +562,24 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.1.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655b9c7fe787d3b25cc0f804a1a8401790f0c5bc395beb5a64dc77d8de079105" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 3.1.0", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite 0.2.13", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -717,12 +606,6 @@ dependencies = [ "pin-project-lite 0.2.13", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "atty" version = "0.2.14" @@ -763,7 +646,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object 0.32.2", "rustc-demangle", ] @@ -794,12 +677,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -814,9 +691,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" [[package]] name = "base64ct" @@ -880,13 +757,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.15", + "prettyplease 0.2.16", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -906,7 +783,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1010,7 +887,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -1034,16 +911,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -1053,16 +920,10 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blockifier" version = "0.1.0-rc2" -source = "git+https://github.com/keep-starknet-strange/blockifier?branch=no_std-support-7578442#691f162d0d386cfd731a33a5fb3b7414ed9e86ef" +source = "git+https://github.com/keep-starknet-strange/blockifier?branch=no_std-support-7578442#8270582205fb7c2fb81b7e2de1dc46cd9b483d83" dependencies = [ "ark-ff", "ark-secp256k1", @@ -1074,7 +935,7 @@ dependencies = [ "cairo-lang-vm-utils", "cairo-vm", "derive_more", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "indexmap 2.0.0-pre", "itertools 0.10.5", "keccak", @@ -1091,7 +952,7 @@ dependencies = [ "sha3", "sp-arithmetic", "spin 0.9.8", - "starknet-crypto 0.5.2", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", "starknet_api", "strum 0.24.1", "strum_macros 0.24.3", @@ -1128,9 +989,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", @@ -1230,7 +1091,7 @@ dependencies = [ [[package]] name = "cairo-felt" version = "0.8.5" -source = "git+https://github.com/keep-starknet-strange/cairo-rs?branch=no_std-support-21eff70#7f92d4cf2b8f30f3fd360898ab949fb0d00f7c2d" +source = "git+https://github.com/keep-starknet-strange/cairo-rs?branch=no_std-support-21eff70#53dfed63ce010e9de8fb39e31f96b3034682762d" dependencies = [ "lazy_static", "num-bigint", @@ -1246,7 +1107,7 @@ version = "2.1.0" source = "git+https://github.com/keep-starknet-strange/cairo.git?branch=no_std-support-8bbf530#f8b5fe438e0d201b7d1afb39c21d343ff95b5850" dependencies = [ "cairo-lang-utils", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "indoc", "num-bigint", "num-traits 0.2.17", @@ -1425,7 +1286,7 @@ source = "git+https://github.com/keep-starknet-strange/cairo.git?branch=no_std-s dependencies = [ "cairo-lang-debug", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1640,7 +1501,7 @@ version = "2.1.0" source = "git+https://github.com/keep-starknet-strange/cairo.git?branch=no_std-support-8bbf530#f8b5fe438e0d201b7d1afb39c21d343ff95b5850" dependencies = [ "cairo-felt", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "indexmap 2.0.0-pre", "itertools 0.10.5", "num-bigint", @@ -1661,7 +1522,7 @@ dependencies = [ "cairo-lang-casm", "cairo-lang-utils", "cairo-vm", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "num-bigint", "num-integer", "num-traits 0.2.17", @@ -1670,7 +1531,7 @@ dependencies = [ [[package]] name = "cairo-take_until_unbalanced" version = "0.29.0" -source = "git+https://github.com/keep-starknet-strange/cairo-rs?branch=no_std-support-21eff70#7f92d4cf2b8f30f3fd360898ab949fb0d00f7c2d" +source = "git+https://github.com/keep-starknet-strange/cairo-rs?branch=no_std-support-21eff70#53dfed63ce010e9de8fb39e31f96b3034682762d" dependencies = [ "nom", ] @@ -1678,7 +1539,7 @@ dependencies = [ [[package]] name = "cairo-vm" version = "0.8.5" -source = "git+https://github.com/keep-starknet-strange/cairo-rs?branch=no_std-support-21eff70#7f92d4cf2b8f30f3fd360898ab949fb0d00f7c2d" +source = "git+https://github.com/keep-starknet-strange/cairo-rs?branch=no_std-support-21eff70#53dfed63ce010e9de8fb39e31f96b3034682762d" dependencies = [ "anyhow", "ark-ff", @@ -1690,7 +1551,7 @@ dependencies = [ "cairo-lang-casm-contract-class", "cairo-take_until_unbalanced", "generic-array 0.14.7", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "hex", "keccak", "lazy_static", @@ -1705,7 +1566,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sha3", - "starknet-crypto 0.5.2", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", "thiserror-no-std", ] @@ -1720,9 +1581,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -1735,7 +1596,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -1749,7 +1610,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -1765,17 +1626,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle 2.4.1", -] - [[package]] name = "cesu8" version = "1.1.0" @@ -1793,9 +1643,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" dependencies = [ "smallvec", ] @@ -1839,7 +1689,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.5.2", + "aead", "chacha20", "cipher 0.4.4", "poly1305", @@ -1883,15 +1733,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1905,9 +1746,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -1916,9 +1757,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" dependencies = [ "clap_builder", "clap_derive", @@ -1926,9 +1767,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" dependencies = [ "anstream", "anstyle", @@ -1945,7 +1786,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2008,7 +1849,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "bech32", "bs58 0.5.0", "digest 0.10.7", @@ -2030,11 +1871,10 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "is-terminal", "lazy_static", "windows-sys 0.48.0", ] @@ -2083,24 +1923,24 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -2124,9 +1964,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" @@ -2143,7 +1983,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "once_cell", "tiny-keccak", ] @@ -2183,9 +2023,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -2193,9 +2033,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -2219,9 +2059,9 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3120ebb80a9de008e638ad833d4127d50ea3d3a960ea23ea69bc66d9358a028" +checksum = "7f01585027057ff5f0a5bf276174ae4c1594a2c5bde93d5f46a016d76270f5a9" dependencies = [ "bindgen 0.69.1", ] @@ -2262,9 +2102,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -2367,21 +2207,6 @@ dependencies = [ "wasmtime-types", ] -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - [[package]] name = "crc32fast" version = "1.3.2" @@ -2393,36 +2218,28 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -2430,18 +2247,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -2450,7 +2255,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.5.0", "zeroize", ] @@ -2482,26 +2287,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", - "subtle 2.4.1", -] - -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher 0.3.0", + "subtle 2.5.0", ] [[package]] @@ -2522,7 +2318,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle 2.5.0", "zeroize", ] @@ -2535,7 +2331,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle 2.5.0", "zeroize", ] @@ -2552,7 +2348,7 @@ dependencies = [ "fiat-crypto", "platforms", "rustc_version", - "subtle 2.4.1", + "subtle 2.5.0", "zeroize", ] @@ -2564,14 +2360,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "cxx" -version = "1.0.110" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7129e341034ecb940c9072817cd9007974ea696844fc4dd582dc1653a7fbe2e8" +checksum = "8de00f15a6fa069c99b88c5c78c4541d0e7899a33b86f7480e23df2431fce0bc" dependencies = [ "cc", "cxxbridge-flags", @@ -2581,9 +2377,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.110" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a24f3f5f8eed71936f21e570436f024f5c2e25628f7496aa7ccd03b90109d5" +checksum = "0a71e1e631fa2f2f5f92e8b0d860a00c198c6771623a6cefcc863e3554f0d8d6" dependencies = [ "cc", "codespan-reporting", @@ -2591,34 +2387,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "cxxbridge-flags" -version = "1.0.110" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06fdd177fc61050d63f67f5bd6351fac6ab5526694ea8e359cd9cd3b75857f44" +checksum = "6f3fed61d56ba497c4efef9144dfdbaa25aa58f2f6b3a7cf441d4591c583745c" [[package]] name = "cxxbridge-macro" -version = "1.0.110" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" +checksum = "8908e380a8efd42150c017b0cfa31509fc49b6d47f7cb6b33e93ffb8f4e3661e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", + "syn 2.0.48", ] [[package]] @@ -2627,22 +2413,8 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -2656,18 +2428,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.39", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -2676,9 +2437,9 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.3", + "darling_core", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2795,17 +2556,6 @@ dependencies = [ "url", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "der" version = "0.7.8" @@ -2816,27 +2566,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits 0.2.17", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -2846,9 +2582,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -2877,46 +2613,15 @@ dependencies = [ ] [[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "darling 0.14.4", + "convert_case 0.4.0", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version", + "rustc_version", "syn 1.0.109", ] @@ -2959,7 +2664,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] @@ -3031,7 +2736,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3053,18 +2758,18 @@ dependencies = [ [[package]] name = "docify" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4235e9b248e2ba4b92007fe9c646f3adf0ffde16dc74713eacc92b8bc58d8d2f" +checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47020e12d7c7505670d1363dd53d6c23724f71a90a3ae32ff8eba40de8404626" +checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" dependencies = [ "common-path", "derive-syn-parse", @@ -3072,9 +2777,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.39", + "syn 2.0.48", "termcolor", - "toml 0.7.8", + "toml 0.8.8", "walkdir", ] @@ -3123,30 +2828,18 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.8", + "der", "digest 0.10.7", - "elliptic-curve 0.13.8", - "rfc6979 0.4.0", - "signature 2.2.0", - "spki 0.7.2", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -3155,8 +2848,8 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8 0.10.2", - "signature 2.2.0", + "pkcs8", + "signature", ] [[package]] @@ -3170,7 +2863,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle 2.4.1", + "subtle 2.5.0", "zeroize", ] @@ -3194,44 +2887,22 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "hkdf", - "pem-rfc7468", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.5", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", - "subtle 2.4.1", + "sec1", + "subtle 2.5.0", "zeroize", ] @@ -3265,7 +2936,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "bytes", "hex", "k256", @@ -3316,12 +2987,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3330,8 +3001,8 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ - "aes 0.8.3", - "ctr 0.9.2", + "aes", + "ctr", "digest 0.10.7", "hex", "hmac 0.12.1", @@ -3449,14 +3120,14 @@ dependencies = [ "ethers-core", "ethers-etherscan", "eyre", - "prettyplease 0.2.15", + "prettyplease 0.2.16", "proc-macro2", "quote", "regex", "reqwest", "serde", "serde_json", - "syn 2.0.39", + "syn 2.0.48", "toml 0.8.8", "walkdir", ] @@ -3473,7 +3144,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3486,11 +3157,11 @@ dependencies = [ "cargo_metadata 0.18.1", "chrono", "const-hex", - "elliptic-curve 0.13.8", + "elliptic-curve", "ethabi", "generic-array 0.14.7", "k256", - "num_enum 0.7.1", + "num_enum 0.7.2", "once_cell", "open-fastrlp", "rand 0.8.5", @@ -3498,7 +3169,7 @@ dependencies = [ "serde", "serde_json", "strum 0.25.0", - "syn 2.0.39", + "syn 2.0.48", "tempfile", "thiserror", "tiny-keccak", @@ -3513,7 +3184,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -3553,7 +3224,7 @@ source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a68 dependencies = [ "async-trait", "auto_impl", - "base64 0.21.5", + "base64 0.21.6", "bytes", "const-hex", "enr", @@ -3591,7 +3262,7 @@ dependencies = [ "coins-bip32", "coins-bip39", "const-hex", - "elliptic-curve 0.13.8", + "elliptic-curve", "eth-keystore", "ethers-core", "rand 0.8.5", @@ -3618,7 +3289,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "solang-parser", @@ -3639,9 +3310,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -3650,11 +3321,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 3.1.0", + "event-listener 4.0.3", "pin-project-lite 0.2.13", ] @@ -3677,14 +3348,14 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "eyre" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f656be11ddf91bd709454d15d5bd896fbaf4cc3314e69349e4d1569f5b46cd" +checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" dependencies = [ "indenter", "once_cell", @@ -3717,16 +3388,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle 2.4.1", -] - [[package]] name = "ff" version = "0.13.0" @@ -3734,13 +3395,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] name = "fflonk" version = "0.1.0" -source = "git+https://github.com/w3f/fflonk#1beb0585e1c8488956fac7f05da061f9b41e8948" +source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" dependencies = [ "ark-ec", "ark-ff", @@ -3768,14 +3429,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -3907,7 +3568,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ "Inflector", - "array-bytes 6.2.0", + "array-bytes 6.2.2", "chrono", "clap", "comfy-table", @@ -4056,7 +3717,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4068,7 +3729,7 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4078,7 +3739,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4163,9 +3824,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -4178,9 +3839,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -4188,15 +3849,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -4206,15 +3867,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ "futures-core", "pin-project-lite 0.2.13", @@ -4232,13 +3893,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4249,20 +3910,20 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.9", - "webpki 0.22.4", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -4276,9 +3937,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -4320,7 +3981,7 @@ checksum = "d4cf186fea4af17825116f72932fe52cce9a13bae39ff63b4dc0cfdb3fb4bde1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4366,9 +4027,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -4377,16 +4038,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.5.3", -] - [[package]] name = "ghash" version = "0.5.0" @@ -4394,7 +4045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug 0.3.0", - "polyval 0.6.1", + "polyval", ] [[package]] @@ -4410,9 +4061,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -4422,15 +4073,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -4455,33 +4106,22 @@ dependencies = [ "minilp", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle 2.4.1", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] name = "h2" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" dependencies = [ "bytes", "fnv", @@ -4540,16 +4180,16 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", ] [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "allocator-api2", "serde", ] @@ -4569,7 +4209,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -4578,7 +4218,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "bytes", "headers-core", "http", @@ -4640,9 +4280,9 @@ checksum = "5b6e75c860d4216ac53f9ac88b25c99eaedba075b3a7b2ed31f2adc51a74fffd" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] @@ -4663,7 +4303,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -4689,11 +4329,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4726,9 +4366,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -4761,9 +4401,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -4776,7 +4416,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.13", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -4793,11 +4433,11 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.9", + "rustls 0.21.10", "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", ] [[package]] @@ -4815,16 +4455,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -5010,7 +4650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -5059,25 +4699,6 @@ dependencies = [ "num-traits 0.2.17", ] -[[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -5115,13 +4736,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.25", - "windows-sys 0.48.0", + "rustix 0.38.28", + "windows-sys 0.52.0", ] [[package]] @@ -5144,9 +4765,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jni" @@ -5193,9 +4814,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -5248,7 +4869,7 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", ] [[package]] @@ -5365,7 +4986,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "pem", "ring 0.16.20", "serde", @@ -5375,16 +4996,16 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.8", - "signature 2.2.0", + "signature", ] [[package]] @@ -5495,18 +5116,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -5517,14 +5138,14 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.11", + "getrandom 0.2.12", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -5542,7 +5163,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -5854,12 +5474,12 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen", "ring 0.16.20", "rustls 0.20.9", "thiserror", - "webpki 0.22.4", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -5877,37 +5497,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -5993,7 +5582,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] @@ -6016,9 +5605,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "295c17e837573c8c821dbaeb3cceb3d745ad082f7572191409e69cbc1b3fd050" dependencies = [ "cc", "pkg-config", @@ -6066,9 +5655,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lioness" @@ -6156,9 +5745,9 @@ dependencies = [ [[package]] name = "mach2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -6172,7 +5761,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6186,7 +5775,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6197,7 +5786,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6208,7 +5797,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6250,7 +5839,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "starknet-core", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", "substrate-wasm-builder", ] @@ -6361,6 +5950,7 @@ dependencies = [ "mockito", "mp-block", "mp-commitments", + "mp-fee", "mp-felt", "mp-hashers", "mp-transactions", @@ -6373,7 +5963,7 @@ dependencies = [ "serde_json", "sp-core", "starknet-core", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet-providers", "starknet_api", "tokio", @@ -6462,6 +6052,7 @@ dependencies = [ "mc-rpc-core", "mc-storage", "mp-block", + "mp-fee", "mp-felt", "mp-hashers", "mp-simulations", @@ -6481,7 +6072,7 @@ dependencies = [ "sp-core", "sp-runtime", "starknet-core", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", "thiserror", "tokio", @@ -6551,7 +6142,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "starknet-crypto 0.6.1", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", "thiserror", "url", @@ -6598,9 +6189,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memfd" @@ -6608,7 +6199,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.25", + "rustix 0.38.28", ] [[package]] @@ -6620,15 +6211,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -6638,15 +6220,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -6713,9 +6286,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -6742,7 +6315,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_distr", - "subtle 2.4.1", + "subtle 2.5.0", "thiserror", "zeroize", ] @@ -6797,12 +6370,14 @@ name = "mp-block" version = "0.1.0" dependencies = [ "blockifier", - "frame-support", + "mp-fee", "mp-felt", "mp-hashers", "mp-transactions", "parity-scale-codec", + "scale-info", "serde", + "serde_json", "sp-core", "starknet-core", "starknet_api", @@ -6813,7 +6388,7 @@ name = "mp-chain-id" version = "0.1.0" dependencies = [ "mp-felt", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", ] [[package]] @@ -6830,8 +6405,8 @@ dependencies = [ "scale-info", "serde", "starknet-core", - "starknet-crypto 0.6.1", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", ] @@ -6850,10 +6425,16 @@ name = "mp-fee" version = "0.1.0" dependencies = [ "blockifier", - "hashbrown 0.14.2", + "hashbrown 0.14.3", + "mp-felt", "mp-state", + "parity-scale-codec", "phf", + "scale-info", + "serde", + "serde_with", "sp-arithmetic", + "starknet-core", "starknet_api", ] @@ -6869,7 +6450,7 @@ dependencies = [ "serde_with", "sp-core", "starknet-core", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", "thiserror-no-std", ] @@ -6880,12 +6461,13 @@ version = "0.1.0" dependencies = [ "blockifier", "derive_more", + "hex", "mp-felt", "serde", "serde_json", "serde_with", "starknet-core", - "starknet-crypto 0.6.1", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", ] [[package]] @@ -6897,7 +6479,7 @@ dependencies = [ "scale-info", "serde", "starknet-core", - "starknet-crypto 0.6.1", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", ] [[package]] @@ -6917,7 +6499,7 @@ name = "mp-program-hash" version = "0.1.0" dependencies = [ "mp-felt", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", ] [[package]] @@ -6938,6 +6520,8 @@ dependencies = [ "blockifier", "mp-felt", "mp-messages", + "mp-state", + "mp-transactions", "parity-scale-codec", "scale-info", "serde", @@ -6966,6 +6550,11 @@ name = "mp-state" version = "0.1.0" dependencies = [ "blockifier", + "mp-felt", + "parity-scale-codec", + "scale-info", + "serde", + "serde_with", "starknet_api", ] @@ -7005,8 +6594,8 @@ dependencies = [ "serde_json", "spin 0.9.8", "starknet-core", - "starknet-crypto 0.6.1", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", "thiserror", ] @@ -7269,7 +6858,6 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] @@ -7436,11 +7024,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.1", + "num_enum_derive 0.7.2", ] [[package]] @@ -7457,14 +7045,14 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -7487,9 +7075,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -7526,29 +7114,20 @@ dependencies = [ "byteorder", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -7595,9 +7174,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.59" +version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -7616,7 +7195,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -7627,9 +7206,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -7643,28 +7222,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - [[package]] name = "pallet-aura" version = "4.0.0-dev" @@ -7752,7 +7309,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "hex", "hexlit", "indexmap 2.0.0-pre", @@ -7791,8 +7348,8 @@ dependencies = [ "sp-runtime", "sp-std", "starknet-core", - "starknet-crypto 0.6.1", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "starknet_api", "test-case", ] @@ -7802,7 +7359,7 @@ name = "pallet-starknet-runtime-api" version = "0.1.0" dependencies = [ "blockifier", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "mp-felt", "mp-simulations", "mp-snos-output", @@ -7838,9 +7395,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" dependencies = [ "blake2 0.10.6", "crc32fast", @@ -7854,13 +7411,14 @@ dependencies = [ "rand 0.8.5", "siphasher", "snap", + "winapi", ] [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -7873,11 +7431,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -7963,7 +7521,7 @@ checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] @@ -7990,7 +7548,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", ] [[package]] @@ -8030,15 +7588,6 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -8047,9 +7596,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -8058,9 +7607,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ "pest", "pest_generator", @@ -8068,22 +7617,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "once_cell", "pest", @@ -8140,7 +7689,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -8184,7 +7733,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -8205,50 +7754,40 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", - "spki 0.7.2", + "der", + "spki", ] [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "platforms" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "polling" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite 0.2.13", - "rustix 0.38.25", + "rustix 0.38.28", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -8259,19 +7798,7 @@ checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.1", -] - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash", ] [[package]] @@ -8283,14 +7810,14 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -8362,12 +7889,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -8403,6 +7930,15 @@ dependencies = [ "toml_edit 0.20.7", ] +[[package]] +name = "proc-macro-crate" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +dependencies = [ + "toml_edit 0.21.0", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -8429,20 +7965,20 @@ dependencies = [ [[package]] name = "proc-macro-warning" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" +checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -8487,7 +8023,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -8623,14 +8159,14 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.4", + "webpki", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -8700,7 +8236,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", ] [[package]] @@ -8772,19 +8308,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring 0.16.20", - "time", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -8806,15 +8329,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -8830,29 +8344,29 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -8919,17 +8433,17 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "bytes", "encoding_rs", "futures-core", @@ -8948,7 +8462,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite 0.2.13", - "rustls 0.21.9", + "rustls 0.21.10", "rustls-pemfile", "serde", "serde_json", @@ -8962,7 +8476,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", "winreg", ] @@ -8976,17 +8490,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -8994,7 +8497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] @@ -9030,12 +8533,12 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -9132,21 +8635,10 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.39", + "syn 2.0.48", "unicode-ident", ] -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes", - "thiserror", - "webrtc-util", -] - [[package]] name = "rtnetlink" version = "0.10.1" @@ -9172,20 +8664,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -9210,7 +8688,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.21", ] [[package]] @@ -9238,28 +8716,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.11", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.1", - "log", - "ring 0.16.20", - "sct 0.6.1", - "webpki 0.21.4", + "linux-raw-sys 0.4.12", + "windows-sys 0.52.0", ] [[package]] @@ -9270,20 +8735,20 @@ checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring 0.16.20", - "sct 0.7.1", - "webpki 0.22.4", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.5", + "ring 0.17.7", "rustls-webpki", - "sct 0.7.1", + "sct", ] [[package]] @@ -9304,7 +8769,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", ] [[package]] @@ -9313,7 +8778,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -9336,9 +8801,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safe_arch" @@ -9472,7 +8937,7 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -9480,7 +8945,7 @@ name = "sc-cli" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "chrono", "clap", "fdlimit", @@ -9675,8 +9140,8 @@ name = "sc-consensus-grandpa" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "ahash 0.8.6", - "array-bytes 6.2.0", + "ahash 0.8.7", + "array-bytes 6.2.2", "async-trait", "dyn-clone", "finality-grandpa", @@ -9842,7 +9307,7 @@ name = "sc-keystore" version = "4.0.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -9884,7 +9349,7 @@ name = "sc-network" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "async-channel", "async-trait", "asynchronous-codec", @@ -9962,7 +9427,7 @@ name = "sc-network-gossip" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "futures", "futures-timer", "libp2p", @@ -9980,7 +9445,7 @@ name = "sc-network-light" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "async-channel", "futures", "libp2p-identity", @@ -10001,7 +9466,7 @@ name = "sc-network-sync" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "async-channel", "async-trait", "fork-tree", @@ -10036,7 +9501,7 @@ name = "sc-network-transactions" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "futures", "libp2p", "log", @@ -10054,7 +9519,7 @@ name = "sc-offchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "bytes", "fnv", "futures", @@ -10164,7 +9629,7 @@ name = "sc-rpc-spec-v2" version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "futures", "futures-util", "hex", @@ -10337,7 +9802,7 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -10425,11 +9890,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -10438,7 +9903,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "cfg-if", "hashbrown 0.13.2", ] @@ -10457,7 +9922,7 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.4.1", + "subtle 2.5.0", "zeroize", ] @@ -10485,63 +9950,27 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "sct" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.10.2", - "subtle 2.4.1", + "pkcs8", + "subtle 2.5.0", "zeroize", ] @@ -10624,9 +10053,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -10651,29 +10080,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -10693,9 +10122,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -10734,10 +10163,10 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.3", + "darling", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -10834,16 +10263,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - [[package]] name = "signature" version = "2.2.0" @@ -10869,9 +10288,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" [[package]] name = "simple_asn1" @@ -10923,9 +10342,9 @@ dependencies = [ [[package]] name = "snap" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "snow" @@ -10933,15 +10352,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "blake2 0.10.6", "chacha20poly1305", "curve25519-dalek 4.1.1", "rand_core 0.6.4", - "ring 0.17.5", + "ring 0.17.7", "rustc_version", "sha2 0.10.8", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] @@ -11027,7 +10446,7 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -11172,7 +10591,7 @@ name = "sp-core" version = "21.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "array-bytes 6.2.0", + "array-bytes 6.2.2", "bandersnatch_vrfs", "bitflags 1.3.2", "blake2 0.10.6", @@ -11234,7 +10653,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "quote", "sp-core-hashing", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -11253,7 +10672,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -11450,7 +10869,7 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -11508,7 +10927,7 @@ name = "sp-statement-store" version = "4.0.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "curve25519-dalek 4.1.1", "ed25519-dalek", "hkdf", @@ -11599,7 +11018,7 @@ name = "sp-trie" version = "22.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.3.0#401f8a3e9448db854f5605b679fa085b8f445039" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "hash-db", "hashbrown 0.13.2", "lazy_static", @@ -11643,7 +11062,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -11702,22 +11121,12 @@ dependencies = [ [[package]] name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - -[[package]] -name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.8", + "der", ] [[package]] @@ -11733,9 +11142,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.44.0" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35935738370302d5e33963665b77541e4b990a3e919ec904c837a56cfc891de1" +checksum = "3c0c74081753a8ce1c8eb10b9f262ab6f7017e5ad3317c17a54c7ab65fcb3c6e" dependencies = [ "Inflector", "num-format", @@ -11754,10 +11163,10 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "starknet-core" -version = "0.7.2" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" +version = "0.8.0" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac#95d50ac0a3a537cb63a390bad818415899c90693" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "flate2", "hex", "serde", @@ -11765,27 +11174,44 @@ dependencies = [ "serde_json_pythonic", "serde_with", "sha3", - "starknet-crypto 0.6.1", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", ] [[package]] name = "starknet-crypto" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f2175b0b3fc24ff2ec6dc07f5a720498994effca7e78b11a6e1c1bd02cad52" +version = "0.6.1" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" +dependencies = [ + "crypto-bigint", + "hmac 0.12.1", + "num-bigint", + "num-integer", + "num-traits 0.2.17", + "rfc6979", + "sha2 0.10.8", + "starknet-crypto-codegen 0.3.2 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "zeroize", +] + +[[package]] +name = "starknet-crypto" +version = "0.6.1" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac#95d50ac0a3a537cb63a390bad818415899c90693" dependencies = [ - "crypto-bigint 0.5.5", + "crypto-bigint", "hex", "hmac 0.12.1", "num-bigint", "num-integer", "num-traits 0.2.17", - "rfc6979 0.4.0", + "rfc6979", "sha2 0.10.8", - "starknet-crypto-codegen 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "starknet-curve 0.3.0", - "starknet-ff 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-crypto-codegen 0.3.2 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", "zeroize", ] @@ -11794,13 +11220,13 @@ name = "starknet-crypto" version = "0.6.1" source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" dependencies = [ - "crypto-bigint 0.5.5", + "crypto-bigint", "hex", "hmac 0.12.1", "num-bigint", "num-integer", "num-traits 0.2.17", - "rfc6979 0.4.0", + "rfc6979", "sha2 0.10.8", "starknet-crypto-codegen 0.3.2 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", @@ -11811,12 +11237,21 @@ dependencies = [ [[package]] name = "starknet-crypto-codegen" version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af6527b845423542c8a16e060ea1bc43f67229848e7cd4c4d80be994a84220ce" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" +dependencies = [ + "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "syn 2.0.48", +] + +[[package]] +name = "starknet-crypto-codegen" +version = "0.3.2" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac#95d50ac0a3a537cb63a390bad818415899c90693" dependencies = [ - "starknet-curve 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "starknet-ff 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.39", + "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", + "syn 2.0.48", ] [[package]] @@ -11826,25 +11261,23 @@ source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce2 dependencies = [ "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "starknet-curve" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252610baff59e4c4332ce3569f7469c5d3f9b415a2240d698fb238b2b4fc0942" +version = "0.4.0" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" dependencies = [ - "starknet-ff 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", ] [[package]] name = "starknet-curve" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68a0d87ae56572abf83ddbfd44259a7c90dbeeee1629a1ffe223e7f9a8f3052" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac#95d50ac0a3a537cb63a390bad818415899c90693" dependencies = [ - "starknet-ff 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac)", ] [[package]] @@ -11858,32 +11291,42 @@ dependencies = [ [[package]] name = "starknet-ff" version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7584bc732e4d2a8ccebdd1dda8236f7940a79a339e30ebf338d45c329659e36c" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" dependencies = [ "ark-ff", - "crypto-bigint 0.5.5", - "getrandom 0.2.11", + "crypto-bigint", + "getrandom 0.2.12", "hex", ] [[package]] name = "starknet-ff" version = "0.3.5" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac#95d50ac0a3a537cb63a390bad818415899c90693" dependencies = [ "ark-ff", "bigdecimal", - "crypto-bigint 0.5.5", - "getrandom 0.2.11", + "crypto-bigint", + "getrandom 0.2.12", "hex", "serde", ] [[package]] -name = "starknet-providers" -version = "0.7.0" +name = "starknet-ff" +version = "0.3.5" source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" +dependencies = [ + "ark-ff", + "crypto-bigint", + "getrandom 0.2.12", + "hex", +] + +[[package]] +name = "starknet-providers" +version = "0.8.0" +source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=95d50ac#95d50ac0a3a537cb63a390bad818415899c90693" dependencies = [ "async-trait", "auto_impl", @@ -11902,11 +11345,11 @@ dependencies = [ [[package]] name = "starknet_api" version = "0.4.1" -source = "git+https://github.com/keep-starknet-strange/starknet-api?branch=no_std-support-dc83f05#6637a2f24531bf1a049cc0c482deb41c419a6832" +source = "git+https://github.com/keep-starknet-strange/starknet-api?branch=no_std-support-dc83f05#3415c832bb0cd72d1764dcd9ce803ddf932895ef" dependencies = [ "cairo-lang-casm-contract-class", "derive_more", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "hex", "indexmap 2.0.0-pre", "once_cell", @@ -11915,7 +11358,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "starknet-crypto 0.5.2", + "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", "thiserror-no-std", ] @@ -12013,26 +11456,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.39", -] - -[[package]] -name = "stun" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" -dependencies = [ - "base64 0.13.1", - "crc", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "subtle 2.4.1", - "thiserror", - "tokio", - "url", - "webrtc-util", + "syn 2.0.48", ] [[package]] @@ -12115,15 +11539,6 @@ dependencies = [ "wasm-opt", ] -[[package]] -name = "substring" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] - [[package]] name = "subtle" version = "1.0.0" @@ -12132,9 +11547,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "svm-rs" @@ -12147,7 +11562,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "sha2 0.10.8", @@ -12219,9 +11634,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -12269,21 +11684,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.4.1", - "rustix 0.38.25", - "windows-sys 0.48.0", + "rustix 0.38.28", + "windows-sys 0.52.0", ] [[package]] @@ -12299,9 +11714,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -12330,7 +11745,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -12341,28 +11756,28 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "test-case-core", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -12422,9 +11837,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -12442,9 +11857,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -12477,16 +11892,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -12504,9 +11909,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -12529,7 +11934,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -12559,7 +11964,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.9", + "rustls 0.21.10", "tokio", ] @@ -12584,12 +11989,12 @@ dependencies = [ "futures-util", "log", "native-tls", - "rustls 0.21.9", + "rustls 0.21.10", "tokio", "tokio-native-tls", "tokio-rustls", "tungstenite", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", ] [[package]] @@ -12747,7 +12152,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -12884,9 +12289,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "try-runtime-cli" @@ -12944,32 +12349,13 @@ dependencies = [ "log", "native-tls", "rand 0.8.5", - "rustls 0.21.9", + "rustls 0.21.10", "sha1", "thiserror", "url", "utf-8", ] -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures", - "log", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -13014,18 +12400,18 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unescaper" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96a44ae11e25afb520af4534fd7b0bd8cd613e35a78def813b8cf41631fa3c8" +checksum = "d8f0f68e58d297ba8b22b8b5a96a87b863ba6bb46aaf51e19a4b02c5a6dd5b7f" dependencies = [ "thiserror", ] [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -13060,16 +12446,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array 0.14.7", - "subtle 2.4.1", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -13077,7 +12453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.4.1", + "subtle 2.5.0", ] [[package]] @@ -13133,7 +12509,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "serde", ] @@ -13142,9 +12518,6 @@ name = "uuid" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" -dependencies = [ - "getrandom 0.2.11", -] [[package]] name = "validator" @@ -13233,21 +12606,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "waitgroup" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" -dependencies = [ - "atomic-waker", -] - -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" version = "2.4.0" @@ -13281,9 +12639,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -13291,24 +12649,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -13318,9 +12676,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -13328,22 +12686,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-instrument" @@ -13463,7 +12821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.5", + "base64 0.21.6", "bincode 1.3.3", "directories-next", "file-per-thread-logger", @@ -13592,7 +12950,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand 0.8.5", "rustix 0.36.17", @@ -13616,9 +12974,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -13631,7 +12989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5388522c899d1e1c96a4c307e3797e0f697ba7c77dd8e0e625ecba9dd0342937" dependencies = [ "arrayvec 0.7.4", - "base64 0.21.5", + "base64 0.21.6", "bytes", "derive_more", "ethabi", @@ -13672,23 +13030,13 @@ dependencies = [ "url", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "webpki" version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -13698,222 +13046,14 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.4", + "webpki", ] [[package]] name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring 0.16.20", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.8", - "stun", - "thiserror", - "time", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.3", - "async-trait", - "bincode 1.3.3", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf", - "hmac 0.12.1", - "log", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.10.0", - "ring 0.16.20", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.8", - "signature 1.6.4", - "subtle 2.4.1", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid 1.6.1", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.10", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "crc", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1", - "subtle 2.4.1", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", -] +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -13924,7 +13064,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.25", + "rustix 0.38.28", ] [[package]] @@ -13989,7 +13129,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", + "windows-core 0.51.1", "windows-targets 0.48.5", ] @@ -14002,6 +13142,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -14020,6 +13169,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -14050,6 +13208,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -14062,6 +13235,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -14074,6 +13253,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -14086,6 +13271,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -14098,6 +13289,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -14110,6 +13307,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -14122,6 +13325,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -14134,11 +13343,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -14204,38 +13419,19 @@ dependencies = [ "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring 0.16.20", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", @@ -14287,22 +13483,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -14322,7 +13518,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -14331,7 +13527,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes 0.8.3", + "aes", "byteorder", "bzip2", "constant_time_eq 0.1.5", diff --git a/Cargo.toml b/Cargo.toml index 3656484439..27e0d10e47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -200,13 +200,13 @@ cairo-vm = { git = "https://github.com/keep-starknet-strange/cairo-rs", branch = "cairo-1-hints", "parity-scale-codec", ] } -starknet-crypto = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } -starknet-core = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } -starknet-providers = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } -starknet-ff = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } -starknet-signers = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } -starknet-accounts = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } -starknet-contract = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "a35ce22", default-features = false } +starknet-crypto = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } +starknet-core = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } +starknet-providers = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } +starknet-ff = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } +starknet-signers = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } +starknet-accounts = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } +starknet-contract = { git = "https://github.com/xJonathanLEI/starknet-rs.git", rev = "95d50ac", default-features = false } blockifier = { git = "https://github.com/keep-starknet-strange/blockifier", branch = "no_std-support-7578442", default-features = false, features = [ "parity-scale-codec", diff --git a/configs/genesis-assets/genesis.json b/configs/genesis-assets/genesis.json index e0055270ab..d553da11e1 100644 --- a/configs/genesis-assets/genesis.json +++ b/configs/genesis-assets/genesis.json @@ -143,35 +143,35 @@ "contract_address": "0x1", "class_hash": "0x0279d77db761fba82e0054125a6fdb5f6baa6286fa3fb73450cc44d193c2d37f", "name": "No Validation Account", - "private_key": null + "private_key": null, + "public_key": "0x0" }, { "contract_address": "0x2", "class_hash": "0x06f0d6f6ae72e1a507ff4b65181291642889742dbf8f1a53e9ec1c595d01ba7d", "name": "Argent Account", "private_key": [ - 48, 120, 48, 48, 99, 49, 99, 102, 49, 52, 57, 48, 100, 101, 49, 51, 53, - 50, 56, 54, 53, 51, 48, 49, 98, 98, 56, 55, 48, 53, 49, 52, 51, 102, 51, - 101, 102, 57, 51, 56, 102, 57, 55, 102, 100, 102, 56, 57, 50, 102, 49, - 48, 57, 48, 100, 99, 98, 53, 97, 99, 55, 98, 99, 100, 49, 100 - ] + 0, 193, 207, 20, 144, 222, 19, 82, 134, 83, 1, 187, 135, 5, 20, 63, 62, + 249, 56, 249, 127, 223, 137, 47, 16, 144, 220, 181, 172, 123, 205, 29 + ], + "public_key": "0x3603a2692a2ae60abb343e832ee53b55d6b25f02a3ef1565ec691edc7a209b2" }, { "contract_address": "0x3", "class_hash": "0x006280083f8c2a2db9f737320d5e3029b380e0e820fe24b8d312a6a34fdba0cd", "name": "Openzeppelin Account", "private_key": [ - 48, 120, 48, 48, 99, 49, 99, 102, 49, 52, 57, 48, 100, 101, 49, 51, 53, - 50, 56, 54, 53, 51, 48, 49, 98, 98, 56, 55, 48, 53, 49, 52, 51, 102, 51, - 101, 102, 57, 51, 56, 102, 57, 55, 102, 100, 102, 56, 57, 50, 102, 49, - 48, 57, 48, 100, 99, 98, 53, 97, 99, 55, 98, 99, 100, 49, 100 - ] + 0, 193, 207, 20, 144, 222, 19, 82, 134, 83, 1, 187, 135, 5, 20, 63, 62, + 249, 56, 249, 127, 223, 137, 47, 16, 144, 220, 181, 172, 123, 205, 29 + ], + "public_key": "0x3603a2692a2ae60abb343e832ee53b55d6b25f02a3ef1565ec691edc7a209b2" }, { "contract_address": "0x4", "class_hash": "0x02f99bf9799ada84cd5ac0d0fe36b9d8f65efcb377cd2e8cf8309ad2daf15e4b", "name": "No Validation Account (cairo 1)", - "private_key": null + "private_key": null, + "public_key": "0x0" } ], "storage": [ diff --git a/configs/index.json b/configs/index.json index dcf6f1a6be..d68577dd74 100644 --- a/configs/index.json +++ b/configs/index.json @@ -27,7 +27,7 @@ }, { "name": "genesis.json", - "md5": "eb71ae350b3165a08524a7f0170402b4" + "md5": "8b36630988032b77d747b389080175ff" }, { "name": "NoValidateAccount.casm.json", diff --git a/crates/client/data-availability/Cargo.toml b/crates/client/data-availability/Cargo.toml new file mode 100644 index 0000000000..e3b1f2829d --- /dev/null +++ b/crates/client/data-availability/Cargo.toml @@ -0,0 +1,71 @@ +[package] +name = "mc-data-availability" +version = "0.1.0" +description = "Starknet data availability." +homepage = "https://github.com/keep-starknet-strange/madara" +edition = "2021" +license = "MIT" +publish = false +repository = "https://github.com/keep-starknet-strange/madara" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +anyhow = { workspace = true } +async-trait = { workspace = true } +futures = "0.3.21" +indexmap = { workspace = true } +jsonrpsee = { version = "0.20.0", features = [ + "http-client", + "ws-client", + "macros", +] } +log = { workspace = true } +reqwest = { version = "0.11.18", features = ["blocking", "json"] } +serde = { workspace = true, default-features = true } +serde_json = { workspace = true, default-features = true } +thiserror = { workspace = true } +tokio = { version = "1", features = ["full"] } +url = { workspace = true } +uuid = { version = "1.4.0", features = ["v4", "serde"] } + +# Substrate +sc-client-api = { workspace = true } +sp-api = { workspace = true, features = ["std"] } +sp-blockchain = { workspace = true } +sp-core = { workspace = true, features = ["std"] } +sp-io = { workspace = true, features = ["std"] } +sp-runtime = { workspace = true, features = ["std"] } + +# Starknet +blockifier = { workspace = true, default-features = true } +mc-commitment-state-diff = { workspace = true, default-features = true } +mc-db = { workspace = true, default-features = true } +pallet-starknet-runtime-api = { workspace = true, features = ["std"] } +starknet_api = { workspace = true, default-features = true } + +# Ethereum +ethers = { workspace = true } + +# Madara +mp-digest-log = { workspace = true, default-features = true } +mp-hashers = { workspace = true, default-features = true } +mp-storage = { workspace = true, default-features = true } + +# Prometheus +prometheus-endpoint = { workspace = true } + +# Optional +avail-subxt = { git = "https://github.com/availproject/avail", version = "0.4.0", tag = "v1.8.0.0", optional = true } +celestia-rpc = { git = "https://github.com/eigerco/lumina", rev = "ccc5b9bfeac632cccd32d35ecb7b7d51d71fbb87", optional = true } +celestia-types = { git = "https://github.com/eigerco/lumina", rev = "ccc5b9bfeac632cccd32d35ecb7b7d51d71fbb87", optional = true } +clap = { workspace = true, features = ["derive"], optional = true } +sp-keyring = { workspace = true, optional = true } +subxt = { workspace = true, optional = true } + +[features] +default = [] +clap = ["dep:clap"] +avail = ["dep:avail-subxt", "dep:sp-keyring", "dep:subxt"] +celestia = ["dep:celestia-rpc", "dep:celestia-types"] diff --git a/crates/client/data-availability/src/lib.rs b/crates/client/data-availability/src/lib.rs new file mode 100644 index 0000000000..6463b0ad86 --- /dev/null +++ b/crates/client/data-availability/src/lib.rs @@ -0,0 +1,234 @@ +#[cfg(feature = "avail")] +pub mod avail; +#[cfg(feature = "celestia")] +pub mod celestia; +pub mod ethereum; +mod sharp; +pub mod utils; + +mod da_metrics; + +use std::collections::HashMap; +use std::fmt::Display; +use std::marker::PhantomData; +use std::sync::Arc; +use std::time; + +use anyhow::{anyhow, Result}; +use async_trait::async_trait; +use ethers::types::{I256, U256}; +use futures::channel::mpsc; +use futures::StreamExt; +use mc_commitment_state_diff::BlockDAData; +use mp_hashers::HasherT; +use prometheus_endpoint::prometheus::core::AtomicU64; +use prometheus_endpoint::{register, Gauge, Opts, Registry as PrometheusRegistry}; +use serde::{Deserialize, Serialize}; +use sp_runtime::traits::Block as BlockT; +use starknet_api::block::BlockHash; +use starknet_api::state::ThinStateDiff; +use utils::state_diff_to_calldata; + +use crate::da_metrics::DaMetrics; + +pub struct DataAvailabilityWorker(PhantomData<(B, H)>); + +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +pub enum DaLayer { + #[cfg(feature = "celestia")] + Celestia, + Ethereum, + #[cfg(feature = "avail")] + Avail, +} + +/// Data availability modes in which Madara can be initialized. +/// +/// Default only mode currently implemented is Sovereing. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +pub enum DaMode { + /// Full Validity Rollup + /// + /// Generates a Cairo execution trace of the StarknetOS + /// run for the given block as it is applied to the current Madara state. + /// Once this execution trace is proved to the L1 Verifier(i.e. [Ethereum](https://goerli.etherscan.io/address/0x8f97970aC5a9aa8D130d35146F5b59c4aef57963)) + /// the relevant [state diff](https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/on-chain-data) can be written and validated against the on-chain + /// proof verification of the block propagation. + #[serde(rename = "validity")] + Validity, + /// Hybrid Volition + /// + /// Volitions allow applications and users to interoperate between on-chain data and off-chain + /// da. Although full specs are not currently available, this mode will entail generating + /// a StarknetOS execution trace for data elected to be on-chain and interaction w/ the prover + /// will be necessary. + #[serde(rename = "volition")] + Volition, + /// Sovereign Rollup + /// + /// Sovereign state diffs are untethered to an accompanying validity proof therefore + /// they can simply be published to any da solution available. As this solution does not + /// require an execution trace to be proved we can simply parse the state diff from the + /// storage changes of the block. + #[serde(rename = "sovereign")] + #[default] + Sovereign, +} + +impl Display for DaMode { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + DaMode::Validity => Display::fmt("Validity", f), + DaMode::Volition => Display::fmt("Volition", f), + DaMode::Sovereign => Display::fmt("Sovereign", f), + } + } +} + +#[async_trait] +pub trait DaClient: Send + Sync { + fn get_mode(&self) -> DaMode; + async fn last_published_state(&self) -> Result; + async fn publish_state_diff(&self, state_diff: Vec) -> Result<()>; + fn get_da_metric_labels(&self) -> HashMap; +} + +/// The client worker for DA related tasks +/// +/// Listen to new block state diff and spawn new threads to execute each block flow concurently. +/// The flow goes as follow: +/// 1. Prove. Do nothing if node is run in sovereign mode +/// 2. Updata +impl DataAvailabilityWorker +where + B: BlockT, + H: HasherT, +{ + pub async fn prove_current_block( + da_client: Arc, + prometheus: Option, + mut state_diffs_rx: mpsc::Receiver, + madara_backend: Arc>, + ) { + let da_metrics = prometheus.as_ref().and_then(|registry| DaMetrics::register(registry).ok()); + if let Some(registry) = prometheus.as_ref() { + let gauge = Gauge::::with_opts( + Opts::new("madara_da_layer_info", "Information about the data availability layer used") + .const_labels(da_client.get_da_metric_labels()), + ); + match gauge { + Ok(gauge) => match register(gauge, registry) { + Ok(_) => (), + Err(e) => { + log::error!("failed to register gauge for da layer info metrics: {e}"); + } + }, + Err(e) => { + log::error!("failed to create gauge for da layer info metrics: {e}"); + } + } + } + while let Some(BlockDAData(starknet_block_hash, csd, num_addr_accessed)) = state_diffs_rx.next().await { + log::info!("Received state diff for block {starknet_block_hash}"); + + let da_metrics = da_metrics.clone(); + let da_client = da_client.clone(); + let madara_backend = madara_backend.clone(); + tokio::spawn(async move { + let prove_state_start = time::Instant::now(); + + if let Err(err) = + prove(da_client.get_mode(), starknet_block_hash, &csd, num_addr_accessed, madara_backend.clone()) + .await + { + log::error!("Failed to prove block: {err}"); + } + let prove_state_end = time::Instant::now(); + + if let Err(err) = + update_state::(madara_backend, da_client, starknet_block_hash, csd, num_addr_accessed).await + { + log::error!("Failed to update the DA state: {err}"); + }; + let update_state_end = time::Instant::now(); + + if let Some(da_metrics) = da_metrics { + da_metrics + .state_proofs + .observe(prove_state_end.saturating_duration_since(prove_state_start).as_secs_f64()); + da_metrics + .state_updates + .observe(update_state_end.saturating_duration_since(prove_state_end).as_secs_f64()); + } + }); + } + } +} + +pub async fn prove( + da_mode: DaMode, + block_hash: BlockHash, + _state_diff: &ThinStateDiff, + _num_addr_accessed: usize, + madara_backend: Arc>, +) -> Result<(), anyhow::Error> { + match da_mode { + DaMode::Validity => { + // Submit the Starknet OS PIE + // TODO: Validity Impl + // run the Starknet OS with the Cairo VM + // extract the PIE from the Cairo VM run + // pass the PIE to `submit_pie` and zip/base64 internal + if let Ok(job_resp) = sharp::submit_pie("TODO") { + log::info!("Proof job submitted with key '{}'", job_resp.cairo_job_key); + // Store the cairo job key + madara_backend + .da() + .update_cairo_job(&block_hash, job_resp.cairo_job_key) + .map_err(|e| anyhow!("{e}"))?; + } + } + _ => { + log::info!("No proof required for current DA mode ({da_mode}).") + } + } + + Ok(()) +} + +pub async fn update_state( + madara_backend: Arc>, + da_client: Arc, + starknet_block_hash: BlockHash, + csd: ThinStateDiff, + num_addr_accessed: usize, +) -> Result<(), anyhow::Error> { + // store the state diff + madara_backend + .da() + .store_state_diff(&starknet_block_hash, state_diff_to_calldata(csd, num_addr_accessed)) + .map_err(|e| anyhow!("{e}"))?; + + // Query last written state + // TODO: this value will be used to ensure the correct state diff is being written in + // Validity mode + let _last_published_state = da_client.last_published_state().await?; + + match da_client.get_mode() { + DaMode::Validity => { + // Check the SHARP status of last_proved + 1 + // Write the publish state diff of last_proved + 1 + log::info!("validity da mode not implemented"); + } + DaMode::Sovereign => match madara_backend.da().state_diff(&starknet_block_hash) { + Ok(state_diff) => { + da_client.publish_state_diff(state_diff).await.map_err(|e| anyhow!("DA PUBLISH ERROR: {e}"))?; + } + Err(e) => Err(anyhow!("could not pull state diff for block {starknet_block_hash}: {e}"))?, + }, + DaMode::Volition => log::info!("volition da mode not implemented"), + }; + + Ok(()) +} diff --git a/crates/client/deoxys/Cargo.toml b/crates/client/deoxys/Cargo.toml index 8dac442d37..d5abd7f7d2 100644 --- a/crates/client/deoxys/Cargo.toml +++ b/crates/client/deoxys/Cargo.toml @@ -53,6 +53,7 @@ mp-commitments = { workspace = true } mp-felt = { workspace = true } mp-hashers = { workspace = true } mp-transactions = { workspace = true, features = ["client"] } +mp-fee = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive"] } sc-consensus-manual-seal.workspace = true validator = { workspace = true, features = ["derive"] } diff --git a/crates/client/deoxys/src/convert.rs b/crates/client/deoxys/src/convert.rs index f492349fdb..07f7cb907f 100644 --- a/crates/client/deoxys/src/convert.rs +++ b/crates/client/deoxys/src/convert.rs @@ -1,6 +1,7 @@ //! Converts types from [`starknet_providers`] to madara's expected types. use starknet_api::hash::StarkFelt; +use mp_fee::ResourcePrice; use starknet_ff::FieldElement; use starknet_providers::sequencer::models as p; @@ -10,6 +11,7 @@ pub fn block(block: &p::Block) -> mp_block::Block { let block_number = block.block_number.expect("no block number provided"); let sequencer_address = block.sequencer_address.map_or(contract_address(FieldElement::ZERO), contract_address); let (transaction_commitment, event_commitment) = commitments(&transactions, &events, block_number); + let l1_gas_price = ResourcePrice::default(); let header = mp_block::Header { parent_block_hash: felt(block.parent_block_hash), @@ -22,6 +24,7 @@ pub fn block(block: &p::Block) -> mp_block::Block { event_count: events.len() as u128, event_commitment, protocol_version: 0, + l1_gas_price, extra_data: block.block_hash.map(|h| sp_core::U256::from_big_endian(&h.to_bytes_be())), }; @@ -47,7 +50,7 @@ fn transaction(transaction: &p::TransactionType) -> mp_transactions::Transaction fn invoke_transaction(tx: &p::InvokeFunctionTransaction) -> mp_transactions::InvokeTransaction { if tx.version == FieldElement::ZERO { mp_transactions::InvokeTransaction::V0(mp_transactions::InvokeTransactionV0 { - max_fee: fee(tx.max_fee), + max_fee: fee(tx.max_fee.expect("no max fee provided")), signature: tx.signature.iter().copied().map(felt).map(Into::into).collect(), contract_address: felt(tx.sender_address).into(), entry_point_selector: felt(tx.entry_point_selector.expect("no entry_point_selector provided")).into(), @@ -55,11 +58,12 @@ fn invoke_transaction(tx: &p::InvokeFunctionTransaction) -> mp_transactions::Inv }) } else { mp_transactions::InvokeTransaction::V1(mp_transactions::InvokeTransactionV1 { - max_fee: fee(tx.max_fee), + max_fee: fee(tx.max_fee.expect("no max fee provided")), signature: tx.signature.iter().copied().map(felt).map(Into::into).collect(), nonce: felt(tx.nonce.expect("no nonce provided")).into(), sender_address: felt(tx.sender_address).into(), calldata: tx.calldata.iter().copied().map(felt).map(Into::into).collect(), + offset_version: false, }) } } @@ -67,7 +71,7 @@ fn invoke_transaction(tx: &p::InvokeFunctionTransaction) -> mp_transactions::Inv fn declare_transaction(tx: &p::DeclareTransaction) -> mp_transactions::DeclareTransaction { if tx.version == FieldElement::ZERO { mp_transactions::DeclareTransaction::V0(mp_transactions::DeclareTransactionV0 { - max_fee: fee(tx.max_fee), + max_fee: fee(tx.max_fee.expect("no max fee provided")), signature: tx.signature.iter().copied().map(felt).map(Into::into).collect(), nonce: felt(tx.nonce).into(), class_hash: felt(tx.class_hash).into(), @@ -75,20 +79,22 @@ fn declare_transaction(tx: &p::DeclareTransaction) -> mp_transactions::DeclareTr }) } else if tx.version == FieldElement::ONE { mp_transactions::DeclareTransaction::V1(mp_transactions::DeclareTransactionV1 { - max_fee: fee(tx.max_fee), + max_fee: fee(tx.max_fee.expect("no max fee provided")), signature: tx.signature.iter().copied().map(felt).map(Into::into).collect(), nonce: felt(tx.nonce).into(), class_hash: felt(tx.class_hash).into(), sender_address: felt(tx.sender_address).into(), + offset_version: false, }) } else { mp_transactions::DeclareTransaction::V2(mp_transactions::DeclareTransactionV2 { - max_fee: fee(tx.max_fee), + max_fee: fee(tx.max_fee.expect("no max fee provided")), signature: tx.signature.iter().copied().map(felt).map(Into::into).collect(), nonce: felt(tx.nonce).into(), class_hash: felt(tx.class_hash).into(), sender_address: felt(tx.sender_address).into(), compiled_class_hash: felt(tx.compiled_class_hash.expect("no class hash available")).into(), + offset_version: false, }) } } @@ -104,12 +110,13 @@ fn deploy_transaction(tx: &p::DeployTransaction) -> mp_transactions::DeployTrans fn deploy_account_transaction(tx: &p::DeployAccountTransaction) -> mp_transactions::DeployAccountTransaction { mp_transactions::DeployAccountTransaction { - max_fee: fee(tx.max_fee), + max_fee: fee(tx.max_fee.expect("no max fee provided")), signature: tx.signature.iter().copied().map(felt).map(Into::into).collect(), nonce: felt(tx.nonce).into(), contract_address_salt: felt(tx.contract_address_salt).into(), constructor_calldata: tx.constructor_calldata.iter().copied().map(felt).map(Into::into).collect(), class_hash: felt(tx.class_hash).into(), + offset_version: false, } } diff --git a/crates/client/rpc-core/starknet_openRPC.json b/crates/client/rpc-core/starknet_openRPC.json deleted file mode 100644 index d002f99d06..0000000000 --- a/crates/client/rpc-core/starknet_openRPC.json +++ /dev/null @@ -1,2225 +0,0 @@ -{ - "openrpc": "1.0.0-rc1", - "info": { - "version": "0.50.0", - "title": "Starknet Node API", - "license": {} - }, - "servers": [], - "methods": [ - { - "name": "starknet_getBlockWithTxHashes", - "summary": "Get block information with transaction hashes given the block id", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "description": "The resulting block information with transaction hashes", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/BLOCK_WITH_TX_HASHES" - }, - { - "$ref": "#/components/schemas/PENDING_BLOCK_WITH_TX_HASHES" - } - ] - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getBlockWithTxs", - "summary": "Get block information with full transactions given the block id", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "description": "The resulting block information with full transactions", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/BLOCK_WITH_TXS" - }, - { - "$ref": "#/components/schemas/PENDING_BLOCK_WITH_TXS" - } - ] - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getStateUpdate", - "summary": "Get the information about the result of executing the requested block", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "description": "The information about the state update of the requested block", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/STATE_UPDATE" - }, - { - "$ref": "#/components/schemas/PENDING_STATE_UPDATE" - } - ] - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getStorageAt", - "summary": "Get the value of the storage at the given address and key", - "params": [ - { - "name": "contract_address", - "description": "The address of the contract to read from", - "summary": "The address of the contract to read from", - "required": true, - "schema": { - "$ref": "#/components/schemas/ADDRESS" - } - }, - { - "name": "key", - "description": "The key to the storage value for the given contract", - "summary": "The key to the storage value for the given contract", - "required": true, - "schema": { - "$ref": "#/components/schemas/STORAGE_KEY" - } - }, - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "description": "The value at the given key for the given contract. 0 if no value is found", - "summary": "The value at the given key for the given contract.", - "schema": { - "$ref": "#/components/schemas/FELT" - } - }, - "errors": [ - { - "$ref": "#/components/errors/CONTRACT_NOT_FOUND" - }, - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getTransactionByHash", - "summary": "Get the details and status of a submitted transaction", - "paramStructure": "by-name", - "params": [ - { - "name": "transaction_hash", - "summary": "The hash of the requested transaction", - "required": true, - "schema": { - "$ref": "#/components/schemas/TXN_HASH" - } - } - ], - "result": { - "name": "result", - "schema": { - "$ref": "#/components/schemas/TXN" - } - }, - "errors": [ - { - "$ref": "#/components/errors/TXN_HASH_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getTransactionByBlockIdAndIndex", - "summary": "Get the details of a transaction by a given block id and index", - "description": "Get the details of the transaction given by the identified block and index in that block. If no transaction is found, null is returned.", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - }, - { - "name": "index", - "summary": "The index in the block to search for the transaction", - "required": true, - "schema": { - "type": "integer", - "minimum": 0 - } - } - ], - "result": { - "name": "transactionResult", - "schema": { - "$ref": "#/components/schemas/TXN" - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - }, - { - "$ref": "#/components/errors/INVALID_TXN_INDEX" - } - ] - }, - { - "name": "starknet_getTransactionReceipt", - "summary": "Get the transaction receipt by the transaction hash", - "paramStructure": "by-name", - "params": [ - { - "name": "transaction_hash", - "summary": "The hash of the requested transaction", - "required": true, - "schema": { - "$ref": "#/components/schemas/TXN_HASH" - } - } - ], - "result": { - "name": "result", - "schema": { - "$ref": "#/components/schemas/TXN_RECEIPT" - } - }, - "errors": [ - { - "$ref": "#/components/errors/TXN_HASH_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getClass", - "summary": "Get the contract class definition in the given block associated with the given hash", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - }, - { - "name": "class_hash", - "description": "The hash of the requested contract class", - "required": true, - "schema": { - "$ref": "#/components/schemas/FELT" - } - } - ], - "result": { - "name": "result", - "description": "The contract class, if found", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS" - }, - { - "$ref": "#/components/schemas/CONTRACT_CLASS" - } - ] - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - }, - { - "$ref": "#/components/errors/CLASS_HASH_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getClassHashAt", - "summary": "Get the contract class hash in the given block for the contract deployed at the given address", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - }, - { - "name": "contract_address", - "description": "The address of the contract whose class hash will be returned", - "required": true, - "schema": { - "$ref": "#/components/schemas/ADDRESS" - } - } - ], - "result": { - "name": "result", - "description": "The class hash of the given contract", - "schema": { - "$ref": "#/components/schemas/FELT" - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - }, - { - "$ref": "#/components/errors/CONTRACT_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getClassAt", - "summary": "Get the contract class definition in the given block at the given address", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - }, - { - "name": "contract_address", - "description": "The address of the contract whose class definition will be returned", - "required": true, - "schema": { - "$ref": "#/components/schemas/ADDRESS" - } - } - ], - "result": { - "name": "result", - "description": "The contract class", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS" - }, - { - "$ref": "#/components/schemas/CONTRACT_CLASS" - } - ] - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - }, - { - "$ref": "#/components/errors/CONTRACT_NOT_FOUND" - } - ] - }, - { - "name": "starknet_getBlockTransactionCount", - "summary": "Get the number of transactions in a block given a block id", - "description": "Returns the number of transactions in the designated block.", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "description": "The number of transactions in the designated block", - "summary": "The number of transactions in the designated block", - "schema": { - "type": "integer", - "minimum": 0 - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_call", - "summary": "call a starknet function without creating a Starknet transaction", - "description": "Calls a function in a contract and returns the return value. Using this call will not create a transaction; hence, will not change the state", - "params": [ - { - "name": "request", - "summary": "The details of the function call", - "schema": { - "$ref": "#/components/schemas/FUNCTION_CALL" - }, - "required": true - }, - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "summary": "The function's return value", - "description": "The function's return value, as defined in the Cairo output", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "errors": [ - { - "$ref": "#/components/errors/CONTRACT_NOT_FOUND" - }, - { - "$ref": "#/components/errors/CONTRACT_ERROR" - }, - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_estimateFee", - "summary": "estimate the fee for of Starknet transactions", - "description": "estimates the resources required by transactions when applied on a given state", - "params": [ - { - "name": "request", - "summary": "The transaction to estimate", - "schema": { - "type": "array", - "description": "a sequence of transactions to estimate, running each transaction on the state resulting from applying all the previous ones", - "items": { - "$ref": "#/components/schemas/BROADCASTED_TXN" - } - }, - "required": true - }, - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - } - ], - "result": { - "name": "result", - "description": "the fee estimations", - "schema": { - "type": "array", - "description": "a sequence of fee estimatione where the i'th estimate corresponds to the i'th transaction", - "items": { - "$ref": "#/components/schemas/FEE_ESTIMATE" - } - } - }, - "errors": [ - { - "$ref": "#/components/errors/CONTRACT_NOT_FOUND" - }, - { - "$ref": "#/components/errors/CONTRACT_ERROR" - }, - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - } - ] - }, - { - "name": "starknet_blockNumber", - "summary": "Get the most recent accepted block number", - "params": [], - "result": { - "name": "result", - "description": "The latest block number", - "schema": { - "$ref": "#/components/schemas/BLOCK_NUMBER" - } - }, - "errors": [ - { - "$ref": "#/components/errors/NO_BLOCKS" - } - ] - }, - { - "name": "starknet_blockHashAndNumber", - "summary": "Get the most recent accepted block hash and number", - "params": [], - "result": { - "name": "result", - "description": "The latest block hash and number", - "schema": { - "type": "object", - "properties": { - "block_hash": { - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "block_number": { - "$ref": "#/components/schemas/BLOCK_NUMBER" - } - } - } - }, - "errors": [ - { - "$ref": "#/components/errors/NO_BLOCKS" - } - ] - }, - { - "name": "starknet_chainId", - "summary": "Return the currently configured Starknet chain id", - "params": [], - "result": { - "name": "result", - "description": "The chain id this node is connected to", - "schema": { - "$ref": "#/components/schemas/CHAIN_ID" - } - } - }, - { - "name": "starknet_pendingTransactions", - "summary": "Returns the transactions in the transaction pool, recognized by this sequencer", - "params": [], - "result": { - "name": "result", - "schema": { - "type": "array", - "title": "Pending Transactions", - "items": { - "$ref": "#/components/schemas/TXN" - } - } - } - }, - { - "name": "starknet_syncing", - "summary": "Returns an object about the sync status, or false if the node is not syncing", - "params": [], - "result": { - "name": "syncing", - "summary": "The state of the synchronization, or false if the node is not synchronizing", - "description": "The status of the node, if it is currently synchronizing state. FALSE otherwise", - "schema": { - "oneOf": [ - { - "type": "boolean", - "description": "only legal value is FALSE here" - }, - { - "$ref": "#/components/schemas/SYNC_STATUS" - } - ] - } - } - }, - { - "name": "starknet_getEvents", - "summary": "Returns all events matching the given filter", - "description": "Returns all event objects matching the conditions in the provided filter", - "params": [ - { - "name": "filter", - "summary": "The conditions used to filter the returned events", - "required": true, - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/EVENT_FILTER" - }, - { - "$ref": "#/components/schemas/RESULT_PAGE_REQUEST" - } - ] - } - } - ], - "result": { - "name": "events", - "description": "All the event objects matching the filter", - "schema": { - "$ref": "#/components/schemas/EVENTS_CHUNK" - } - }, - "errors": [ - { - "$ref": "#/components/errors/PAGE_SIZE_TOO_BIG" - }, - { - "$ref": "#/components/errors/INVALID_CONTINUATION_TOKEN" - }, - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - }, - { - "$ref": "#/components/errors/TOO_MANY_KEYS_IN_FILTER" - } - ] - }, - { - "name": "starknet_getNonce", - "summary": "Get the nonce associated with the given address in the given block", - "params": [ - { - "name": "block_id", - "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", - "required": true, - "schema": { - "$ref": "#/components/schemas/BLOCK_ID" - } - }, - { - "name": "contract_address", - "description": "The address of the contract whose nonce we're seeking", - "required": true, - "schema": { - "$ref": "#/components/schemas/ADDRESS" - } - } - ], - "result": { - "name": "result", - "description": "The last nonce used for the given contract.", - "schema": { - "$ref": "#/components/schemas/FELT" - } - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" - }, - { - "$ref": "#/components/errors/CONTRACT_NOT_FOUND" - } - ] - } - ], - "components": { - "contentDescriptors": {}, - "schemas": { - "EVENTS_CHUNK": { - "type": "object", - "properties": { - "events": { - "type": "array", - "title": "Matching Events", - "items": { - "$ref": "#/components/schemas/EMITTED_EVENT" - } - }, - "continuation_token": { - "description": "Use this token in a subsequent query to obtain the next page. Should not appear if there are no more pages.", - "type": "string" - } - }, - "required": ["events"] - }, - "RESULT_PAGE_REQUEST": { - "type": "object", - "properties": { - "continuation_token": { - "description": "The token returned from the previous query. If no token is provided the first page is returned.", - "type": "string" - }, - "chunk_size": { - "type": "integer", - "minimum": 1 - } - }, - "required": ["chunk_size"] - }, - "EMITTED_EVENT": { - "title": "An event emitted as a result of transaction execution", - "description": "Event information decorated with metadata on where it was emitted", - "allOf": [ - { - "title": "The event information", - "$ref": "#/components/schemas/EVENT" - }, - { - "title": "The event emission information", - "type": "object", - "properties": { - "block_hash": { - "title": "The hash of the block in which the event was emitted", - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "block_number": { - "title": "The number of the block in which the event was emitted", - "$ref": "#/components/schemas/BLOCK_NUMBER" - }, - "transaction_hash": { - "title": "The transaction that emitted the event", - "$ref": "#/components/schemas/TXN_HASH" - } - }, - "required": ["block_hash", "block_number", "transaction_hash"] - } - ] - }, - "EVENT": { - "title": "A Starknet event", - "allOf": [ - { - "type": "object", - "properties": { - "from_address": { - "$ref": "#/components/schemas/ADDRESS" - } - }, - "required": ["from_address"] - }, - { - "$ref": "#/components/schemas/EVENT_CONTENT" - } - ] - }, - "EVENT_CONTENT": { - "title": "Event Content", - "description": "The content of an event", - "type": "object", - "properties": { - "keys": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "required": ["keys", "data"] - }, - "EVENT_FILTER": { - "title": "An event filter/query", - "type": "object", - "properties": { - "from_block": { - "title": "from block", - "$ref": "#/components/schemas/BLOCK_ID" - }, - "to_block": { - "title": "to block", - "$ref": "#/components/schemas/BLOCK_ID" - }, - "address": { - "title": "from contract", - "$ref": "#/components/schemas/ADDRESS" - }, - "keys": { - "title": "filter key values", - "description": "The values used to filter the events", - "type": "array", - "items": { - "title": "Possible values, per key", - "description": "Per key (by position), designate the possible values to be matched for events to be returned. Empty array designates 'any' value", - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - } - } - }, - "BLOCK_ID": { - "title": "Block hash, number or tag", - "oneOf": [ - { - "type": "object", - "properties": { - "block_hash": { - "$ref": "#/components/schemas/BLOCK_HASH" - } - }, - "required": ["block_hash"] - }, - { - "type": "object", - "properties": { - "block_number": { - "$ref": "#/components/schemas/BLOCK_NUMBER" - } - }, - "required": ["block_number"] - }, - { - "$ref": "#/components/schemas/BLOCK_TAG" - } - ] - }, - "BLOCK_TAG": { - "type": "string", - "description": "A tag specifying a dynamic reference to a block", - "enum": ["latest", "pending"] - }, - "SYNC_STATUS": { - "type": "object", - "description": "An object describing the node synchronization status", - "properties": { - "starting_block_hash": { - "description": "The hash of the block from which the sync started", - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "starting_block_num": { - "description": "The number (height) of the block from which the sync started", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "current_block_hash": { - "description": "The hash of the current block being synchronized", - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "current_block_num": { - "description": "The number (height) of the current block being synchronized", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "highest_block_hash": { - "description": "The hash of the estimated highest block to be synchronized", - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "highest_block_num": { - "description": "The number (height) of the estimated highest block to be synchronized", - "$ref": "#/components/schemas/NUM_AS_HEX" - } - }, - "required": [ - "starting_block_hash", - "starting_block_num", - "current_block_hash", - "current_block_num", - "highest_block_hash", - "highest_block_num" - ] - }, - "NUM_AS_HEX": { - "title": "An integer number in hex format (0x...)", - "type": "string", - "pattern": "^0x[a-fA-F0-9]+$" - }, - "CHAIN_ID": { - "title": "chainId", - "description": "Starknet chain id, given in hex representation.", - "type": "string", - "pattern": "^0x[a-fA-F0-9]+$" - }, - "STATE_UPDATE": { - "type": "object", - "allOf": [ - { - "type": "object", - "properties": { - "block_hash": { - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "new_root": { - "description": "The new global state root", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["block_hash", "new_root"] - }, - { - "$ref": "#/components/schemas/PENDING_STATE_UPDATE" - } - ] - }, - "PENDING_STATE_UPDATE": { - "type": "object", - "properties": { - "old_root": { - "description": "The previous global state root", - "$ref": "#/components/schemas/FELT" - }, - "state_diff": { - "description": "The change in state applied in this block, given as a mapping of addresses to the new values and/or new contracts", - "type": "object", - "properties": { - "storage_diffs": { - "type": "array", - "items": { - "description": "The changes in the storage per contract address", - "$ref": "#/components/schemas/CONTRACT_STORAGE_DIFF_ITEM" - } - }, - "deprecated_declared_classes": { - "type": "array", - "items": { - "description": "The hash of the declared class", - "$ref": "#/components/schemas/FELT" - } - }, - "declared_classes": { - "type": "array", - "items": { - "description": "The declared class hash and compiled class hash", - "type": "object", - "properties": { - "class_hash": { - "description": "The hash of the declared class", - "$ref": "#/components/schemas/FELT" - }, - "compiled_class_hash": { - "description": "The Cairo assembly hash corresponding to the declared class", - "$ref": "#/components/schemas/FELT" - } - } - } - }, - "deployed_contracts": { - "type": "array", - "items": { - "description": "A new contract deployed as part of the state update", - "$ref": "#/components/schemas/DEPLOYED_CONTRACT_ITEM" - } - }, - "replaced_classes": { - "type": "array", - "items": { - "description": "The list of contracts whose class was replaced", - "type": "object", - "properties": { - "contract_address": { - "description": "The address of the contract whose class was replaced", - "$ref": "#/components/schemas/ADDRESS" - }, - "class_hash": { - "description": "The new class hash", - "$ref": "#/components/schemas/FELT" - } - } - } - }, - "nonces": { - "type": "array", - "items": { - "description": "The updated nonce per contract address", - "type": "object", - "properties": { - "contract_address": { - "description": "The address of the contract", - "$ref": "#/components/schemas/ADDRESS" - }, - "nonce": { - "description": "The nonce for the given address at the end of the block", - "$ref": "#/components/schemas/FELT" - } - } - } - } - }, - "required": [ - "storage_diffs", - "deprecated_declared_classes", - "declared_classes", - "replaced_classes", - "deployed_contracts", - "nonces" - ] - } - }, - "required": ["old_root", "state_diff"] - }, - "ADDRESS": { - "$ref": "#/components/schemas/FELT" - }, - "STORAGE_KEY": { - "type": "string", - "title": "A storage key", - "$comment": "A storage key, represented as a string of hex digits", - "description": "A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.", - "pattern": "^0x0[0-7]{1}[a-fA-F0-9]{0,62}$" - }, - "ETH_ADDRESS": { - "type": "string", - "$comment": "An ethereum address", - "description": "an ethereum address represented as 40 hex digits", - "pattern": "^0x[a-fA-F0-9]{40}$" - }, - "TXN_HASH": { - "$ref": "#/components/schemas/FELT", - "description": "The transaction hash, as assigned in Starknet", - "title": "A transaction's hash" - }, - "FELT": { - "type": "string", - "title": "Field element", - "description": "A field element. represented by at most 63 hex digits", - "pattern": "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$" - }, - "BLOCK_NUMBER": { - "description": "The block's number (its height)", - "type": "integer", - "minimum": 0 - }, - "BLOCK_HASH": { - "$ref": "#/components/schemas/FELT" - }, - "BLOCK_BODY_WITH_TX_HASHES": { - "type": "object", - "properties": { - "transactions": { - "description": "The hashes of the transactions included in this block", - "type": "array", - "items": { - "description": "The hash of a single transaction", - "$ref": "#/components/schemas/TXN_HASH" - } - } - }, - "required": ["transactions"] - }, - "BLOCK_BODY_WITH_TXS": { - "type": "object", - "properties": { - "transactions": { - "description": "The transactions in this block", - "type": "array", - "items": { - "$ref": "#/components/schemas/TXN" - } - } - }, - "required": ["transactions"] - }, - "BLOCK_HEADER": { - "type": "object", - "properties": { - "block_hash": { - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "parent_hash": { - "description": "The hash of this block's parent", - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "block_number": { - "description": "The block number (its height)", - "$ref": "#/components/schemas/BLOCK_NUMBER" - }, - "new_root": { - "description": "The new global state root", - "$ref": "#/components/schemas/FELT" - }, - "timestamp": { - "description": "The time in which the block was created, encoded in Unix time", - "type": "integer", - "minimum": 0 - }, - "sequencer_address": { - "description": "The Starknet identity of the sequencer submitting this block", - "$ref": "#/components/schemas/FELT" - } - }, - "required": [ - "block_hash", - "parent_hash", - "block_number", - "new_root", - "timestamp", - "sequencer_address" - ] - }, - "BLOCK_WITH_TX_HASHES": { - "title": "The block object", - "allOf": [ - { - "type": "object", - "properties": { - "status": { - "$ref": "#/components/schemas/BLOCK_STATUS" - } - }, - "required": ["status"] - }, - { - "$ref": "#/components/schemas/BLOCK_HEADER" - }, - { - "$ref": "#/components/schemas/BLOCK_BODY_WITH_TX_HASHES" - } - ] - }, - "BLOCK_WITH_TXS": { - "title": "The block object", - "allOf": [ - { - "type": "object", - "properties": { - "status": { - "$ref": "#/components/schemas/BLOCK_STATUS" - } - }, - "required": ["status"] - }, - { - "$ref": "#/components/schemas/BLOCK_HEADER" - }, - { - "$ref": "#/components/schemas/BLOCK_BODY_WITH_TXS" - } - ] - }, - "PENDING_BLOCK_WITH_TX_HASHES": { - "description": "The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.", - "allOf": [ - { - "$ref": "#/components/schemas/BLOCK_BODY_WITH_TX_HASHES" - }, - { - "type": "object", - "properties": { - "timestamp": { - "description": "The time in which the block was created, encoded in Unix time", - "type": "integer", - "minimum": 0 - }, - "sequencer_address": { - "description": "The Starknet identity of the sequencer submitting this block", - "$ref": "#/components/schemas/FELT" - }, - "parent_hash": { - "description": "The hash of this block's parent", - "$ref": "#/components/schemas/BLOCK_HASH" - } - } - } - ] - }, - "PENDING_BLOCK_WITH_TXS": { - "description": "The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.", - "allOf": [ - { - "$ref": "#/components/schemas/BLOCK_BODY_WITH_TXS" - }, - { - "type": "object", - "properties": { - "timestamp": { - "description": "The time in which the block was created, encoded in Unix time", - "type": "integer", - "minimum": 0 - }, - "sequencer_address": { - "description": "The Starknet identity of the sequencer submitting this block", - "$ref": "#/components/schemas/FELT" - }, - "parent_hash": { - "description": "The hash of this block's parent", - "$ref": "#/components/schemas/BLOCK_HASH" - } - } - } - ] - }, - "DEPLOYED_CONTRACT_ITEM": { - "type": "object", - "properties": { - "address": { - "description": "The address of the contract", - "$ref": "#/components/schemas/FELT" - }, - "class_hash": { - "description": "The hash of the contract code", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["address", "class_hash"] - }, - "CONTRACT_STORAGE_DIFF_ITEM": { - "type": "object", - "properties": { - "address": { - "description": "The contract address for which the storage changed", - "$ref": "#/components/schemas/FELT" - }, - "storage_entries": { - "description": "The changes in the storage of the contract", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "description": "The key of the changed value", - "$ref": "#/components/schemas/FELT" - }, - "value": { - "description": "The new value applied to the given address", - "$ref": "#/components/schemas/FELT" - } - } - } - } - }, - "required": ["address", "storage_entries"] - }, - "TXN": { - "title": "Transaction", - "description": "The transaction schema, as it appears inside a block", - "oneOf": [ - { - "$ref": "#/components/schemas/INVOKE_TXN" - }, - { - "$ref": "#/components/schemas/L1_HANDLER_TXN" - }, - { - "$ref": "#/components/schemas/DECLARE_TXN" - }, - { - "$ref": "#/components/schemas/DEPLOY_TXN" - }, - { - "$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN" - } - ] - }, - "BROADCASTED_TXN": { - "description": "the transaction's representation when it's sent to the sequencer (but not yet in a block)", - "title": "Transaction", - "oneOf": [ - { - "$ref": "#/components/schemas/BROADCASTED_INVOKE_TXN" - }, - { - "$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN" - }, - { - "$ref": "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN" - } - ] - }, - "SIGNATURE": { - "title": "A transaction signature", - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - }, - "BROADCASTED_TXN_COMMON_PROPERTIES": { - "type": "object", - "description": "common properties of a transaction that is sent to the sequencer (but is not yet in a block)", - "properties": { - "max_fee": { - "$ref": "#/components/schemas/FELT", - "description": "The maximal fee that can be charged for including the transaction" - }, - "version": { - "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "signature": { - "$ref": "#/components/schemas/SIGNATURE" - }, - "nonce": { - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["max_fee", "version", "signature", "nonce"] - }, - "COMMON_TXN_PROPERTIES": { - "allOf": [ - { - "type": "object", - "properties": { - "transaction_hash": { - "$ref": "#/components/schemas/TXN_HASH", - "description": "The hash identifying the transaction" - } - }, - "required": ["transaction_hash"] - }, - { - "$ref": "#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES" - } - ] - }, - "DECLARE_TXN": { - "oneOf": [ - { - "$ref": "#/components/schemas/DECLARE_TXN_V1" - }, - { - "$ref": "#/components/schemas/DECLARE_TXN_V2" - } - ] - }, - "DECLARE_TXN_V1": { - "title": "Declare Contract Transaction", - "allOf": [ - { - "$ref": "#/components/schemas/COMMON_TXN_PROPERTIES" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["DECLARE"] - }, - "class_hash": { - "description": "The hash of the declared class", - "$ref": "#/components/schemas/FELT" - }, - "sender_address": { - "description": "The address of the account contract sending the declaration transaction", - "$ref": "#/components/schemas/ADDRESS" - } - }, - "required": ["type", "class_hash", "sender_address"] - } - ] - }, - "DECLARE_TXN_V2": { - "title": "Declare Contract Transaction", - "allOf": [ - { - "$ref": "#/components/schemas/DECLARE_TXN_V1" - }, - { - "type": "object", - "properties": { - "compiled_class_hash": { - "description": "The hash of the Cairo assembly resulting from the Sierra compilation", - "$ref": "#/components/schemas/FELT" - } - } - } - ] - }, - "BROADCASTED_DECLARE_TXN": { - "oneOf": [ - { - "$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN_V1" - }, - { - "$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN_V2" - } - ] - }, - "BROADCASTED_DECLARE_TXN_V1": { - "title": "mempool representation of a declare transaction", - "allOf": [ - { - "$ref": "#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES" - }, - { - "type": "object", - "properties": { - "contract_class": { - "description": "The class to be declared", - "$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS" - }, - "sender_address": { - "description": "The address of the account contract sending the declaration transaction", - "$ref": "#/components/schemas/ADDRESS" - } - } - } - ] - }, - "BROADCASTED_DECLARE_TXN_V2": { - "title": "mempool representation of a declare transaction", - "allOf": [ - { - "$ref": "#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["DECLARE"] - }, - "contract_class": { - "description": "The class to be declared", - "$ref": "#/components/schemas/CONTRACT_CLASS" - }, - "sender_address": { - "description": "The address of the account contract sending the declaration transaction", - "$ref": "#/components/schemas/ADDRESS" - }, - "compiled_class_hash": { - "description": "The hash of the Cairo assembly resulting from the Sierra compilation", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["type", "contract_class", "sender_address"] - } - ] - }, - "DEPLOY_ACCOUNT_TXN": { - "title": "Deploy Account Transaction", - "description": "Deploys an account contract, charges fee from the pre-funded account addresses", - "allOf": [ - { - "$ref": "#/components/schemas/COMMON_TXN_PROPERTIES" - }, - { - "$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_PROPERTIES" - } - ] - }, - "BROADCASTED_DEPLOY_ACCOUNT_TXN": { - "description": "Mempool representation of a deploy account transaction", - "allOf": [ - { - "$ref": "#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES" - }, - { - "$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_PROPERTIES" - } - ] - }, - "DEPLOY_ACCOUNT_TXN_PROPERTIES": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["DEPLOY_ACCOUNT"] - }, - "contract_address_salt": { - "description": "The salt for the address of the deployed contract", - "$ref": "#/components/schemas/FELT" - }, - "constructor_calldata": { - "type": "array", - "description": "The parameters passed to the constructor", - "items": { - "$ref": "#/components/schemas/FELT" - } - }, - "class_hash": { - "description": "The hash of the deployed contract's class", - "$ref": "#/components/schemas/FELT" - } - }, - "required": [ - "type", - "contract_address_salt", - "constructor_calldata", - "class_hash" - ] - }, - "DEPLOY_TXN": { - "title": "Deploy Contract Transaction", - "description": "The structure of a deploy transaction. Note that this transaction type is deprecated and will no longer be supported in future versions", - "allOf": [ - { - "type": "object", - "properties": { - "transaction_hash": { - "$ref": "#/components/schemas/TXN_HASH", - "description": "The hash identifying the transaction" - }, - "class_hash": { - "description": "The hash of the deployed contract's class", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["transaction_hash", "class_hash"] - }, - { - "$ref": "#/components/schemas/DEPLOY_TXN_PROPERTIES" - } - ] - }, - "DEPLOY_TXN_PROPERTIES": { - "type": "object", - "properties": { - "version": { - "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "type": { - "type": "string", - "enum": ["DEPLOY"] - }, - "contract_address_salt": { - "description": "The salt for the address of the deployed contract", - "$ref": "#/components/schemas/FELT" - }, - "constructor_calldata": { - "type": "array", - "description": "The parameters passed to the constructor", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "required": [ - "version", - "type", - "contract_address_salt", - "constructor_calldata" - ] - }, - "INVOKE_TXN_V0": { - "title": "version 0 invoke transaction", - "description": "invokes a specific function in the desired contract (not necessarily an account)", - "$ref": "#/components/schemas/FUNCTION_CALL" - }, - "INVOKE_TXN_V1": { - "title": "version 1 invoke transaction", - "description": "initiates a transaction from a given account", - "type": "object", - "properties": { - "sender_address": { - "$ref": "#/components/schemas/ADDRESS" - }, - "calldata": { - "type": "array", - "description": "The data expected by the account's `execute` function (in most usecases, this includes the called contract address and a function selector)", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "required": ["sender_address", "calldata"] - }, - "INVOKE_TXN": { - "title": "Initiate a transaction from an account", - "allOf": [ - { - "$ref": "#/components/schemas/COMMON_TXN_PROPERTIES" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["INVOKE"] - } - }, - "required": ["type"] - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/INVOKE_TXN_V0" - }, - { - "$ref": "#/components/schemas/INVOKE_TXN_V1" - } - ] - } - ] - }, - "BROADCASTED_INVOKE_TXN": { - "description": "mempool representation of an invoke transaction", - "allOf": [ - { - "$ref": "#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["INVOKE"] - } - }, - "required": ["type"] - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/INVOKE_TXN_V0" - }, - { - "$ref": "#/components/schemas/INVOKE_TXN_V1" - } - ] - } - ] - }, - "L1_HANDLER_TXN": { - "allOf": [ - { - "type": "object", - "title": "l1-->l2 message transaction", - "description": "a call to an l1_handler on an L2 contract induced by a message from L1", - "properties": { - "transaction_hash": { - "$ref": "#/components/schemas/TXN_HASH", - "description": "The hash identifying the transaction" - }, - "version": { - "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "type": { - "type": "string", - "enum": ["L1_HANDLER"] - }, - "nonce": { - "description": "The L1->L2 message nonce field of the SN Core L1 contract at the time the transaction was sent", - "$ref": "#/components/schemas/NUM_AS_HEX" - } - }, - "required": ["transaction_hash", "version", "type", "nonce"] - }, - { - "$ref": "#/components/schemas/FUNCTION_CALL" - } - ] - }, - "COMMON_RECEIPT_PROPERTIES": { - "title": "Common properties for a transaction receipt", - "type": "object", - "properties": { - "transaction_hash": { - "$ref": "#/components/schemas/TXN_HASH", - "description": "The hash identifying the transaction" - }, - "actual_fee": { - "$ref": "#/components/schemas/FELT", - "description": "The fee that was charged by the sequencer" - }, - "status": { - "$ref": "#/components/schemas/TXN_STATUS" - }, - "block_hash": { - "$ref": "#/components/schemas/BLOCK_HASH" - }, - "block_number": { - "$ref": "#/components/schemas/BLOCK_NUMBER" - }, - "messages_sent": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MSG_TO_L1" - } - }, - "events": { - "description": "The events emitted as part of this transaction", - "type": "array", - "items": { - "$ref": "#/components/schemas/EVENT" - } - } - }, - "required": [ - "transaction_hash", - "actual_fee", - "status", - "block_hash", - "block_number", - "messages_sent", - "events" - ] - }, - "INVOKE_TXN_RECEIPT": { - "title": "Invoke Transaction Receipt", - "allOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["INVOKE"] - } - }, - "required": ["type"] - }, - { - "$ref": "#/components/schemas/COMMON_RECEIPT_PROPERTIES" - } - ] - }, - "DECLARE_TXN_RECEIPT": { - "title": "Declare Transaction Receipt", - "allOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["DECLARE"] - } - }, - "required": ["type"] - }, - { - "$ref": "#/components/schemas/COMMON_RECEIPT_PROPERTIES" - } - ] - }, - "DEPLOY_ACCOUNT_TXN_RECEIPT": { - "title": "Deploy Account Transaction Receipt", - "allOf": [ - { - "$ref": "#/components/schemas/COMMON_RECEIPT_PROPERTIES" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["DEPLOY_ACCOUNT"] - }, - "contract_address": { - "description": "The address of the deployed contract", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["type", "contract_address"] - } - ] - }, - "DEPLOY_TXN_RECEIPT": { - "title": "Deploy Transaction Receipt", - "allOf": [ - { - "$ref": "#/components/schemas/COMMON_RECEIPT_PROPERTIES" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["DEPLOY"] - }, - "contract_address": { - "description": "The address of the deployed contract", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["type", "contract_address"] - } - ] - }, - "L1_HANDLER_TXN_RECEIPT": { - "title": "receipt for l1 handler transaction", - "allOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["L1_HANDLER"] - } - }, - "required": ["type"] - }, - { - "$ref": "#/components/schemas/COMMON_RECEIPT_PROPERTIES" - } - ] - }, - "TXN_RECEIPT": { - "oneOf": [ - { - "$ref": "#/components/schemas/INVOKE_TXN_RECEIPT" - }, - { - "$ref": "#/components/schemas/L1_HANDLER_TXN_RECEIPT" - }, - { - "$ref": "#/components/schemas/DECLARE_TXN_RECEIPT" - }, - { - "$ref": "#/components/schemas/DEPLOY_TXN_RECEIPT" - }, - { - "$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_RECEIPT" - }, - { - "$ref": "#/components/schemas/PENDING_TXN_RECEIPT" - } - ] - }, - "PENDING_COMMON_RECEIPT_PROPERTIES": { - "title": "Common properties for a pending transaction receipt", - "type": "object", - "properties": { - "transaction_hash": { - "$ref": "#/components/schemas/TXN_HASH", - "description": "The hash identifying the transaction" - }, - "actual_fee": { - "$ref": "#/components/schemas/FELT", - "description": "The fee that was charged by the sequencer" - }, - "type": { - "$ref": "#/components/schemas/TXN_TYPE" - }, - "messages_sent": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MSG_TO_L1" - } - }, - "events": { - "description": "The events emitted as part of this transaction", - "type": "array", - "items": { - "$ref": "#/components/schemas/EVENT" - } - } - }, - "required": [ - "transaction_hash", - "actual_fee", - "messages_sent", - "events" - ] - }, - "PENDING_DEPLOY_TXN_RECEIPT": { - "title": "Pending deploy Transaction Receipt", - "allOf": [ - { - "$ref": "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES" - }, - { - "type": "object", - "properties": { - "contract_address": { - "description": "The address of the deployed contract", - "$ref": "#/components/schemas/FELT" - } - } - } - ] - }, - "PENDING_TXN_RECEIPT": { - "oneOf": [ - { - "$ref": "#/components/schemas/PENDING_DEPLOY_TXN_RECEIPT" - }, - { - "$comment": "Used for pending invoke and declare transaction receipts", - "$ref": "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES" - } - ] - }, - "MSG_TO_L1": { - "type": "object", - "properties": { - "to_address": { - "description": "The target L1 address the message is sent to", - "$ref": "#/components/schemas/FELT" - }, - "payload": { - "description": "The payload of the message", - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "required": ["to_address", "payload"] - }, - "TXN_STATUS": { - "type": "string", - "enum": ["PENDING", "ACCEPTED_ON_L2", "ACCEPTED_ON_L1", "REJECTED"], - "description": "The status of the transaction" - }, - "TXN_TYPE": { - "type": "string", - "enum": ["DECLARE", "DEPLOY", "DEPLOY_ACCOUNT", "INVOKE", "L1_HANDLER"], - "description": "The type of the transaction" - }, - "BLOCK_STATUS": { - "type": "string", - "enum": ["PENDING", "ACCEPTED_ON_L2", "ACCEPTED_ON_L1", "REJECTED"], - "description": "The status of the block" - }, - "FUNCTION_CALL": { - "type": "object", - "title": "Function call information", - "properties": { - "contract_address": { - "$ref": "#/components/schemas/ADDRESS" - }, - "entry_point_selector": { - "$ref": "#/components/schemas/FELT" - }, - "calldata": { - "type": "array", - "description": "The parameters passed to the function", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "required": ["contract_address", "entry_point_selector", "calldata"] - }, - "CONTRACT_CLASS": { - "type": "object", - "properties": { - "sierra_program": { - "type": "array", - "description": "The list of Sierra instructions of which the program consists", - "items": { - "$ref": "#/components/schemas/FELT" - } - }, - "contract_class_version": { - "type": "string", - "description": "The version of the contract class object. Currently, the Starknet OS supports version 0.1.0" - }, - "entry_points_by_type": { - "type": "object", - "properties": { - "CONSTRUCTOR": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SIERRA_ENTRY_POINT" - } - }, - "EXTERNAL": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SIERRA_ENTRY_POINT" - } - }, - "L1_HANDLER": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SIERRA_ENTRY_POINT" - } - } - } - }, - "abi": { - "type": "string", - "description": "The class ABI, as supplied by the user declaring the class" - } - }, - "required": [ - "sierra_program", - "contract_class_version", - "entry_points_by_type" - ] - }, - "DEPRECATED_CONTRACT_CLASS": { - "title": "The definition of a Starknet contract class", - "type": "object", - "properties": { - "program": { - "type": "string", - "description": "A base64 representation of the compressed program code", - "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$" - }, - "entry_points_by_type": { - "type": "object", - "properties": { - "CONSTRUCTOR": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT" - } - }, - "EXTERNAL": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT" - } - }, - "L1_HANDLER": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT" - } - } - } - }, - "abi": { - "$ref": "#/components/schemas/CONTRACT_ABI" - } - }, - "required": ["program", "entry_points_by_type"] - }, - "DEPRECATED_CAIRO_ENTRY_POINT": { - "type": "object", - "properties": { - "offset": { - "description": "The offset of the entry point in the program", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "selector": { - "description": "A unique identifier of the entry point (function) in the program", - "$ref": "#/components/schemas/FELT" - } - } - }, - "SIERRA_ENTRY_POINT": { - "type": "object", - "properties": { - "selector": { - "description": "A unique identifier of the entry point (function) in the program", - "$ref": "#/components/schemas/FELT" - }, - "function_idx": { - "description": "The index of the function in the program", - "type": "integer" - } - } - }, - "CONTRACT_ABI": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CONTRACT_ABI_ENTRY" - } - }, - "CONTRACT_ABI_ENTRY": { - "oneOf": [ - { - "$ref": "#/components/schemas/FUNCTION_ABI_ENTRY" - }, - { - "$ref": "#/components/schemas/EVENT_ABI_ENTRY" - }, - { - "$ref": "#/components/schemas/STRUCT_ABI_ENTRY" - } - ] - }, - "STRUCT_ABI_TYPE": { - "type": "string", - "enum": ["struct"] - }, - "EVENT_ABI_TYPE": { - "type": "string", - "enum": ["event"] - }, - "FUNCTION_ABI_TYPE": { - "type": "string", - "enum": ["function", "l1_handler", "constructor"] - }, - "STRUCT_ABI_ENTRY": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/STRUCT_ABI_TYPE" - }, - "name": { - "description": "The struct name", - "type": "string" - }, - "size": { - "type": "integer", - "minimum": 1 - }, - "members": { - "type": "array", - "items": { - "$ref": "#/components/schemas/STRUCT_MEMBER" - } - } - } - }, - "STRUCT_MEMBER": { - "allOf": [ - { - "$ref": "#/components/schemas/TYPED_PARAMETER" - }, - { - "type": "object", - "properties": { - "offset": { - "description": "offset of this property within the struct", - "type": "integer" - } - } - } - ] - }, - "EVENT_ABI_ENTRY": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/EVENT_ABI_TYPE" - }, - "name": { - "description": "The event name", - "type": "string" - }, - "keys": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TYPED_PARAMETER" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TYPED_PARAMETER" - } - } - } - }, - "FUNCTION_ABI_ENTRY": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/FUNCTION_ABI_TYPE" - }, - "name": { - "description": "The function name", - "type": "string" - }, - "inputs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TYPED_PARAMETER" - } - }, - "outputs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TYPED_PARAMETER" - } - } - } - }, - "TYPED_PARAMETER": { - "type": "object", - "properties": { - "name": { - "description": "The parameter's name", - "type": "string" - }, - "type": { - "description": "The parameter's type", - "type": "string" - } - } - }, - "FEE_ESTIMATE": { - "type": "object", - "properties": { - "gas_consumed": { - "description": "The Ethereum gas cost of the transaction (see https://docs.starknet.io/docs/Fees/fee-mechanism for more info)", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "gas_price": { - "description": "The gas price (in gwei) that was used in the cost estimation", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "overall_fee": { - "description": "The estimated fee for the transaction (in gwei), product of gas_consumed and gas_price", - "$ref": "#/components/schemas/NUM_AS_HEX" - } - } - } - }, - "errors": { - "FAILED_TO_RECEIVE_TXN": { - "code": 1, - "message": "Failed to write transaction" - }, - "CONTRACT_NOT_FOUND": { - "code": 20, - "message": "Contract not found" - }, - "BLOCK_NOT_FOUND": { - "code": 24, - "message": "Block not found" - }, - "TXN_HASH_NOT_FOUND": { - "code": 25, - "message": "Transaction hash not found" - }, - "INVALID_TXN_INDEX": { - "code": 27, - "message": "Invalid transaction index in a block" - }, - "CLASS_HASH_NOT_FOUND": { - "code": 28, - "message": "Class hash not found" - }, - "PAGE_SIZE_TOO_BIG": { - "code": 31, - "message": "Requested page size is too big" - }, - "NO_BLOCKS": { - "code": 32, - "message": "There are no blocks" - }, - "INVALID_CONTINUATION_TOKEN": { - "code": 33, - "message": "The supplied continuation token is invalid or unknown" - }, - "TOO_MANY_KEYS_IN_FILTER": { - "code": 34, - "message": "Too many keys provided in a filter" - }, - "CONTRACT_ERROR": { - "code": 40, - "message": "Contract error" - } - } - } -} diff --git a/crates/client/rpc/Cargo.toml b/crates/client/rpc/Cargo.toml index a053bdcc7d..899a80a717 100644 --- a/crates/client/rpc/Cargo.toml +++ b/crates/client/rpc/Cargo.toml @@ -53,6 +53,7 @@ jsonrpsee = { workspace = true, default-features = true, features = [ ] } log = { workspace = true, default-features = true } mp-block = { workspace = true, default-features = true } +mp-fee = { workspace = true, default-features = true } mp-felt = { workspace = true, default-features = true } mp-hashers = { workspace = true, default-features = true } mp-simulations = { workspace = true } diff --git a/crates/client/rpc/src/lib.rs b/crates/client/rpc/src/lib.rs index 0808661440..21cf817149 100644 --- a/crates/client/rpc/src/lib.rs +++ b/crates/client/rpc/src/lib.rs @@ -27,6 +27,7 @@ use mp_felt::{Felt252Wrapper, Felt252WrapperError}; use mp_hashers::HasherT; use mp_simulations::{SimulatedTransaction, SimulationFlag, SimulationFlags}; use mp_transactions::compute_hash::ComputeTransactionHash; +use mp_transactions::execution::StarknetRPCExecutionResources; use mp_transactions::to_starknet_core_transaction::to_starknet_core_tx; use mp_transactions::{TransactionStatus, UserTransaction}; use pallet_starknet_runtime_api::{ConvertTransactionRuntimeApi, StarknetRuntimeApi}; @@ -52,7 +53,7 @@ use starknet_core::types::{ FeeEstimate, FieldElement, FunctionCall, InvokeTransactionReceipt, InvokeTransactionResult, L1HandlerTransactionReceipt, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, MaybePendingTransactionReceipt, StateDiff, StateUpdate, SyncStatus, SyncStatusType, Transaction, - TransactionExecutionStatus, TransactionFinalityStatus, TransactionReceipt, + TransactionExecutionStatus, TransactionFinalityStatus, TransactionReceipt, Hash256 }; use starknet_core::utils::get_selector_from_name; @@ -834,6 +835,8 @@ where let starknet_block = get_block_by_block_hash(self.client.as_ref(), substrate_block_hash).unwrap_or_default(); let chain_id = self.chain_id()?; + let starknet_version = starknet_block.header().protocol_version; + let l1_gas_price = starknet_block.header().l1_gas_price; let block_hash = starknet_block.header().hash::(); let actual_status = if starknet_block.header().block_number @@ -872,6 +875,8 @@ where new_root: Felt252Wrapper::from(starknet_block.header().global_state_root).into(), timestamp: starknet_block.header().block_timestamp, sequencer_address: Felt252Wrapper::from(starknet_block.header().sequencer_address).into(), + l1_gas_price: starknet_block.header().l1_gas_price.into(), + starknet_version: starknet_version.to_string(), }; Ok(MaybePendingBlockWithTxHashes::Block(block_with_tx_hashes)) @@ -952,18 +957,6 @@ where request: Vec, block_id: BlockId, ) -> RpcResult> { - let is_query = request.iter().any(|tx| match tx { - BroadcastedTransaction::Invoke(invoke_tx) => invoke_tx.is_query, - BroadcastedTransaction::Declare(BroadcastedDeclareTransaction::V1(tx_v1)) => tx_v1.is_query, - BroadcastedTransaction::Declare(BroadcastedDeclareTransaction::V2(tx_v2)) => tx_v2.is_query, - BroadcastedTransaction::DeployAccount(deploy_tx) => deploy_tx.is_query, - }); - if !is_query { - log::error!( - "Got `is_query`: false. In a future version, this will fail fee estimation with UnsupportedTxVersion" - ); - } - let substrate_block_hash = self.substrate_block_hash_from_starknet_block(block_id).map_err(|e| { error!("'{e}'"); StarknetRpcApiError::BlockNotFound @@ -1083,6 +1076,7 @@ where let starknet_block = get_block_by_block_hash(self.client.as_ref(), substrate_block_hash).unwrap_or_default(); let block_hash = starknet_block.header().hash::(); + let starknet_version = starknet_block.header().protocol_version; let actual_status = if starknet_block.header().block_number <= mc_deoxys::l1::ETHEREUM_STATE_UPDATE.lock().unwrap().block_number.0 @@ -1129,6 +1123,8 @@ where timestamp: starknet_block.header().block_timestamp, sequencer_address: Felt252Wrapper::from(starknet_block.header().sequencer_address).into(), transactions, + l1_gas_price: starknet_block.header().l1_gas_price.into(), + starknet_version: starknet_version.to_string(), }; Ok(MaybePendingBlockWithTxs::Block(block_with_txs)) @@ -1416,6 +1412,8 @@ where let chain_id = self.chain_id()?.0.into(); + let starknet_version = starknet_block.header().protocol_version; + let fee_disabled = self.client.runtime_api().is_transaction_fee_disabled(substrate_block_hash).map_err(|e| { error!("Failed to get check fee disabled. Substrate block hash: {substrate_block_hash}, error: {e}"); @@ -1468,6 +1466,12 @@ where } }; + // TODO(#1291): compute execution_resources correctly to the receipt + let execution_resources = StarknetRPCExecutionResources::default(); + + // TODO(#1291): compute message hash correctly to L1HandlerTransactionReceipt + let message_hash: Hash256 = Hash256::from_felt(&FieldElement::default()); + fn event_conversion(event: starknet_api::transaction::Event) -> starknet_core::types::Event { starknet_core::types::Event { from_address: Felt252Wrapper::from(event.from_address).0, @@ -1531,6 +1535,7 @@ where messages_sent: messages.into_iter().map(message_conversion).collect(), events: events_converted, execution_result, + execution_resources: execution_resources.into(), }), mp_transactions::Transaction::DeployAccount(tx) => { TransactionReceipt::DeployAccount(DeployAccountTransactionReceipt { @@ -1543,6 +1548,7 @@ where events: events_converted, contract_address: tx.get_account_address(), execution_result, + execution_resources: execution_resources.into(), }) } mp_transactions::Transaction::Deploy(tx) => TransactionReceipt::Deploy(DeployTransactionReceipt { @@ -1555,6 +1561,7 @@ where events: events_converted, contract_address: tx.get_account_address(), execution_result, + execution_resources: execution_resources.into(), }), mp_transactions::Transaction::Invoke(_) => TransactionReceipt::Invoke(InvokeTransactionReceipt { transaction_hash, @@ -1565,8 +1572,10 @@ where messages_sent: messages.into_iter().map(message_conversion).collect(), events: events_converted, execution_result, + execution_resources: execution_resources.into(), }), mp_transactions::Transaction::L1Handler(_) => TransactionReceipt::L1Handler(L1HandlerTransactionReceipt { + message_hash, transaction_hash, actual_fee, finality_status: actual_status, @@ -1575,6 +1584,7 @@ where messages_sent: messages.into_iter().map(message_conversion).collect(), events: events_converted, execution_result, + execution_resources: execution_resources.into(), }), }; diff --git a/crates/pallets/starknet/src/execution_config.rs b/crates/pallets/starknet/src/execution_config.rs index e69b2b8e30..9ba7483cca 100644 --- a/crates/pallets/starknet/src/execution_config.rs +++ b/crates/pallets/starknet/src/execution_config.rs @@ -17,6 +17,7 @@ impl RuntimeExecutionConfigBuilder { disable_validation: false, disable_nonce_validation: T::DisableNonceValidation::get(), disable_transaction_fee: T::DisableTransactionFee::get(), + offset_version: false, }) } #[must_use] @@ -31,6 +32,12 @@ impl RuntimeExecutionConfigBuilder { self } + #[must_use] + pub fn with_offset_version(mut self) -> Self { + self.0.offset_version = true; + self + } + pub fn build(self) -> ExecutionConfig { self.0 } diff --git a/crates/pallets/starknet/src/lib.rs b/crates/pallets/starknet/src/lib.rs index 678cf38270..ed33246179 100644 --- a/crates/pallets/starknet/src/lib.rs +++ b/crates/pallets/starknet/src/lib.rs @@ -80,7 +80,7 @@ use frame_system::pallet_prelude::*; use mp_block::state_update::StateUpdateWrapper; use mp_block::{Block as StarknetBlock, Header as StarknetHeader}; use mp_digest_log::MADARA_ENGINE_ID; -use mp_fee::INITIAL_GAS; +use mp_fee::{ResourcePrice, INITIAL_GAS}; use mp_felt::Felt252Wrapper; use mp_hashers::HasherT; use mp_sequencer_address::{InherentError, InherentType, DEFAULT_SEQUENCER_ADDRESS, INHERENT_IDENTIFIER}; @@ -88,6 +88,7 @@ use mp_simulations::{ DeclareTransactionTrace, DeployAccountTransactionTrace, FeeEstimate, FunctionInvocation, InvokeTransactionTrace, SimulatedTransaction, SimulationFlags, TransactionTrace, }; +use mp_state::rpc::StateDiff; use mp_storage::{StarknetStorageSchemaVersion, PALLET_STARKNET_SCHEMA}; use mp_transactions::execution::Execute; use mp_transactions::{ @@ -1034,6 +1035,9 @@ impl Pallet { let protocol_version = T::ProtocolVersion::get(); let extra_data = None; + // TODO: Compute l1_gas_price correctly + let l1_gas_price = ResourcePrice::default(); + let block = StarknetBlock::new( StarknetHeader::new( parent_block_hash.into(), @@ -1046,6 +1050,7 @@ impl Pallet { events.len() as u128, event_commitment.into(), protocol_version, + l1_gas_price, extra_data, ), transactions, @@ -1168,7 +1173,7 @@ impl Pallet { &transactions, &Self::get_block_context(), chain_id, - &RuntimeExecutionConfigBuilder::new::().with_query_mode().build(), + &mut RuntimeExecutionConfigBuilder::new::().with_query_mode().build(), )?; let mut results = vec![]; @@ -1201,7 +1206,7 @@ impl Pallet { &transactions, &Self::get_block_context(), chain_id, - &RuntimeExecutionConfigBuilder::new::().with_simulation_mode(&simulation_flags).build(), + &mut RuntimeExecutionConfigBuilder::new::().with_simulation_mode(&simulation_flags).build(), )?; fn get_function_invocation( @@ -1224,6 +1229,7 @@ impl Pallet { log::error!("Failed to convert fee transfer call info to function invocation: {}", err); Error::::TransactionExecutionFailed })?; + let transaction_trace = match tx { UserTransaction::Invoke(_) => TransactionTrace::Invoke(InvokeTransactionTrace { validate_invocation, @@ -1235,10 +1241,14 @@ impl Pallet { tx_exec_info.revert_error.as_ref(), )?, fee_transfer_invocation, + // TODO(#1291): Compute state diff correctly + state_diff: Some(StateDiff::default()), }), UserTransaction::Declare(_, _) => TransactionTrace::Declare(DeclareTransactionTrace { validate_invocation, fee_transfer_invocation, + // TODO(#1291): Compute state diff correctly + state_diff: Some(StateDiff::default()), }), UserTransaction::DeployAccount(_) => { TransactionTrace::DeployAccount(DeployAccountTransactionTrace { @@ -1251,6 +1261,8 @@ impl Pallet { .map_err(|_| Error::::TransactionExecutionFailed)?, fee_transfer_invocation, + // TODO(#1291): Compute state diff correctly + state_diff: Some(StateDiff::default()), }) } }; @@ -1264,14 +1276,14 @@ impl Pallet { results.push(SimulatedTransaction { transaction_trace, fee_estimation: FeeEstimate { gas_consumed, gas_price, overall_fee }, - }) + }); } - Err(e) => { - log::error!("Failed to simulate transactions: {:?}, error: {:?}", tx, e); + Err(_e) => { return Err(Error::::TransactionExecutionFailed.into()); } } } + Ok(results) } diff --git a/crates/pallets/starknet/src/tests/call_contract.rs b/crates/pallets/starknet/src/tests/call_contract.rs index 5527732a7d..b8f72fa0fd 100644 --- a/crates/pallets/starknet/src/tests/call_contract.rs +++ b/crates/pallets/starknet/src/tests/call_contract.rs @@ -41,6 +41,7 @@ fn given_call_contract_call_works() { nonce: Felt252Wrapper::ZERO, calldata: constructor_calldata, max_fee: u128::MAX, + offset_version: false, }; assert_ok!(Starknet::invoke(origin, deploy_transaction.into())); diff --git a/crates/pallets/starknet/src/tests/declare_tx.rs b/crates/pallets/starknet/src/tests/declare_tx.rs index 730fe202a0..f1fd044921 100644 --- a/crates/pallets/starknet/src/tests/declare_tx.rs +++ b/crates/pallets/starknet/src/tests/declare_tx.rs @@ -34,6 +34,7 @@ fn given_contract_declare_tx_works_once_not_twice() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_ok!(Starknet::declare(none_origin.clone(), transaction.clone().into(), erc20_class.clone())); @@ -67,6 +68,7 @@ fn given_contract_declare_tx_fails_sender_not_deployed() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_err!( @@ -116,6 +118,7 @@ fn given_contract_declare_on_openzeppelin_account_with_incorrect_signature_then_ nonce: Felt252Wrapper::ZERO, class_hash: erc20_class_hash, sender_address: account_addr.into(), + offset_version: false, }; assert_matches!( @@ -174,6 +177,7 @@ fn given_contract_declare_on_braavos_account_with_incorrect_signature_then_it_fa nonce: Felt252Wrapper::ZERO, class_hash: erc20_class_hash, sender_address: account_addr.into(), + offset_version: false, }; assert_matches!( @@ -232,6 +236,7 @@ fn given_contract_declare_on_argent_account_with_incorrect_signature_then_it_fai nonce: Felt252Wrapper::ZERO, class_hash: erc20_class_hash, sender_address: account_addr.into(), + offset_version: false, }; assert_matches!( @@ -270,6 +275,7 @@ fn given_contract_declare_on_cairo_1_no_validate_account_then_it_works() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; let chain_id = Starknet::chain_id(); diff --git a/crates/pallets/starknet/src/tests/deploy_account_tx.rs b/crates/pallets/starknet/src/tests/deploy_account_tx.rs index d4491dfd59..5624fdc1dc 100644 --- a/crates/pallets/starknet/src/tests/deploy_account_tx.rs +++ b/crates/pallets/starknet/src/tests/deploy_account_tx.rs @@ -35,6 +35,7 @@ fn given_contract_run_deploy_account_tx_works() { contract_address_salt: salt, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, }; let address = deploy_tx.account_address().into(); @@ -46,7 +47,7 @@ fn given_contract_run_deploy_account_tx_works() { let expected_fee_transfer_event = Event::StarknetEvent(StarknetEvent { content: EventContent { keys: vec![EventKey( - StarkFelt::try_from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).unwrap(), + Felt252Wrapper::from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).into(), )], data: EventData(vec![ address.0.0, // From @@ -76,6 +77,7 @@ fn given_contract_run_deploy_account_tx_twice_fails() { contract_address_salt: *SALT, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, }; let address = deploy_tx.account_address().into(); @@ -104,6 +106,7 @@ fn given_contract_run_deploy_account_tx_undeclared_then_it_fails() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_err!( @@ -146,6 +149,7 @@ fn given_contract_run_deploy_account_openzeppelin_tx_works() { contract_address_salt: *SALT, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, }; let chain_id = Starknet::chain_id(); @@ -176,6 +180,7 @@ fn given_contract_run_deploy_account_openzeppelin_with_incorrect_signature_then_ contract_address_salt: *SALT, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, }; deploy_tx.signature = vec![Felt252Wrapper::ONE, Felt252Wrapper::ONE]; @@ -202,6 +207,7 @@ fn given_contract_run_deploy_account_argent_tx_works() { contract_address_salt: *SALT, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, }; let chain_id = Starknet::chain_id(); @@ -232,6 +238,7 @@ fn given_contract_run_deploy_account_argent_with_incorrect_signature_then_it_fai contract_address_salt: *SALT, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, }; deploy_tx.signature = vec![Felt252Wrapper::ONE, Felt252Wrapper::ONE]; @@ -261,6 +268,7 @@ fn given_contract_run_deploy_account_braavos_tx_works() { contract_address_salt: *SALT, constructor_calldata: calldata, class_hash: proxy_class_hash.into(), + offset_version: false, }; let tx_hash = deploy_tx.compute_hash::<::SystemHash>(Starknet::chain_id(), false); @@ -293,6 +301,7 @@ fn given_contract_run_deploy_account_braavos_tx_works_whis_hardware_signer() { contract_address_salt: *SALT, constructor_calldata: calldata, class_hash: proxy_class_hash.into(), + offset_version: false, }; let tx_hash = deploy_tx.compute_hash::<::SystemHash>(Starknet::chain_id(), false); @@ -341,6 +350,7 @@ fn given_contract_run_deploy_account_braavos_with_incorrect_signature_then_it_fa nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: [Felt252Wrapper::ZERO; 10].to_vec(), + offset_version: false, }; let address = deploy_tx.account_address().into(); diff --git a/crates/pallets/starknet/src/tests/erc20.rs b/crates/pallets/starknet/src/tests/erc20.rs index 4c0a730a07..fc922c3d29 100644 --- a/crates/pallets/starknet/src/tests/erc20.rs +++ b/crates/pallets/starknet/src/tests/erc20.rs @@ -49,6 +49,7 @@ fn given_erc20_transfer_when_invoke_then_it_works() { Felt252Wrapper::from_hex_be("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF").unwrap(), // Initial supply high felt_252_sender_account, // recipient ], + offset_version: false, }; let expected_erc20_address = @@ -99,7 +100,7 @@ fn given_erc20_transfer_when_invoke_then_it_works() { let expected_fee_transfer_event = Event::StarknetEvent(StarknetEvent { content: EventContent { keys: vec![EventKey( - StarkFelt::try_from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).unwrap(), + Felt252Wrapper::from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).into(), )], data: EventData(vec![ sender_account.0 .0, // From @@ -174,7 +175,7 @@ fn given_erc20_transfer_when_invoke_then_it_works() { let expected_event = Event::StarknetEvent(StarknetEvent { content: EventContent { keys: vec![EventKey( - StarkFelt::try_from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).unwrap(), + StarkFelt::try_from(Felt252Wrapper::from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap())).unwrap(), )], data: EventData(vec![ StarkFelt::try_from("0x01a3339ec92ac1061e3e0f8e704106286c642eaf302e94a582e5f95ef5e6b4d0").unwrap(), // From @@ -193,7 +194,7 @@ fn given_erc20_transfer_when_invoke_then_it_works() { let expected_fee_transfer_event = Event::StarknetEvent(StarknetEvent { content: EventContent { keys: vec![EventKey( - StarkFelt::try_from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).unwrap(), + StarkFelt::try_from(Felt252Wrapper::from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap())).unwrap(), )], data: EventData(vec![ sender_account.0 .0, // From diff --git a/crates/pallets/starknet/src/tests/events.rs b/crates/pallets/starknet/src/tests/events.rs index f6a9d6bcd9..eec2a0f1b3 100644 --- a/crates/pallets/starknet/src/tests/events.rs +++ b/crates/pallets/starknet/src/tests/events.rs @@ -34,6 +34,7 @@ fn internal_and_external_events_are_emitted_in_the_right_order() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; let none_origin = RuntimeOrigin::none(); diff --git a/crates/pallets/starknet/src/tests/invoke_tx.rs b/crates/pallets/starknet/src/tests/invoke_tx.rs index ef89c9a17a..1493406f9f 100644 --- a/crates/pallets/starknet/src/tests/invoke_tx.rs +++ b/crates/pallets/starknet/src/tests/invoke_tx.rs @@ -42,6 +42,7 @@ fn given_hardcoded_contract_run_invoke_tx_fails_sender_not_deployed() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_err!(Starknet::invoke(none_origin, transaction.into()), Error::::AccountNotDeployed); @@ -76,8 +77,8 @@ fn given_hardcoded_contract_run_invoke_tx_then_it_works() { from_address: Starknet::fee_token_address(), content: EventContent { keys: vec![EventKey( - StarkFelt::try_from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()) - .unwrap(), + Felt252Wrapper::from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()) + .into(), )], data: EventData(vec![ StarkFelt::try_from(BLOCKIFIER_ACCOUNT_ADDRESS).unwrap(), @@ -121,7 +122,7 @@ fn given_hardcoded_contract_run_invoke_tx_then_event_is_emitted() { from_address: Starknet::fee_token_address(), content: EventContent { keys: vec![EventKey( - StarkFelt::try_from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap()).unwrap(), + StarkFelt::try_from(Felt252Wrapper::from(get_selector_from_name(mp_fee::TRANSFER_SELECTOR_NAME).unwrap())).unwrap(), )], data: EventData(vec![ StarkFelt::try_from("0x01a3339ec92ac1061e3e0f8e704106286c642eaf302e94a582e5f95ef5e6b4d0").unwrap(), // From @@ -171,6 +172,7 @@ fn given_hardcoded_contract_run_invoke_tx_then_multiple_events_is_emitted() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; let none_origin = RuntimeOrigin::none(); @@ -197,6 +199,7 @@ fn given_hardcoded_contract_run_invoke_tx_then_multiple_events_is_emitted() { nonce: Felt252Wrapper::ONE, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; let none_origin = RuntimeOrigin::none(); @@ -425,6 +428,7 @@ fn given_account_not_deployed_invoke_tx_works_for_nonce_one() { nonce: Felt252Wrapper::ONE, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_ok!(Starknet::validate_unsigned( @@ -448,6 +452,7 @@ fn given_account_not_deployed_invoke_tx_fails_for_nonce_not_one() { nonce: Felt252Wrapper::TWO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_eq!( diff --git a/crates/pallets/starknet/src/tests/mock/genesis.json b/crates/pallets/starknet/src/tests/mock/genesis.json index 25c2e825df..d928b36eaa 100644 --- a/crates/pallets/starknet/src/tests/mock/genesis.json +++ b/crates/pallets/starknet/src/tests/mock/genesis.json @@ -157,7 +157,8 @@ "0x02356b628d108863baf8644c945d97bad70190af5957031f4852d00d0f690a77", "0x03bcec8de953ba8e305e2ce2db52c91504aefa7c56c91211873b4d6ba36e8c32", "No validation account", - null + null, + "" ] ], "storage": [ diff --git a/crates/pallets/starknet/src/tests/mock/helpers.rs b/crates/pallets/starknet/src/tests/mock/helpers.rs index 414c4f8be8..e336f1a67d 100644 --- a/crates/pallets/starknet/src/tests/mock/helpers.rs +++ b/crates/pallets/starknet/src/tests/mock/helpers.rs @@ -26,7 +26,7 @@ pub fn get_storage_key( let storage_key_offset = H256::from_low_u64_be(storage_key_offset); let mut storage_key = get_storage_var_address(storage_name, keys).unwrap(); storage_key += FieldElement::from_bytes_be(&storage_key_offset.to_fixed_bytes()).unwrap(); - (*address, StorageKey(PatriciaKey(storage_key.into()))) + (*address, StorageKey(PatriciaKey(Felt252Wrapper::from(storage_key).into()))) } #[derive(Copy, Clone)] diff --git a/crates/pallets/starknet/src/tests/mod.rs b/crates/pallets/starknet/src/tests/mod.rs index f5cd7364ec..38dc64edf8 100644 --- a/crates/pallets/starknet/src/tests/mod.rs +++ b/crates/pallets/starknet/src/tests/mod.rs @@ -47,7 +47,7 @@ pub fn get_invoke_dummy(nonce: Felt252Wrapper) -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000019").unwrap(), /* calldata[0] */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata } + InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata, offset_version: false } } // ref: https://github.com/argentlabs/argent-contracts-starknet/blob/develop/contracts/account/ArgentAccount.cairo @@ -65,7 +65,14 @@ fn get_invoke_argent_dummy() -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000019").unwrap(), /* calldata[0] */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature: vec![], nonce, sender_address, calldata } + InvokeTransactionV1 { + max_fee: u64::MAX as u128, + signature: vec![], + nonce, + sender_address, + calldata, + offset_version: false, + } } // ref: https://github.com/myBraavos/braavos-account-cairo/blob/develop/src/account/Account.cairo @@ -87,7 +94,7 @@ fn get_invoke_braavos_dummy() -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000019").unwrap(), /* calldata[0] */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata } + InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata, offset_version: false } } // ref: https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/openzeppelin/token/erc20/IERC20.cairo @@ -105,7 +112,7 @@ fn get_invoke_emit_event_dummy() -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000000").unwrap(), /* amount */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata } + InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata, offset_version: false } } // ref: https://github.com/tdelabro/blockifier/blob/no_std-support/crates/blockifier/feature_contracts/account_without_validations.cairo @@ -123,7 +130,7 @@ fn get_invoke_nonce_dummy() -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000019").unwrap(), /* calldata[0] */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata } + InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata, offset_version: false } } // ref: https://github.com/keep-starknet-strange/madara/blob/main/cairo-contracts/src/accounts/NoValidateAccount.cairo @@ -139,7 +146,7 @@ fn get_storage_read_write_dummy() -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000001").unwrap(), /* calldata[1] */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata } + InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata, offset_version: false } } // ref: https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/openzeppelin/account/IAccount.cairo @@ -161,7 +168,7 @@ fn get_invoke_openzeppelin_dummy() -> InvokeTransactionV1 { Felt252Wrapper::from_hex_be("0x0000000000000000000000000000000000000000000000000000000000000019").unwrap(), /* calldata[0] */ ]; - InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata } + InvokeTransactionV1 { max_fee: u64::MAX as u128, signature, nonce, sender_address, calldata, offset_version: false } } /// Returns a dummy declare transaction for the given account type. @@ -183,6 +190,7 @@ pub fn get_declare_dummy( nonce, class_hash: erc20_class_hash, sender_address: account_addr.into(), + offset_version: false, }; let tx_hash = tx.compute_hash::<::SystemHash>(chain_id, false); @@ -208,6 +216,7 @@ pub fn get_deploy_account_dummy( contract_address_salt: salt, constructor_calldata: calldata.0.iter().map(|e| Felt252Wrapper::from(*e)).collect(), class_hash: account_class_hash.into(), + offset_version: false, } } diff --git a/crates/pallets/starknet/src/tests/query_tx.rs b/crates/pallets/starknet/src/tests/query_tx.rs index 1aa008d773..e3b6bc1278 100644 --- a/crates/pallets/starknet/src/tests/query_tx.rs +++ b/crates/pallets/starknet/src/tests/query_tx.rs @@ -63,8 +63,8 @@ fn executable_tx_should_not_be_estimable() { let tx_vec = vec![UserTransaction::Invoke(tx.clone().into())]; - // it should not be valid for estimate calls - assert_err!(Starknet::estimate_fee(tx_vec), Error::::TransactionExecutionFailed); + // it should be valid for estimate calls + assert_ok!(Starknet::estimate_fee(tx_vec)); // it should be executable assert_ok!(Starknet::invoke(RuntimeOrigin::none(), tx.clone().into())); @@ -78,6 +78,7 @@ fn query_tx_should_not_be_executable() { let chain_id = Starknet::chain_id(); let mut tx = get_invoke_argent_dummy(); + tx.offset_version = true; let tx_hash = tx.compute_hash::<::SystemHash>(chain_id, true); tx.signature = sign_message_hash(tx_hash); diff --git a/crates/pallets/starknet/src/tests/send_message.rs b/crates/pallets/starknet/src/tests/send_message.rs index 54c69064b4..d028a03cba 100644 --- a/crates/pallets/starknet/src/tests/send_message.rs +++ b/crates/pallets/starknet/src/tests/send_message.rs @@ -40,6 +40,7 @@ fn messages_to_l1_are_stored() { nonce: Felt252Wrapper::ZERO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_ok!(Starknet::declare(RuntimeOrigin::none(), declare_tx.into(), contract_class)); @@ -61,6 +62,7 @@ fn messages_to_l1_are_stored() { nonce: Felt252Wrapper::ONE, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_ok!(Starknet::invoke(RuntimeOrigin::none(), deploy_tx.into())); @@ -78,6 +80,7 @@ fn messages_to_l1_are_stored() { nonce: Felt252Wrapper::TWO, max_fee: u128::MAX, signature: vec![], + offset_version: false, }; assert_ok!(Starknet::invoke(RuntimeOrigin::none(), invoke_tx.clone().into())); diff --git a/crates/pallets/starknet/src/tests/utils.rs b/crates/pallets/starknet/src/tests/utils.rs index 53b0348152..fca6010c96 100644 --- a/crates/pallets/starknet/src/tests/utils.rs +++ b/crates/pallets/starknet/src/tests/utils.rs @@ -82,6 +82,7 @@ pub fn build_transfer_invoke_transaction(request: BuildTransferInvokeTransaction request.amount_low, // initial supply low request.amount_high, // initial supply high ], + offset_version: false, } .into() } diff --git a/crates/pallets/starknet/src/utils.rs b/crates/pallets/starknet/src/utils.rs index 50385aed0a..a7607cb9d9 100644 --- a/crates/pallets/starknet/src/utils.rs +++ b/crates/pallets/starknet/src/utils.rs @@ -18,23 +18,24 @@ pub fn execute_txs_and_rollback( txs: &Vec, block_context: &BlockContext, chain_id: Felt252Wrapper, - execution_config: &ExecutionConfig, + execution_config: &mut ExecutionConfig, ) -> Result>, Error> { let mut execution_results = vec![]; storage::transactional::with_transaction(|| { for tx in txs { + execution_config.set_offset_version(tx.offset_version()); let result = match tx { UserTransaction::Declare(tx, contract_class) => tx - .try_into_executable::(chain_id, contract_class.clone(), execution_config.is_query) + .try_into_executable::(chain_id, contract_class.clone(), tx.offset_version()) .and_then(|exec| { exec.execute(&mut BlockifierStateAdapter::::default(), block_context, execution_config) }), UserTransaction::DeployAccount(tx) => { - let executable = tx.into_executable::(chain_id, execution_config.is_query); + let executable = tx.into_executable::(chain_id, tx.offset_version()); executable.execute(&mut BlockifierStateAdapter::::default(), block_context, execution_config) } UserTransaction::Invoke(tx) => { - let executable = tx.into_executable::(chain_id, execution_config.is_query); + let executable = tx.into_executable::(chain_id, tx.offset_version()); executable.execute(&mut BlockifierStateAdapter::::default(), block_context, execution_config) } }; diff --git a/crates/primitives/block/Cargo.toml b/crates/primitives/block/Cargo.toml index 7106e314f4..44821aa6f0 100644 --- a/crates/primitives/block/Cargo.toml +++ b/crates/primitives/block/Cargo.toml @@ -12,10 +12,16 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] blockifier = { workspace = true } -frame-support = { workspace = true } +mp-fee = { workspace = true, features = [ + "parity-scale-codec", + "serde", + "scale-info", +] } mp-felt = { workspace = true } mp-hashers = { workspace = true } mp-transactions = { workspace = true } +serde = { workspace = true, features = ["derive"], optional = true } +serde_json = { workspace = true } sp-core = { workspace = true } starknet-core = { workspace = true } starknet_api = { workspace = true } @@ -24,7 +30,7 @@ starknet_api = { workspace = true } parity-scale-codec = { workspace = true, features = [ "derive", ], optional = true } -serde = { workspace = true, features = ["derive"], optional = true } +scale-info = { workspace = true, features = ["derive"], optional = true } [dev-dependencies] mp-hashers = { workspace = true } @@ -35,19 +41,27 @@ default = ["std"] std = [ "sp-core/std", "mp-felt/std", + "mp-fee/std", "mp-transactions/std", "mp-hashers/std", "starknet_api/std", "blockifier/std", + "serde/std", # Optionals "parity-scale-codec?/std", - "serde?/std", + "scale-info?/std", ] parity-scale-codec = [ "dep:parity-scale-codec", "mp-felt/parity-scale-codec", + "mp-fee/parity-scale-codec", "mp-transactions/parity-scale-codec", "starknet_api/parity-scale-codec", "blockifier/parity-scale-codec", ] -serde = ["dep:serde", "mp-felt/serde", "mp-transactions/serde"] +scale-info = [ + "dep:scale-info", + "mp-felt/scale-info", + "starknet_api/scale-info", + "blockifier/scale-info", +] diff --git a/crates/primitives/block/src/header.rs b/crates/primitives/block/src/header.rs index 5cf68f34fd..db8ff2c7b4 100644 --- a/crates/primitives/block/src/header.rs +++ b/crates/primitives/block/src/header.rs @@ -1,6 +1,7 @@ use alloc::sync::Arc; use blockifier::block_context::BlockContext; +use mp_fee::ResourcePrice; use mp_felt::Felt252Wrapper; use mp_hashers::HasherT; use sp_core::U256; @@ -70,6 +71,8 @@ pub struct Header { pub event_commitment: StarkHash, /// The version of the Starknet protocol used when creating this block pub protocol_version: u8, + /// l1 gas price for this block + pub l1_gas_price: ResourcePrice, /// Extraneous data that might be useful for running transactions pub extra_data: Option, } @@ -89,6 +92,7 @@ impl Header { event_count: u128, event_commitment: StarkHash, protocol_version: u8, + l1_gas_price: ResourcePrice, extra_data: Option, ) -> Self { Self { @@ -102,6 +106,7 @@ impl Header { event_count, event_commitment, protocol_version, + l1_gas_price, extra_data, } } diff --git a/crates/primitives/block/src/lib.rs b/crates/primitives/block/src/lib.rs index f21bc7a188..a3f8836d55 100644 --- a/crates/primitives/block/src/lib.rs +++ b/crates/primitives/block/src/lib.rs @@ -18,6 +18,30 @@ use mp_transactions::Transaction; /// Block Transactions pub type BlockTransactions = Vec; +/// Block tag. +/// +/// A tag specifying a dynamic reference to a block. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] +pub enum BlockTag { + #[cfg_attr(feature = "serde", serde(rename = "latest"))] + Latest, + #[cfg_attr(feature = "serde", serde(rename = "pending"))] + Pending, +} + +/// Block Id +/// Block hash, number or tag +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +pub enum BlockId { + Hash(Felt252Wrapper), + Number(u64), + Tag(BlockTag), +} + /// Starknet block definition. #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] diff --git a/crates/primitives/block/src/tests.rs b/crates/primitives/block/src/tests.rs index 827564bed1..064a65a5dc 100644 --- a/crates/primitives/block/src/tests.rs +++ b/crates/primitives/block/src/tests.rs @@ -2,45 +2,44 @@ use core::convert::TryFrom; use mp_felt::Felt252Wrapper; use mp_hashers::pedersen::PedersenHasher; -use sp_core::U256; +use mp_hashers::HasherT; use starknet_api::api_core::{ChainId, ContractAddress, PatriciaKey}; use starknet_api::block::{BlockNumber, BlockTimestamp}; use starknet_api::hash::{StarkFelt, StarkHash}; use crate::Header; -fn generate_dummy_header() -> Header { - Header::new( - StarkFelt::from(1u128), - 1, - StarkFelt::from(2u128), - ContractAddress::default(), - 42, - 0, - StarkFelt::from(3u128), - 0, - StarkFelt::from(4u128), - 1, - Some(U256::from(3)), - ) +fn generate_dummy_header() -> Vec { + vec![ + Felt252Wrapper::ONE, // block_number + Felt252Wrapper::ONE, // global_state_root + Felt252Wrapper::ONE, // sequencer_address + Felt252Wrapper::ONE, // block_timestamp + Felt252Wrapper::ONE, // transaction_count + Felt252Wrapper::ONE, // transaction_commitment + Felt252Wrapper::ONE, // event_count + Felt252Wrapper::ONE, // event_commitment + Felt252Wrapper::ZERO, // placeholder + Felt252Wrapper::ZERO, // placeholder + Felt252Wrapper::ONE, // parent_block_hash + ] } #[test] fn test_header_hash() { - let header = generate_dummy_header(); + let hash = ::compute_hash_on_wrappers(&generate_dummy_header()); let expected_hash = - Felt252Wrapper::from_hex_be("0x029da584545c7f3ebdb0c6aca74f0fba99156b1e31e9524c70b42776e50efda6").unwrap(); + Felt252Wrapper::from_hex_be("0x001bef5f78bfd9122370a6bf9e3365b96362bef2bfd2b44b67707d8fbbf27bdc").unwrap(); - assert_eq!(header.hash::(), expected_hash); + assert_eq!(hash, expected_hash); } #[test] fn test_real_header_hash() { // Values taken from alpha-mainnet - - let block_number = 86000; - let block_timestamp = 1687235884; + let block_number = 86000u32; + let block_timestamp = 1687235884u32; let global_state_root = StarkHash::try_from("0x006727a7aae8c38618a179aeebccd6302c67ad5f8528894d1dde794e9ae0bbfa").unwrap(); let parent_block_hash = @@ -48,33 +47,33 @@ fn test_real_header_hash() { let sequencer_address = ContractAddress(PatriciaKey( StarkFelt::try_from("0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8").unwrap(), )); - let transaction_count = 197; + let transaction_count = 197u32; let transaction_commitment = StarkFelt::try_from("0x70369cef825889dc005916dba67332b71f270b7af563d0433cee3342dda527d").unwrap(); - let event_count = 1430; + let event_count = 1430u32; let event_commitment = StarkFelt::try_from("0x2043ba1ef46882ce1dbb17b501fffa4b71f87f618e8f394e9605959d92efdf6").unwrap(); - let protocol_version = 0; - let extra_data = None; + let protocol_version = 0u32; - let header = Header::new( - parent_block_hash, - block_number, - global_state_root, - sequencer_address, - block_timestamp, - transaction_count, - transaction_commitment, - event_count, - event_commitment, - protocol_version, - extra_data, - ); + let header: &[Felt252Wrapper] = &[ + block_number.into(), + global_state_root.into(), + sequencer_address.into(), + block_timestamp.into(), + transaction_count.into(), + transaction_commitment.into(), + event_count.into(), + event_commitment.into(), + protocol_version.into(), + Felt252Wrapper::ZERO, + parent_block_hash.into(), + ]; let expected_hash = Felt252Wrapper::from_hex_be("0x001d126ca058c7e546d59cf4e10728e4b023ca0fb368e8abcabf0b5335f4487a").unwrap(); + let hash = ::compute_hash_on_wrappers(header); - assert_eq!(header.hash::(), expected_hash); + assert_eq!(hash, expected_hash); } #[test] diff --git a/crates/primitives/commitments/Cargo.toml b/crates/primitives/commitments/Cargo.toml index a1153d808b..206871a00f 100644 --- a/crates/primitives/commitments/Cargo.toml +++ b/crates/primitives/commitments/Cargo.toml @@ -44,4 +44,4 @@ std = [ ] parity-scale-codec = ["dep:parity-scale-codec", "mp-felt/parity-scale-codec"] scale-info = ["dep:scale-info", "mp-felt/scale-info"] -serde = ["dep:serde", "dep:starknet-ff", "starknet-ff/serde", "mp-felt/serde"] +serde = ["dep:serde", "dep:starknet-ff", "starknet-ff?/serde", "mp-felt/serde"] diff --git a/crates/primitives/fee/Cargo.toml b/crates/primitives/fee/Cargo.toml index b2f634b005..f035912c8d 100644 --- a/crates/primitives/fee/Cargo.toml +++ b/crates/primitives/fee/Cargo.toml @@ -13,11 +13,34 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] blockifier = { workspace = true } hashbrown = { workspace = true } +mp-felt = { workspace = true } mp-state = { workspace = true } phf = { workspace = true } sp-arithmetic = { workspace = true } +starknet-core = { workspace = true } starknet_api = { workspace = true } +# Optional dependencies +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } +serde = { workspace = true, optional = true } +serde_with = { workspace = true, optional = true } + [features] default = ["std"] -std = ["blockifier/std", "starknet_api/std", "mp-state/std"] +std = [ + "mp-felt/std", + "starknet_api/std", + "blockifier/std", + "serde?/std", + "serde_with?/std", + "parity-scale-codec?/std", + "scale-info?/std", +] +parity-scale-codec = [ + "dep:parity-scale-codec", + "starknet_api/parity-scale-codec", + "mp-felt/parity-scale-codec", +] +serde = ["dep:serde", "dep:serde_with", "mp-felt/serde"] +scale-info = ["dep:scale-info", "starknet_api/scale-info"] diff --git a/crates/primitives/fee/src/lib.rs b/crates/primitives/fee/src/lib.rs index 392a2fc65f..bc26401d6e 100644 --- a/crates/primitives/fee/src/lib.rs +++ b/crates/primitives/fee/src/lib.rs @@ -29,6 +29,7 @@ use starknet_api::calldata; use starknet_api::deprecated_contract_class::EntryPointType; use starknet_api::hash::StarkFelt; use starknet_api::transaction::{Calldata, Fee}; +use starknet_core::types::ResourcePrice as CoreResourcePrice; /// Initial gas for a transaction pub const INITIAL_GAS: u64 = u64::MAX; @@ -53,6 +54,24 @@ pub const TRANSFER_SELECTOR_HASH: [u8; 32] = [ 64, 236, 165, 180, 130, 209, 46, ]; // starknet_keccak(TRANSFER_SELECTOR_NAME.as_bytes()).to_le_bytes(); +#[serde_with::serde_as] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub struct ResourcePrice { + /// The price of one unit of the given resource, denominated in fri (10^-18 strk) + pub price_in_strk: Option, + /// The price of one unit of the given resource, denominated in wei + pub price_in_wei: u64, +} + +impl From for CoreResourcePrice { + fn from(item: ResourcePrice) -> Self { + CoreResourcePrice { price_in_strk: item.price_in_strk, price_in_wei: item.price_in_wei } + } +} + /// Gets the transaction resources. pub fn compute_transaction_resources( state: &S, @@ -80,6 +99,7 @@ pub fn charge_fee( resources: &ResourcesMapping, disable_transaction_fee: bool, disable_fee_charge: bool, + is_query: bool, ) -> TransactionExecutionResult<(Fee, Option)> { // disable_transaction_fee flag implies that transaction fees have // been disabled and so we return 0 as the fees @@ -90,13 +110,10 @@ pub fn charge_fee( let actual_fee = calculate_tx_fee(resources, block_context)?; // Fee charging is skipped in the following cases: - // 1) If the tx version >= 0x100000000000000000000000000000000, the current transaction mode is a - // estimate fee transaction, so we don't charge fees + // 1) if is_query is true, it's an estimate fee transaction, so we don't charge fees // 2) The disable_fee_charge flag is set // in both cases we return the actual fee. - if disable_fee_charge - || account_tx_context.version.0 >= StarkFelt::try_from("0x100000000000000000000000000000000").unwrap() - { + if disable_fee_charge || is_query { return Ok((actual_fee, None)); } diff --git a/crates/primitives/genesis-config/Cargo.toml b/crates/primitives/genesis-config/Cargo.toml index 606703a271..3ddff66cdb 100644 --- a/crates/primitives/genesis-config/Cargo.toml +++ b/crates/primitives/genesis-config/Cargo.toml @@ -18,6 +18,7 @@ blockifier = { workspace = true, features = [ # # third party derive_more = { workspace = true } +hex = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } serde_with = { workspace = true } diff --git a/crates/primitives/genesis-config/src/lib.rs b/crates/primitives/genesis-config/src/lib.rs index 395009f762..0c3483a2b7 100644 --- a/crates/primitives/genesis-config/src/lib.rs +++ b/crates/primitives/genesis-config/src/lib.rs @@ -6,7 +6,8 @@ use std::vec::Vec; use blockifier::execution::contract_class::ContractClass as StarknetContractClass; use derive_more::Constructor; use mp_felt::Felt252Wrapper; -use serde::{Deserialize, Serialize}; +use serde::de::Error; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_with::serde_as; use starknet_core::serde::unsigned_field_element::UfeHex; use starknet_crypto::FieldElement; @@ -86,5 +87,31 @@ pub struct PredeployedAccount { pub contract_address: ContractAddress, pub class_hash: ClassHash, pub name: String, + #[serde(serialize_with = "buffer_to_hex")] pub private_key: Option>, + pub public_key: HexFelt, +} + +pub fn buffer_to_hex(buffer: &Option>, serializer: S) -> Result +where + S: Serializer, +{ + if let Some(inner_buffer) = buffer { + let hex_string = format!("0x{}", hex::encode(inner_buffer)); + serializer.serialize_str(&hex_string) + } else { + serializer.serialize_none() + } +} + +pub fn hex_to_buffer<'de, D>(deserializer: D) -> Result>, D::Error> +where + D: Deserializer<'de>, +{ + let hex_string = String::deserialize(deserializer)?; + if hex_string.is_empty() { + Ok(None) + } else { + hex::decode(&hex_string).map(Some).map_err(|err| Error::custom(err.to_string())) + } } diff --git a/crates/primitives/simulations/Cargo.toml b/crates/primitives/simulations/Cargo.toml index 670f096b1e..684fe41502 100644 --- a/crates/primitives/simulations/Cargo.toml +++ b/crates/primitives/simulations/Cargo.toml @@ -11,22 +11,24 @@ repository = { workspace = true } targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { workspace = true, features = ["derive"], optional = true } -serde_with = { workspace = true, optional = true } # Madara primitives mp-felt = { workspace = true } mp-messages = { workspace = true } - -# Substrate dependencies -parity-scale-codec = { workspace = true, optional = true } -scale-info = { workspace = true, optional = true } +mp-state = { workspace = true } +mp-transactions = { workspace = true } # Starknet dependencies blockifier = { workspace = true } starknet-core = { workspace = true } starknet_api = { workspace = true } +# Optional dependencies +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"], optional = true } +serde_with = { workspace = true, optional = true } + [features] default = ["std"] parity-scale-codec = [ @@ -34,12 +36,23 @@ parity-scale-codec = [ "starknet_api/parity-scale-codec", "mp-felt/parity-scale-codec", "mp-messages/parity-scale-codec", + "mp-state/parity-scale-codec", + "mp-transactions/parity-scale-codec", +] +serde = [ + "dep:serde", + "dep:serde_with", + "mp-felt/serde", + "mp-messages/serde", + "mp-state/serde", + "mp-transactions/serde", ] -serde = ["dep:serde", "dep:serde_with", "mp-felt/serde", "mp-messages/serde"] scale-info = [ "dep:scale-info", "starknet_api/scale-info", "mp-messages/scale-info", + "mp-state/scale-info", + "mp-transactions/scale-info", ] std = [ "mp-felt/std", diff --git a/crates/primitives/simulations/src/lib.rs b/crates/primitives/simulations/src/lib.rs index 4b0f40519c..965df4e7c8 100644 --- a/crates/primitives/simulations/src/lib.rs +++ b/crates/primitives/simulations/src/lib.rs @@ -3,18 +3,17 @@ #[doc(hidden)] pub extern crate alloc; -use alloc::collections::BTreeMap; use alloc::string::String; use alloc::vec::Vec; -use blockifier::execution::entry_point::{CallInfo, OrderedL2ToL1Message}; +use blockifier::execution::entry_point::CallInfo; use blockifier::transaction::errors::TransactionExecutionError; use blockifier::transaction::objects::TransactionExecutionResult; use mp_felt::{Felt252Wrapper, UfeHex}; -use mp_messages::MessageL2ToL1; -use starknet_api::api_core::{ContractAddress, PatriciaKey}; +use mp_state::rpc::StateDiff; +use mp_transactions::execution::StarknetRPCExecutionResources; +use starknet_api::api_core::EthAddress; use starknet_api::deprecated_contract_class::EntryPointType; -use starknet_api::transaction::EventContent; #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] @@ -70,11 +69,15 @@ pub struct SimulatedTransaction { #[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] #[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] #[cfg_attr(feature = "serde", derive(serde::Serialize))] -#[serde(untagged)] +#[serde(tag = "type")] pub enum TransactionTrace { + #[serde(rename = "INVOKE")] Invoke(InvokeTransactionTrace), + #[serde(rename = "DEPLOY_ACCOUNT")] DeployAccount(DeployAccountTransactionTrace), + #[serde(rename = "L1_HANDLER")] L1Handler(L1HandlerTransactionTrace), + #[serde(rename = "DECLARE")] Declare(DeclareTransactionTrace), } @@ -101,6 +104,9 @@ pub struct DeclareTransactionTrace { pub validate_invocation: Option, #[serde(skip_serializing_if = "Option::is_none")] pub fee_transfer_invocation: Option, + /// The state diffs induced by the transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub state_diff: Option, } #[derive(Debug, Clone)] @@ -113,6 +119,9 @@ pub struct InvokeTransactionTrace { pub execute_invocation: ExecuteInvocation, #[serde(skip_serializing_if = "Option::is_none")] pub fee_transfer_invocation: Option, + /// The state diffs induced by the transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub state_diff: Option, } #[derive(Debug, Clone)] @@ -127,6 +136,9 @@ pub struct DeployAccountTransactionTrace { pub constructor_invocation: FunctionInvocation, #[serde(skip_serializing_if = "Option::is_none")] pub fee_transfer_invocation: Option, + /// The state diffs induced by the transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub state_diff: Option, } #[derive(Debug, Clone)] @@ -137,6 +149,62 @@ pub struct L1HandlerTransactionTrace { /// The trace of the __execute__ call or constructor call, depending on the transaction type /// (none for declare transactions) pub function_invocation: FunctionInvocation, + /// The state diffs induced by the transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub state_diff: Option, +} + +/// Orderedevent. +/// +/// An event alongside its order within the transaction. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct OrderedEvent { + /// The order of the event within the transaction + pub order: u64, + /// Keys + #[serde_as(as = "Vec")] + pub keys: Vec, + /// Data + #[serde_as(as = "Vec")] + pub data: Vec, +} + +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct MessageToL1 { + /// The address of the L2 contract sending the message + #[serde_as(as = "UfeHex")] + pub from_address: Felt252Wrapper, + /// The target L1 address the message is sent to + pub to_address: EthAddress, + /// The payload of the message + #[serde_as(as = "Vec")] + pub payload: Vec, +} + +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct OrderedMessage { + /// The order of the message within the transaction + pub order: u64, + /// The address of the L2 contract sending the message + #[serde_as(as = "UfeHex")] + pub from_address: Felt252Wrapper, + /// The target L1 address the message is sent to + pub to_address: EthAddress, + /// The payload of the message + #[serde_as(as = "Vec")] + pub payload: Vec, } #[serde_with::serde_as] @@ -168,16 +236,19 @@ pub struct FunctionInvocation { /// The calls made by this invocation pub calls: Vec, /// The events emitted in this invocation - pub events: Vec, + pub events: Vec, /// The messages sent by this invocation to L1 - pub messages: Vec, + pub messages: Vec, + /// Resources consumed by the internal call + pub execution_resources: StarknetRPCExecutionResources, } impl TryFrom<&CallInfo> for FunctionInvocation { type Error = TransactionExecutionError; fn try_from(call_info: &CallInfo) -> TransactionExecutionResult { - let messages = ordered_l2_to_l1_messages(call_info); + let messages = ordered_messages(call_info); + let events = events_to_ordered_events(&call_info.execution.events); let inner_calls = call_info .inner_calls @@ -197,29 +268,52 @@ impl TryFrom<&CallInfo> for FunctionInvocation { call_type: call_info.call.call_type.into(), result: call_info.execution.retdata.0.iter().map(|x| (*x).into()).collect(), calls: inner_calls, - events: call_info.execution.events.iter().map(|event| event.event.clone()).collect(), + events, messages, + execution_resources: StarknetRPCExecutionResources::default(), }) } } -fn ordered_l2_to_l1_messages(call_info: &CallInfo) -> Vec { - let mut messages = BTreeMap::new(); - - for call in call_info.into_iter() { - for OrderedL2ToL1Message { order, message } in &call.execution.l2_to_l1_messages { - messages.insert( - order, - MessageL2ToL1 { - payload: message.payload.0.to_vec(), - to_address: message.to_address, - from_address: ContractAddress(PatriciaKey(call.call.storage_address.0.0)), - }, - ); - } +fn ordered_messages(call_info: &CallInfo) -> Vec { + let mut messages = Vec::new(); + + for (index, message) in call_info.execution.l2_to_l1_messages.iter().enumerate() { + messages.push(OrderedMessage { + order: index as u64, + payload: message.message.payload.0.iter().map(|x| (*x).into()).collect(), + to_address: message.message.to_address, + from_address: call_info.call.storage_address.0.0.into(), + }); } - messages.into_values().collect() + messages +} + +fn events_to_ordered_events(ordered_events: &[blockifier::execution::entry_point::OrderedEvent]) -> Vec { + ordered_events + .iter() + .map(|event| OrderedEvent { + order: event.order as u64, // Convert usize to u64 + keys: event + .event + .keys + .iter() + .map(|key| { + Felt252Wrapper::from(key.0) // Convert StarkFelt to Felt252Wrapper + }) + .collect(), + data: event + .event + .data + .0 + .iter() + .map(|data_item| { + Felt252Wrapper::from(*data_item) // Convert StarkFelt to Felt252Wrapper + }) + .collect(), + }) + .collect() } #[derive(Debug, Clone)] @@ -250,6 +344,8 @@ pub enum CallType { Call, #[serde(rename = "LIBRARY_CALL")] LibraryCall, + #[serde(rename = "DELEGATE")] + Delegate, } impl From for CallType { diff --git a/crates/primitives/state/Cargo.toml b/crates/primitives/state/Cargo.toml index 29aac8b4fb..b3b5a192c8 100644 --- a/crates/primitives/state/Cargo.toml +++ b/crates/primitives/state/Cargo.toml @@ -12,8 +12,30 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] blockifier = { workspace = true } +mp-felt = { workspace = true } starknet_api = { workspace = true } +# Optional dependencies +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } +serde = { workspace = true, optional = true } +serde_with = { workspace = true, optional = true } + [features] default = ["std"] -std = ["blockifier/std", "starknet_api/std"] +std = [ + "mp-felt/std", + "starknet_api/std", + "blockifier/std", + "serde?/std", + "serde_with?/std", + "parity-scale-codec?/std", + "scale-info?/std", +] +parity-scale-codec = [ + "dep:parity-scale-codec", + "starknet_api/parity-scale-codec", + "mp-felt/parity-scale-codec", +] +serde = ["dep:serde", "dep:serde_with", "mp-felt/serde"] +scale-info = ["dep:scale-info", "starknet_api/scale-info", "mp-felt/scale-info"] diff --git a/crates/primitives/state/src/lib.rs b/crates/primitives/state/src/lib.rs index c97d2d59d8..a884f6919d 100644 --- a/crates/primitives/state/src/lib.rs +++ b/crates/primitives/state/src/lib.rs @@ -1,3 +1,4 @@ +//! Starknet state primitives. #![cfg_attr(not(feature = "std"), no_std)] use blockifier::execution::contract_class::ContractClass; @@ -9,6 +10,8 @@ use starknet_api::hash::StarkFelt; use starknet_api::state::StorageKey; use starknet_api::stdlib::collections::HashMap; +pub mod rpc; + type ContractClassMapping = HashMap; /// This trait allows to get the state changes of a starknet tx and therefore enables computing the diff --git a/crates/primitives/state/src/rpc.rs b/crates/primitives/state/src/rpc.rs new file mode 100644 index 0000000000..c74b1b45df --- /dev/null +++ b/crates/primitives/state/src/rpc.rs @@ -0,0 +1,127 @@ +//! Starknet rpc state primitives. +#![cfg_attr(not(feature = "std"), no_std)] + +#[doc(hidden)] +pub extern crate alloc; + +use alloc::vec::Vec; + +use mp_felt::{Felt252Wrapper, UfeHex}; +use serde_with::serde_as; + +/// Replaced class. +/// +/// The list of contracts whose class was replaced. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct ReplacedClassItem { + /// The address of the contract whose class was replaced + #[serde_as(as = "UfeHex")] + pub contract_address: Felt252Wrapper, + /// The new class hash + #[serde_as(as = "UfeHex")] + pub class_hash: Felt252Wrapper, +} + +/// Deployed contract item. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct DeployedContractItem { + /// The address of the contract + #[serde_as(as = "UfeHex")] + pub address: Felt252Wrapper, + /// The hash of the contract code + #[serde_as(as = "UfeHex")] + pub class_hash: Felt252Wrapper, +} + +/// New classes. +/// +/// The declared class hash and compiled class hash. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct DeclaredClassItem { + /// The hash of the declared class + #[serde_as(as = "UfeHex")] + pub class_hash: Felt252Wrapper, + /// The cairo assembly hash corresponding to the declared class + #[serde_as(as = "UfeHex")] + pub compiled_class_hash: Felt252Wrapper, +} + +/// Contract storage diff item. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct ContractStorageDiffItem { + /// The contract address for which the storage changed + pub address: Felt252Wrapper, + /// The changes in the storage of the contract + pub storage_entries: Vec, +} + +/// Storage diff item. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct StorageEntry { + /// The key of the changed value + #[serde_as(as = "UfeHex")] + pub key: Felt252Wrapper, + /// The new value applied to the given address + #[serde_as(as = "UfeHex")] + pub value: Felt252Wrapper, +} + +/// Nonce update. +/// +/// The updated nonce per contract address. +#[serde_with::serde_as] +#[derive(Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct NonceUpdate { + /// The address of the contract + #[serde_as(as = "UfeHex")] + pub contract_address: Felt252Wrapper, + /// The nonce for the given address at the end of the block + #[serde_as(as = "UfeHex")] + pub nonce: Felt252Wrapper, +} + +/// The change in state applied in this block, given as a mapping of addresses to the new values +/// and/or new contracts. +#[serde_with::serde_as] +#[derive(Default, Debug, Clone)] +#[cfg_attr(feature = "parity-scale-codec", derive(parity_scale_codec::Encode, parity_scale_codec::Decode))] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] +pub struct StateDiff { + /// Storage diffs + pub storage_diffs: Vec, + /// Deprecated declared classes + #[serde_as(as = "Vec")] + pub deprecated_declared_classes: Vec, + /// Declared classes + pub declared_classes: Vec, + /// Deployed contracts + pub deployed_contracts: Vec, + /// Replaced classes + pub replaced_classes: Vec, + /// Nonces + pub nonces: Vec, +} diff --git a/crates/primitives/transactions/src/compute_hash.rs b/crates/primitives/transactions/src/compute_hash.rs index 208987e736..997e1ba91a 100644 --- a/crates/primitives/transactions/src/compute_hash.rs +++ b/crates/primitives/transactions/src/compute_hash.rs @@ -20,12 +20,7 @@ const INVOKE_PREFIX: &[u8] = b"invoke"; const L1_HANDLER_PREFIX: &[u8] = b"l1_handler"; pub trait ComputeTransactionHash { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - block_number: Option, - ) -> Felt252Wrapper; + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, block_number: Option,) -> Felt252Wrapper; } fn convert_calldata(data: &[Felt252Wrapper]) -> &[FieldElement] { @@ -35,14 +30,9 @@ fn convert_calldata(data: &[Felt252Wrapper]) -> &[FieldElement] { } impl ComputeTransactionHash for InvokeTransactionV0 { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, block_number: Option,) -> Felt252Wrapper { let prefix = FieldElement::from_byte_slice_be(INVOKE_PREFIX).unwrap(); - let version = if is_query { SIMULATE_TX_VERSION_OFFSET } else { FieldElement::ZERO }; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET } else { FieldElement::ZERO }; let contract_address = self.contract_address.into(); let entrypoint_selector = self.entry_point_selector.into(); let calldata_hash = compute_hash_on_elements(convert_calldata(&self.calldata)); @@ -69,14 +59,9 @@ impl ComputeTransactionHash for InvokeTransactionV0 { } impl ComputeTransactionHash for InvokeTransactionV1 { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option,) -> Felt252Wrapper { let prefix = FieldElement::from_byte_slice_be(INVOKE_PREFIX).unwrap(); - let version = if is_query { SIMULATE_TX_VERSION_OFFSET + FieldElement::ONE } else { FieldElement::ONE }; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET + FieldElement::ONE } else { FieldElement::ONE }; let sender_address = self.sender_address.into(); let entrypoint_selector = FieldElement::ZERO; let calldata_hash = compute_hash_on_elements(convert_calldata(&self.calldata)); @@ -99,28 +84,18 @@ impl ComputeTransactionHash for InvokeTransactionV1 { } impl ComputeTransactionHash for InvokeTransaction { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, block_number: Option) -> Felt252Wrapper { match self { - InvokeTransaction::V0(tx) => tx.compute_hash::(chain_id, is_query, block_number), - InvokeTransaction::V1(tx) => tx.compute_hash::(chain_id, is_query, block_number), + InvokeTransaction::V0(tx) => tx.compute_hash::(chain_id, offset_version, block_number), + InvokeTransaction::V1(tx) => tx.compute_hash::(chain_id, offset_version, block_number), } } } impl ComputeTransactionHash for DeclareTransactionV0 { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - _is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option) -> Felt252Wrapper { let prefix = FieldElement::from_byte_slice_be(DECLARE_PREFIX).unwrap(); - let version = FieldElement::ZERO; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET } else { FieldElement::ZERO }; let sender_address = self.sender_address.into(); let entrypoint_selector = FieldElement::ZERO; let alignment_placeholder = compute_hash_on_elements(&[]); @@ -143,14 +118,9 @@ impl ComputeTransactionHash for DeclareTransactionV0 { } impl ComputeTransactionHash for DeclareTransactionV1 { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - _is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option) -> Felt252Wrapper { let prefix = FieldElement::from_byte_slice_be(DECLARE_PREFIX).unwrap(); - let version = FieldElement::ONE; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET + FieldElement::ONE } else { FieldElement::ONE }; let sender_address = self.sender_address.into(); let entrypoint_selector = FieldElement::ZERO; let calldata = compute_hash_on_elements(&[self.class_hash.into()]); @@ -173,14 +143,9 @@ impl ComputeTransactionHash for DeclareTransactionV1 { } impl ComputeTransactionHash for DeclareTransactionV2 { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option) -> Felt252Wrapper { let prefix = FieldElement::from_byte_slice_be(DECLARE_PREFIX).unwrap(); - let version = if is_query { SIMULATE_TX_VERSION_OFFSET + FieldElement::TWO } else { FieldElement::TWO }; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET + FieldElement::TWO } else { FieldElement::TWO }; let sender_address = self.sender_address.into(); let entrypoint_selector = FieldElement::ZERO; let calldata = compute_hash_on_elements(&[self.class_hash.into()]); @@ -205,31 +170,21 @@ impl ComputeTransactionHash for DeclareTransactionV2 { } impl ComputeTransactionHash for DeclareTransaction { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option,) -> Felt252Wrapper { match self { - DeclareTransaction::V0(tx) => tx.compute_hash::(chain_id, is_query, None), - DeclareTransaction::V1(tx) => tx.compute_hash::(chain_id, is_query, None), - DeclareTransaction::V2(tx) => tx.compute_hash::(chain_id, is_query, None), + DeclareTransaction::V0(tx) => tx.compute_hash::(chain_id, offset_version, None), + DeclareTransaction::V1(tx) => tx.compute_hash::(chain_id, offset_version, None), + DeclareTransaction::V2(tx) => tx.compute_hash::(chain_id, offset_version, None), } } } impl ComputeTransactionHash for DeployAccountTransaction { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option) -> Felt252Wrapper { let chain_id = chain_id.into(); let contract_address = self.get_account_address(); - self.compute_hash_given_contract_address::(chain_id, contract_address, is_query).into() + self.compute_hash_given_contract_address::(chain_id, contract_address, offset_version).into() } } @@ -285,10 +240,10 @@ impl DeployAccountTransaction { &self, chain_id: FieldElement, contract_address: FieldElement, - is_query: bool, + offset_version: bool, ) -> FieldElement { let prefix = FieldElement::from_byte_slice_be(DEPLOY_ACCOUNT_PREFIX).unwrap(); - let version = if is_query { SIMULATE_TX_VERSION_OFFSET + FieldElement::ONE } else { FieldElement::ONE }; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET + FieldElement::ONE } else { FieldElement::ONE }; let entrypoint_selector = FieldElement::ZERO; let mut calldata: Vec = Vec::with_capacity(self.constructor_calldata.len() + 2); calldata.push(self.class_hash.into()); @@ -368,15 +323,10 @@ impl DeployTransaction { } impl ComputeTransactionHash for HandleL1MessageTransaction { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - _is_query: bool, - block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, block_number: Option) -> Felt252Wrapper { let prefix = FieldElement::from_byte_slice_be(L1_HANDLER_PREFIX).unwrap(); let invoke_prefix = FieldElement::from_byte_slice_be(INVOKE_PREFIX).unwrap(); - let version = FieldElement::ZERO; + let version = if offset_version { SIMULATE_TX_VERSION_OFFSET } else { FieldElement::ZERO }; let contract_address = self.contract_address.into(); let entrypoint_selector = self.entry_point_selector.into(); let calldata_hash = compute_hash_on_elements(convert_calldata(&self.calldata)); @@ -419,33 +369,23 @@ impl ComputeTransactionHash for HandleL1MessageTransaction { } impl ComputeTransactionHash for Transaction { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, block_number: Option) -> Felt252Wrapper { match self { - Transaction::Declare(tx) => tx.compute_hash::(chain_id, is_query, block_number), - Transaction::DeployAccount(tx) => tx.compute_hash::(chain_id, is_query, block_number), - Transaction::Deploy(tx) => tx.compute_hash::(chain_id, is_query, block_number), - Transaction::Invoke(tx) => tx.compute_hash::(chain_id, is_query, block_number), - Transaction::L1Handler(tx) => tx.compute_hash::(chain_id, is_query, block_number), + Transaction::Declare(tx) => tx.compute_hash::(chain_id, offset_version, block_number), + Transaction::DeployAccount(tx) => tx.compute_hash::(chain_id, offset_version, block_number), + Transaction::Deploy(tx) => tx.compute_hash::(chain_id, offset_version, block_number), + Transaction::Invoke(tx) => tx.compute_hash::(chain_id, offset_version, block_number), + Transaction::L1Handler(tx) => tx.compute_hash::(chain_id, offset_version, block_number), } } } impl ComputeTransactionHash for UserTransaction { - fn compute_hash( - &self, - chain_id: Felt252Wrapper, - is_query: bool, - _block_number: Option, - ) -> Felt252Wrapper { + fn compute_hash(&self, chain_id: Felt252Wrapper, offset_version: bool, _block_number: Option) -> Felt252Wrapper { match self { - UserTransaction::Declare(tx, _) => tx.compute_hash::(chain_id, is_query, None), - UserTransaction::DeployAccount(tx) => tx.compute_hash::(chain_id, is_query, None), - UserTransaction::Invoke(tx) => tx.compute_hash::(chain_id, is_query, None), + UserTransaction::Declare(tx, _) => tx.compute_hash::(chain_id, offset_version, None), + UserTransaction::DeployAccount(tx) => tx.compute_hash::(chain_id, offset_version, None), + UserTransaction::Invoke(tx) => tx.compute_hash::(chain_id, offset_version, None), } } } diff --git a/crates/primitives/transactions/src/compute_hash_tests.rs b/crates/primitives/transactions/src/compute_hash_tests.rs index 90fdf14862..7d10682866 100644 --- a/crates/primitives/transactions/src/compute_hash_tests.rs +++ b/crates/primitives/transactions/src/compute_hash_tests.rs @@ -24,6 +24,7 @@ fn compute_contract_address_work_like_starknet_api_impl() { contract_address_salt: Felt252Wrapper::ZERO, constructor_calldata: vec![Felt252Wrapper::ONE, Felt252Wrapper::TWO], class_hash: Felt252Wrapper::THREE, + offset_version: false, }; let address = tx.get_account_address(); @@ -54,6 +55,7 @@ fn test_deploy_account_tx_hash() { constructor_calldata: vec![Felt252Wrapper::ONE, Felt252Wrapper::TWO, Felt252Wrapper::THREE], contract_address_salt: Felt252Wrapper::ZERO, class_hash: Felt252Wrapper::THREE, + offset_version: false, }; let tx_hash = transaction.compute_hash::(chain_id, false); @@ -116,6 +118,7 @@ fn test_declare_v1_tx_hash() { nonce: Felt252Wrapper::ZERO, class_hash: Felt252Wrapper::THREE, sender_address: Felt252Wrapper::from(19911991_u128), + offset_version: false, }; let tx_hash = transaction.compute_hash::(chain_id, false); @@ -150,6 +153,7 @@ fn test_declare_v2_tx_hash() { class_hash: Felt252Wrapper::THREE, sender_address: Felt252Wrapper::from(19911991_u128), compiled_class_hash: Felt252Wrapper::THREE, + offset_version: false, }; let tx_hash = transaction.compute_hash::(chain_id, false); @@ -216,6 +220,7 @@ fn test_invoke_tx_v1_hash() { nonce: Felt252Wrapper::ZERO, sender_address: Felt252Wrapper::from(19911991_u128), calldata: vec![Felt252Wrapper::ONE, Felt252Wrapper::TWO, Felt252Wrapper::THREE], + offset_version: false, }; let tx_hash = transaction.compute_hash::(chain_id, false); diff --git a/crates/primitives/transactions/src/conversions.rs b/crates/primitives/transactions/src/conversions.rs index 16a8879ce4..8893b937bf 100644 --- a/crates/primitives/transactions/src/conversions.rs +++ b/crates/primitives/transactions/src/conversions.rs @@ -23,9 +23,9 @@ impl DeclareTransactionV0 { &self, chain_id: Felt252Wrapper, contract_class: ContractClass, - is_query: bool, + offset_version: bool, ) -> TransactionExecutionResult { - let transaction_hash = self.compute_hash::(chain_id, is_query, None); + let transaction_hash = self.compute_hash::(chain_id, offset_version, None); btx::DeclareTransaction::new( sttx::DeclareTransaction::V0(sttx::DeclareTransactionV0V1 { @@ -56,9 +56,9 @@ impl DeclareTransactionV1 { &self, chain_id: Felt252Wrapper, contract_class: ContractClass, - is_query: bool, + offset_version: bool, ) -> TransactionExecutionResult { - let transaction_hash = self.compute_hash::(chain_id, is_query, None); + let transaction_hash = self.compute_hash::(chain_id, offset_version, None); btx::DeclareTransaction::new( sttx::DeclareTransaction::V1(sttx::DeclareTransactionV0V1 { @@ -80,6 +80,7 @@ impl DeclareTransactionV1 { signature: inner.signature.0.iter().map(|felt| Felt252Wrapper::from(*felt)).collect(), sender_address: inner.sender_address.into(), class_hash: inner.class_hash.into(), + offset_version: false, } } } @@ -89,9 +90,9 @@ impl DeclareTransactionV2 { &self, chain_id: Felt252Wrapper, contract_class: ContractClass, - is_query: bool, + offset_version: bool, ) -> TransactionExecutionResult { - let transaction_hash = self.compute_hash::(chain_id, is_query, None); + let transaction_hash = self.compute_hash::(chain_id, offset_version, None); btx::DeclareTransaction::new( sttx::DeclareTransaction::V2(sttx::DeclareTransactionV2 { @@ -115,6 +116,7 @@ impl DeclareTransactionV2 { sender_address: inner.sender_address.into(), class_hash: inner.class_hash.into(), compiled_class_hash: inner.compiled_class_hash.into(), + offset_version: false, } } } @@ -124,19 +126,23 @@ impl DeclareTransaction { &self, chain_id: Felt252Wrapper, contract_class: ContractClass, - is_query: bool, + offset_version: bool, ) -> TransactionExecutionResult { match self { - DeclareTransaction::V0(tx) => tx.try_into_executable::(chain_id, contract_class, is_query), - DeclareTransaction::V1(tx) => tx.try_into_executable::(chain_id, contract_class, is_query), - DeclareTransaction::V2(tx) => tx.try_into_executable::(chain_id, contract_class, is_query), + DeclareTransaction::V0(tx) => tx.try_into_executable::(chain_id, contract_class, offset_version), + DeclareTransaction::V1(tx) => tx.try_into_executable::(chain_id, contract_class, offset_version), + DeclareTransaction::V2(tx) => tx.try_into_executable::(chain_id, contract_class, offset_version), } } } impl InvokeTransactionV0 { - pub fn into_executable(&self, chain_id: Felt252Wrapper, is_query: bool) -> btx::InvokeTransaction { - let transaction_hash = self.compute_hash::(chain_id, is_query, None); + pub fn into_executable( + &self, + chain_id: Felt252Wrapper, + offset_version: bool, + ) -> btx::InvokeTransaction { + let transaction_hash = self.compute_hash::(chain_id, offset_version, None); btx::InvokeTransaction { tx: sttx::InvokeTransaction::V0(sttx::InvokeTransactionV0 { @@ -162,8 +168,12 @@ impl InvokeTransactionV0 { } impl InvokeTransactionV1 { - pub fn into_executable(&self, chain_id: Felt252Wrapper, is_query: bool) -> btx::InvokeTransaction { - let transaction_hash = self.compute_hash::(chain_id, is_query, None); + pub fn into_executable( + &self, + chain_id: Felt252Wrapper, + offset_version: bool, + ) -> btx::InvokeTransaction { + let transaction_hash = self.compute_hash::(chain_id, offset_version, None); btx::InvokeTransaction { tx: sttx::InvokeTransaction::V1(sttx::InvokeTransactionV1 { @@ -184,15 +194,20 @@ impl InvokeTransactionV1 { nonce: inner.nonce.into(), sender_address: inner.sender_address.into(), calldata: inner.calldata.0.iter().map(|felt| Felt252Wrapper::from(*felt)).collect(), + offset_version: false, } } } impl InvokeTransaction { - pub fn into_executable(&self, chain_id: Felt252Wrapper, is_query: bool) -> btx::InvokeTransaction { + pub fn into_executable( + &self, + chain_id: Felt252Wrapper, + offset_version: bool, + ) -> btx::InvokeTransaction { match self { - InvokeTransaction::V0(tx) => tx.into_executable::(chain_id, is_query), - InvokeTransaction::V1(tx) => tx.into_executable::(chain_id, is_query), + InvokeTransaction::V0(tx) => tx.into_executable::(chain_id, offset_version), + InvokeTransaction::V1(tx) => tx.into_executable::(chain_id, offset_version), } } } @@ -201,11 +216,11 @@ impl DeployAccountTransaction { pub fn into_executable( &self, chain_id: Felt252Wrapper, - is_query: bool, + offset_version: bool, ) -> btx::DeployAccountTransaction { let account_address = self.get_account_address(); let transaction_hash: Felt252Wrapper = - self.compute_hash_given_contract_address::(chain_id.into(), account_address, is_query).into(); + self.compute_hash_given_contract_address::(chain_id.into(), account_address, offset_version).into(); let contract_address: Felt252Wrapper = account_address.into(); btx::DeployAccountTransaction { @@ -231,6 +246,7 @@ impl DeployAccountTransaction { contract_address_salt: inner.contract_address_salt.into(), constructor_calldata: inner.constructor_calldata.0.iter().map(|felt| Felt252Wrapper::from(*felt)).collect(), class_hash: inner.class_hash.into(), + offset_version: false, } } } @@ -251,9 +267,9 @@ impl HandleL1MessageTransaction { &self, chain_id: Felt252Wrapper, paid_fee_on_l1: Fee, - is_query: bool, + offset_version: bool, ) -> btx::L1HandlerTransaction { - let transaction_hash = self.compute_hash::(chain_id, is_query, None); + let transaction_hash = self.compute_hash::(chain_id, offset_version, None); let tx = sttx::L1HandlerTransaction { version: TransactionVersion(StarkFelt::from(0u8)), @@ -305,6 +321,7 @@ impl From for DeclareTransactionV1 { nonce: remote.nonce.into(), class_hash: remote.class_hash.into(), sender_address: remote.sender_address.into(), + offset_version: false, } } } @@ -319,6 +336,7 @@ impl From for DeclareTransactionV2 { class_hash: remote.class_hash.into(), compiled_class_hash: remote.compiled_class_hash.into(), sender_address: remote.sender_address.into(), + offset_version: false, } } } diff --git a/crates/primitives/transactions/src/execution.rs b/crates/primitives/transactions/src/execution.rs index 05998addda..89e2c3e805 100644 --- a/crates/primitives/transactions/src/execution.rs +++ b/crates/primitives/transactions/src/execution.rs @@ -25,10 +25,13 @@ use blockifier::transaction::transactions::{ use mp_fee::{calculate_tx_fee, charge_fee, compute_transaction_resources}; use mp_felt::Felt252Wrapper; use mp_state::StateChanges; +use parity_scale_codec::{Decode, Encode}; +use serde::{Deserialize, Serialize}; use starknet_api::api_core::{ContractAddress, EntryPointSelector, Nonce}; use starknet_api::deprecated_contract_class::EntryPointType; use starknet_api::hash::StarkFelt; use starknet_api::transaction::{Calldata, Fee, TransactionSignature, TransactionVersion}; +use starknet_core::types::ExecutionResources as CoreExecutionResources; use super::SIMULATE_TX_VERSION_OFFSET; @@ -42,6 +45,8 @@ const TX_INITIAL_AVAILABLE_GAS: u64 = INITIAL_GAS_COST - TRANSACTION_GAS_COST; pub struct ExecutionConfig { /// If true, the transaction is a query. pub is_query: bool, + /// If true, the transaction version has the simulation offset. + pub offset_version: bool, /// If true, transaction fee calculation and charging /// is disabled for all transactions. pub disable_transaction_fee: bool, @@ -53,6 +58,12 @@ pub struct ExecutionConfig { pub disable_validation: bool, } +impl ExecutionConfig { + pub fn set_offset_version(&mut self, value: bool) { + self.offset_version = value; + } +} + pub struct ValidateExecuteCallInfo { pub validate_call_info: Option, pub execute_call_info: Option, @@ -70,7 +81,7 @@ impl ValidateExecuteCallInfo { } pub trait GetAccountTransactionContext { - fn get_account_transaction_context(&self, is_query: bool) -> AccountTransactionContext; + fn get_account_transaction_context(&self, offset_version: bool) -> AccountTransactionContext; } pub trait SimulateTxVersionOffset { @@ -83,10 +94,51 @@ impl SimulateTxVersionOffset for TransactionVersion { } } +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode)] +#[cfg_attr(feature = "scale-info", derive(scale_info::TypeInfo))] +#[cfg_attr(feature = "no_unknown_fields", serde(deny_unknown_fields))] +pub struct StarknetRPCExecutionResources { + /// The number of cairo steps used + pub steps: u64, + /// The number of unused memory cells (each cell is roughly equivalent to a step) + #[serde(skip_serializing_if = "Option::is_none")] + pub memory_holes: Option, + /// The number of range_check builtin instances + pub range_check_builtin_applications: u64, + /// The number of pedersen builtin instances + pub pedersen_builtin_applications: u64, + /// The number of poseidon builtin instances + pub poseidon_builtin_applications: u64, + /// The number of ec_op builtin instances + pub ec_op_builtin_applications: u64, + /// The number of ecdsa builtin instances + pub ecdsa_builtin_applications: u64, + /// The number of bitwise builtin instances + pub bitwise_builtin_applications: u64, + /// The number of keccak builtin instances + pub keccak_builtin_applications: u64, +} + +impl From for CoreExecutionResources { + fn from(resources: StarknetRPCExecutionResources) -> Self { + CoreExecutionResources { + steps: resources.steps, + memory_holes: resources.memory_holes, + range_check_builtin_applications: resources.range_check_builtin_applications, + pedersen_builtin_applications: resources.pedersen_builtin_applications, + poseidon_builtin_applications: resources.poseidon_builtin_applications, + ec_op_builtin_applications: resources.ec_op_builtin_applications, + ecdsa_builtin_applications: resources.ecdsa_builtin_applications, + bitwise_builtin_applications: resources.bitwise_builtin_applications, + keccak_builtin_applications: resources.keccak_builtin_applications, + } + } +} + impl GetAccountTransactionContext for DeclareTransaction { - fn get_account_transaction_context(&self, is_query: bool) -> AccountTransactionContext { + fn get_account_transaction_context(&self, offset_version: bool) -> AccountTransactionContext { let mut version = self.tx().version(); - if is_query { + if offset_version { version = version.apply_simulate_tx_version_offset(); } @@ -102,9 +154,9 @@ impl GetAccountTransactionContext for DeclareTransaction { } impl GetAccountTransactionContext for DeployAccountTransaction { - fn get_account_transaction_context(&self, is_query: bool) -> AccountTransactionContext { + fn get_account_transaction_context(&self, offset_version: bool) -> AccountTransactionContext { let mut version = self.version(); - if is_query { + if offset_version { version = version.apply_simulate_tx_version_offset(); } @@ -120,12 +172,12 @@ impl GetAccountTransactionContext for DeployAccountTransaction { } impl GetAccountTransactionContext for InvokeTransaction { - fn get_account_transaction_context(&self, is_query: bool) -> AccountTransactionContext { + fn get_account_transaction_context(&self, offset_version: bool) -> AccountTransactionContext { let mut version = match self.tx { starknet_api::transaction::InvokeTransaction::V0(_) => TransactionVersion(StarkFelt::from(0u8)), starknet_api::transaction::InvokeTransaction::V1(_) => TransactionVersion(StarkFelt::from(1u8)), }; - if is_query { + if offset_version { version = version.apply_simulate_tx_version_offset(); } @@ -151,9 +203,9 @@ impl GetAccountTransactionContext for InvokeTransaction { } impl GetAccountTransactionContext for L1HandlerTransaction { - fn get_account_transaction_context(&self, is_query: bool) -> AccountTransactionContext { + fn get_account_transaction_context(&self, offset_version: bool) -> AccountTransactionContext { let mut version = self.tx.version; - if is_query { + if offset_version { version = version.apply_simulate_tx_version_offset(); } @@ -238,9 +290,9 @@ pub trait Validate: GetAccountTransactionContext + GetTransactionCalldata { block_context: &BlockContext, resources: &mut ExecutionResources, remaining_gas: &mut u64, - is_query: bool, + validate_tx: bool, ) -> TransactionExecutionResult> { - let account_tx_context = self.get_account_transaction_context(is_query); + let account_tx_context = self.get_account_transaction_context(validate_tx); let mut context = EntryPointExecutionContext::new( block_context.clone(), account_tx_context, @@ -368,7 +420,7 @@ pub trait Execute: Sized + GetAccountTransactionContext + GetTransactionCalldata let mut execution_resources = ExecutionResources::default(); let mut remaining_gas = TX_INITIAL_AVAILABLE_GAS; - let account_tx_context = self.get_account_transaction_context(execution_config.is_query); + let account_tx_context = self.get_account_transaction_context(execution_config.offset_version); // Nonce and fee check should be done before running user code. Self::handle_nonce_and_check_fee_balance(state, block_context, &account_tx_context, execution_config)?; @@ -432,6 +484,7 @@ pub trait Execute: Sized + GetAccountTransactionContext + GetTransactionCalldata &actual_resources, execution_config.disable_transaction_fee, execution_config.disable_fee_charge, + execution_config.is_query, )?; Ok((actual_fee, fee_transfer_call_info, actual_resources)) @@ -562,6 +615,7 @@ impl Execute for DeployAccountTransaction { // so that the `constructor` method can initialize the account state let execute_call_info = self.run_execute(state, resources, &mut context, remaining_gas)?; let validate_call_info = if !disable_validation { + log::info!("this is the context for validation {:?}", context); self.validate_tx_inner(state, resources, remaining_gas, &mut context, self.calldata())? } else { None diff --git a/crates/primitives/transactions/src/from_broadcasted_transactions.rs b/crates/primitives/transactions/src/from_broadcasted_transactions.rs index d0fde1252f..6009fc4a0b 100644 --- a/crates/primitives/transactions/src/from_broadcasted_transactions.rs +++ b/crates/primitives/transactions/src/from_broadcasted_transactions.rs @@ -80,6 +80,7 @@ impl TryFrom for UserTransaction { nonce, contract_class, sender_address, + is_query, .. }) => { // Create a GzipDecoder to decompress the bytes @@ -112,6 +113,7 @@ impl TryFrom for UserTransaction { nonce: nonce.into(), class_hash: class_hash.into(), sender_address: sender_address.into(), + offset_version: is_query, }); let contract_class = instantiate_blockifier_contract_class(contract_class, decompressed_bytes)?; @@ -125,6 +127,7 @@ impl TryFrom for UserTransaction { contract_class, sender_address, compiled_class_hash, + is_query, .. }) => { let tx = DeclareTransaction::V2(DeclareTransactionV2 { @@ -134,6 +137,7 @@ impl TryFrom for UserTransaction { class_hash: contract_class.class_hash().into(), sender_address: sender_address.into(), compiled_class_hash: compiled_class_hash.into(), + offset_version: is_query, }); let casm_contract_class = flattened_sierra_to_casm_contract_class(contract_class) @@ -321,6 +325,7 @@ impl TryFrom for UserTransaction { nonce: value.nonce.into(), sender_address: value.sender_address.into(), calldata: cast_vec_of_field_elements(value.calldata), + offset_version: value.is_query, }))) } } @@ -336,6 +341,7 @@ impl TryFrom for UserTransaction { contract_address_salt: tx.contract_address_salt.into(), constructor_calldata: cast_vec_of_field_elements(tx.constructor_calldata), class_hash: tx.class_hash.into(), + offset_version: tx.is_query, }); Ok(tx) diff --git a/crates/primitives/transactions/src/getters.rs b/crates/primitives/transactions/src/getters.rs index 161bc1c268..18a91815d0 100644 --- a/crates/primitives/transactions/src/getters.rs +++ b/crates/primitives/transactions/src/getters.rs @@ -65,6 +65,14 @@ impl UserTransaction { UserTransaction::Invoke(tx) => tx.version(), } } + + pub fn offset_version(&self) -> bool { + match self { + UserTransaction::Declare(tx, _) => tx.offset_version(), + UserTransaction::DeployAccount(tx) => tx.offset_version(), + UserTransaction::Invoke(tx) => tx.offset_version(), + } + } } impl DeclareTransaction { @@ -123,6 +131,15 @@ impl DeclareTransaction { DeclareTransaction::V2(tx) => Some(&tx.compiled_class_hash), } } + + pub fn offset_version(&self) -> bool { + match self { + // we don't accept V0 txs from the RPC + DeclareTransaction::V0(_) => false, + DeclareTransaction::V1(tx) => tx.offset_version, + DeclareTransaction::V2(tx) => tx.offset_version, + } + } } impl DeployAccountTransaction { @@ -153,6 +170,10 @@ impl DeployAccountTransaction { pub fn class_hash(&self) -> &Felt252Wrapper { &self.class_hash } + + pub fn offset_version(&self) -> bool { + self.offset_version + } } impl DeployTransaction { @@ -215,4 +236,12 @@ impl InvokeTransaction { InvokeTransaction::V1(_) => 1, } } + + pub fn offset_version(&self) -> bool { + match self { + // we don't accept V0 txs from the RPC + InvokeTransaction::V0(_) => false, + InvokeTransaction::V1(tx) => tx.offset_version, + } + } } diff --git a/crates/primitives/transactions/src/lib.rs b/crates/primitives/transactions/src/lib.rs index 55149e96a6..f192cd6510 100644 --- a/crates/primitives/transactions/src/lib.rs +++ b/crates/primitives/transactions/src/lib.rs @@ -143,6 +143,7 @@ pub struct InvokeTransactionV1 { pub nonce: Felt252Wrapper, pub sender_address: Felt252Wrapper, pub calldata: Vec, + pub offset_version: bool, } #[derive(Debug, Clone, Eq, PartialEq, From)] @@ -174,6 +175,7 @@ pub struct DeclareTransactionV1 { pub nonce: Felt252Wrapper, pub class_hash: Felt252Wrapper, pub sender_address: Felt252Wrapper, + pub offset_version: bool, } #[derive(Debug, Clone, Eq, PartialEq)] @@ -186,6 +188,7 @@ pub struct DeclareTransactionV2 { pub class_hash: Felt252Wrapper, pub sender_address: Felt252Wrapper, pub compiled_class_hash: Felt252Wrapper, + pub offset_version: bool, } #[derive(Debug, Clone, Eq, PartialEq)] @@ -198,6 +201,7 @@ pub struct DeployAccountTransaction { pub contract_address_salt: Felt252Wrapper, pub constructor_calldata: Vec, pub class_hash: Felt252Wrapper, + pub offset_version: bool, } #[derive(Debug, Clone, Eq, PartialEq)] diff --git a/crates/primitives/transactions/src/to_starknet_core_transaction.rs b/crates/primitives/transactions/src/to_starknet_core_transaction.rs index bd19ac6792..e4b8af1530 100644 --- a/crates/primitives/transactions/src/to_starknet_core_transaction.rs +++ b/crates/primitives/transactions/src/to_starknet_core_transaction.rs @@ -36,6 +36,7 @@ pub fn to_starknet_core_tx( nonce, class_hash, sender_address, + .. }) => starknet_core::types::DeclareTransaction::V1(starknet_core::types::DeclareTransactionV1 { transaction_hash, max_fee: max_fee.into(), @@ -51,6 +52,7 @@ pub fn to_starknet_core_tx( class_hash, sender_address, compiled_class_hash, + .. }) => starknet_core::types::DeclareTransaction::V2(starknet_core::types::DeclareTransactionV2 { transaction_hash, max_fee: max_fee.into(), @@ -110,6 +112,7 @@ pub fn to_starknet_core_tx( nonce, sender_address, calldata, + .. }) => starknet_core::types::InvokeTransaction::V1(starknet_core::types::InvokeTransactionV1 { transaction_hash, max_fee: max_fee.into(), diff --git a/da-test/src/utils.rs b/da-test/src/utils.rs new file mode 100644 index 0000000000..ec11625a28 --- /dev/null +++ b/da-test/src/utils.rs @@ -0,0 +1,48 @@ +use std::path::PathBuf; + +#[cfg(feature = "avail")] +use mc_data_availability::avail::{config::AvailConfig, AvailClient}; +#[cfg(feature = "celestia")] +use mc_data_availability::celestia::{config::CelestiaConfig, CelestiaClient}; +use mc_data_availability::ethereum::config::EthereumConfig; +use mc_data_availability::ethereum::EthereumClient; +use mc_data_availability::{DaClient, DaLayer}; + +#[cfg(feature = "avail")] +use crate::constants::AVAIL_DA_CONFIG; +#[cfg(feature = "celestia")] +use crate::constants::CELESTIA_DA_CONFIG; +use crate::constants::ETHEREUM_DA_CONFIG; + +pub fn get_da_client(da_layer: DaLayer) -> Box { + let da_path = get_da_path(da_layer); + + let da_client: Box = match da_layer { + #[cfg(feature = "celestia")] + DaLayer::Celestia => { + let celestia_conf = CelestiaConfig::try_from(&da_path).expect("Failed to read Celestia config"); + Box::new(CelestiaClient::try_from(celestia_conf).expect("Failed to create Celestia client")) + } + DaLayer::Ethereum => { + let ethereum_conf = EthereumConfig::try_from(&da_path).expect("Failed to read Ethereum config"); + Box::new(EthereumClient::try_from(ethereum_conf).expect("Failed to create Ethereum client")) + } + #[cfg(feature = "avail")] + DaLayer::Avail => { + let avail_conf = AvailConfig::try_from(&da_path).expect("Failed to read Avail config"); + Box::new(AvailClient::try_from(avail_conf).expect("Failed to create Avail client")) + } + }; + + da_client +} + +pub(crate) fn get_da_path(da_layer: DaLayer) -> PathBuf { + match da_layer { + #[cfg(feature = "celestia")] + DaLayer::Celestia => CELESTIA_DA_CONFIG.into(), + DaLayer::Ethereum => ETHEREUM_DA_CONFIG.into(), + #[cfg(feature = "avail")] + DaLayer::Avail => AVAIL_DA_CONFIG.into(), + } +}