diff --git a/.github/workflows/_external_rust_lints.yml b/.github/workflows/_external_rust_lints.yml index 7ea83c3e6b7..d74b60a41a4 100644 --- a/.github/workflows/_external_rust_lints.yml +++ b/.github/workflows/_external_rust_lints.yml @@ -5,6 +5,11 @@ on: inputs: isRust: type: boolean + secrets: + SSH_PRIVATE_KEY_IOTA_CI: + required: true + SSH_GITHUB_KNOWN_HOSTS: + required: true concurrency: group: ext-rust-lints-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -28,7 +33,11 @@ jobs: runs-on: [self-hosted] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 - - uses: EmbarkStudios/cargo-deny-action@v1 + - uses: EmbarkStudios/cargo-deny-action@v2 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }} + ssh-known-hosts: ${{ secrets.SSH_GITHUB_KNOWN_HOSTS }} + use-git-cli: true clippy: if: always() && inputs.isRust diff --git a/.github/workflows/_mysticeti_tests.yml b/.github/workflows/_mysticeti_tests.yml index a04643ad836..ea26be1b1a3 100644 --- a/.github/workflows/_mysticeti_tests.yml +++ b/.github/workflows/_mysticeti_tests.yml @@ -136,25 +136,46 @@ jobs: - run: scripts/changed-files.sh shell: bash - # TODO: Disabled until we can get an updated fork of msim with tokio 1.38 https://github.com/iotaledger/iota/issues/1212 - # simtest: - # name: Simtest ${{ matrix.components }} - # needs: changes - # runs-on: [self-hosted] - # strategy: - # matrix: - # components: ${{ fromJson(needs.changes.outputs.components) }} - # fail-fast: false - # env: - # MSIM_WATCHDOG_TIMEOUT_MS: 60000 - # steps: - # - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 - # with: - # ref: ${{ github.event.inputs.iota_repo_ref || github.ref }} - # - uses: taiki-e/install-action@nextest - # - name: cargo simtest - # run: | - # scripts/simtest/cargo-simtest simtest -E 'rdeps(${{matrix.components}})' -p ${{matrix.components}} - # - name: check new tests for flakiness - # run: | - # scripts/simtest/stress-new-tests.sh -E 'rdeps(${{matrix.components}})' -p ${{matrix.components}} + simtest: + name: Simtest Mysticeti + needs: changes + timeout-minutes: 45 + runs-on: [self-hosted] + env: + MSIM_WATCHDOG_TIMEOUT_MS: 60000 + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + with: + ref: ${{ github.event.inputs.iota_repo_ref || github.ref }} + - uses: taiki-e/install-action@nextest + - name: setup filter + run: | + array=(${{ join(fromJson(needs.changes.outputs.components), ' ') }}) + + result="" + + for item in "${array[@]}"; do + mapped_item="-E 'rdeps(${item})'" + + if [ -z "$result" ]; then + result="$mapped_item" + else + result="$result $mapped_item" + fi + done + + echo "filters=$result" >> "$GITHUB_ENV" + - name: cargo simtest + run: | + command="scripts/simtest/cargo-simtest simtest $filters" + + echo "$command" + + eval ${command} + - name: check new tests for flakiness + run: | + command="scripts/simtest/stress-new-tests.sh $filters" + + echo "$command" + + eval ${command} diff --git a/.github/workflows/_rust.yml b/.github/workflows/_rust.yml index 6cc655b4b89..b07b6425478 100644 --- a/.github/workflows/_rust.yml +++ b/.github/workflows/_rust.yml @@ -5,6 +5,11 @@ on: inputs: isRust: type: boolean + secrets: + SSH_PRIVATE_KEY_IOTA_CI: + required: true + SSH_GITHUB_KNOWN_HOSTS: + required: true concurrency: group: rust-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -38,11 +43,13 @@ jobs: uses: ./.github/workflows/_rust_lints.yml with: isRust: ${{ inputs.isRust }} + secrets: inherit external-lints: uses: ./.github/workflows/_external_rust_lints.yml with: isRust: ${{ inputs.isRust }} + secrets: inherit rust-tests: if: github.event.pull_request.draft == false diff --git a/.github/workflows/_rust_lints.yml b/.github/workflows/_rust_lints.yml index 0933cb1409f..e13c215cca4 100644 --- a/.github/workflows/_rust_lints.yml +++ b/.github/workflows/_rust_lints.yml @@ -5,6 +5,11 @@ on: inputs: isRust: type: boolean + secrets: + SSH_PRIVATE_KEY_IOTA_CI: + required: true + SSH_GITHUB_KNOWN_HOSTS: + required: true concurrency: group: rust-lints-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -27,7 +32,11 @@ jobs: runs-on: [self-hosted] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 - - uses: EmbarkStudios/cargo-deny-action@v1 + - uses: EmbarkStudios/cargo-deny-action@v2 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }} + ssh-known-hosts: ${{ secrets.SSH_GITHUB_KNOWN_HOSTS }} + use-git-cli: true clippy: if: always() && inputs.isRust diff --git a/.github/workflows/_rust_tests.yml b/.github/workflows/_rust_tests.yml index daf6ab724bc..72b03a1087b 100644 --- a/.github/workflows/_rust_tests.yml +++ b/.github/workflows/_rust_tests.yml @@ -110,27 +110,47 @@ jobs: - run: scripts/changed-files.sh shell: bash - # TODO: Disabled until we can get an updated fork of msim with tokio 1.38 https://github.com/iotaledger/iota/issues/1212 - # simtest: - # name: Simtest ${{ matrix.components }} - # needs: changes - # timeout-minutes: 45 - # runs-on: [self-hosted] - # strategy: - # matrix: - # components: ${{ fromJson(needs.changes.outputs.components) }} - # fail-fast: false - # env: - # MSIM_WATCHDOG_TIMEOUT_MS: 60000 - # steps: - # - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 - # - uses: taiki-e/install-action@nextest - # - name: cargo simtest - # run: | - # scripts/simtest/cargo-simtest simtest -E 'rdeps(${{matrix.components}})' -p ${{matrix.components}} - # - name: check new tests for flakiness - # run: | - # scripts/simtest/stress-new-tests.sh -E 'rdeps(${{matrix.components}})' -p ${{matrix.components}} + simtest: + name: Simtest rust + needs: changes + timeout-minutes: 45 + runs-on: [self-hosted] + env: + MSIM_WATCHDOG_TIMEOUT_MS: 60000 + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + - uses: taiki-e/install-action@nextest + - name: setup filter + run: | + array=(${{ join(fromJson(needs.changes.outputs.components), ' ') }}) + + result="" + + for item in "${array[@]}"; do + mapped_item="-E 'rdeps(${item})'" + + if [ -z "$result" ]; then + result="$mapped_item" + else + result="$result $mapped_item" + fi + done + + echo "filters=$result" >> "$GITHUB_ENV" + - name: cargo simtest + run: | + command="scripts/simtest/cargo-simtest simtest $filters" + + echo "$command" + + eval ${command} + - name: check new tests for flakiness + run: | + command="scripts/simtest/stress-new-tests.sh $filters" + + echo "$command" + + eval ${command} # # Disabled # rosetta-validation: diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index ba92d3344a9..c7fc99f2630 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -115,6 +115,7 @@ jobs: uses: ./.github/workflows/_rust.yml with: isRust: ${{ needs.diff.outputs.isRust == 'true' }} + secrets: inherit e2e: if: github.event.pull_request.draft == false diff --git a/Cargo.lock b/Cargo.lock index 59f50889cc2..f80e4ec9e80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,17 +85,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -186,11 +175,11 @@ dependencies = [ "rustls-webpki 0.101.7", "serde", "serde_json", - "socket2 0.5.7", + "socket2", "tap", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tower", "tracing", "x509-parser", @@ -573,7 +562,7 @@ version = "52.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f4a9468c882dc66862cef4e1fd8423d47e67972377d85d80e022786427768c" dependencies = [ - "ahash 0.8.11", + "ahash", "arrow-buffer", "arrow-data", "arrow-schema", @@ -700,7 +689,7 @@ version = "52.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd09a518c602a55bd406bcc291a967b284cfa7a63edfbf8b897ea4748aad23c" dependencies = [ - "ahash 0.8.11", + "ahash", "arrow-array", "arrow-buffer", "arrow-data", @@ -720,7 +709,7 @@ version = "52.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "600bae05d43483d216fb3494f8c32fdbefd8aa4e1de237e790dbb3d9f44690a3" dependencies = [ - "ahash 0.8.11", + "ahash", "arrow-array", "arrow-buffer", "arrow-data", @@ -876,7 +865,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tower-service", ] @@ -893,7 +882,7 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.75", + "syn 2.0.76", "thiserror", ] @@ -929,7 +918,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -951,13 +940,14 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "async-task" -version = "4.3.0" -source = "git+https://github.com/mystenmark/async-task?rev=4e45b26e11126b191701b9b2ce5e2346b8d7682f#4e45b26e11126b191701b9b2ce5e2346b8d7682f" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" @@ -967,7 +957,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1181,7 +1171,7 @@ version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4abf69a87be33b6f125a93d5046b5f7395c26d1f449bf8d3927f5577463b6de0" dependencies = [ - "ahash 0.8.11", + "ahash", "aws-credential-types", "aws-runtime", "aws-sigv4", @@ -1456,7 +1446,7 @@ dependencies = [ "serde", "time", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1793,13 +1783,13 @@ dependencies = [ "lazy_static", "lazycell", "log", - "prettyplease 0.2.20", + "prettyplease 0.2.22", "proc-macro2", "quote", "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.75", + "syn 2.0.76", "which", ] @@ -2118,7 +2108,7 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4d73155ae6b28cf5de4cfc29aeb02b8a1c6dab883cb015d15cd514e42766846" dependencies = [ - "ahash 0.8.11", + "ahash", "async-trait", "cached_proc_macro", "cached_proc_macro_types", @@ -2139,7 +2129,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2232,9 +2222,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.13" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", @@ -2388,7 +2378,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2960,7 +2950,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3034,7 +3024,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3056,7 +3046,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3213,7 +3203,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3234,7 +3224,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3244,7 +3234,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3257,7 +3247,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3278,15 +3268,15 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ff2be1e7312c858b2ef974f5c7089833ae57b5311b334b30923af58e5718d8" +checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3306,7 +3296,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3421,7 +3411,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3475,7 +3465,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3705,7 +3695,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3724,7 +3714,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3920,9 +3910,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fd-lock" @@ -4050,9 +4040,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -4157,7 +4147,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4310,7 +4300,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4436,7 +4426,7 @@ dependencies = [ "indexmap 2.4.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", ] @@ -4455,7 +4445,7 @@ dependencies = [ "indexmap 2.4.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", ] @@ -4496,7 +4486,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -4505,7 +4495,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", "serde", ] @@ -4717,7 +4707,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio", "tower-service", "tracing", @@ -4824,7 +4814,7 @@ dependencies = [ "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio", "tower", "tower-service", @@ -5023,7 +5013,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" dependencies = [ "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5365,7 +5355,7 @@ dependencies = [ "telemetry-subscribers", "test-cluster", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", "typed-store", ] @@ -5748,7 +5738,7 @@ dependencies = [ "expect-test", "tempfile", "thiserror", - "toml 0.8.19", + "toml", "toml_edit 0.22.20", ] @@ -5975,8 +5965,8 @@ dependencies = [ "test-cluster", "thiserror", "tokio", - "tokio-util 0.7.11", - "toml 0.8.19", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", + "toml", "tower", "tower-http", "tracing", @@ -6568,7 +6558,7 @@ dependencies = [ "msim-macros", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -6945,7 +6935,7 @@ dependencies = [ "tempfile", "test-cluster", "tokio", - "toml 0.8.19", + "toml", "tower", "tower-http", "tracing", @@ -6958,6 +6948,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", + "axum", "backoff", "base64-url", "bcs", @@ -6979,6 +6970,7 @@ dependencies = [ "iota-macros", "iota-metrics", "iota-protocol-config", + "iota-simulator", "iota-test-transaction-builder", "iota-types", "itertools 0.13.0", @@ -6994,6 +6986,7 @@ dependencies = [ "prometheus", "reqwest 0.12.7", "rocksdb", + "rustls 0.23.12", "serde", "serde_json", "tap", @@ -7579,7 +7572,7 @@ dependencies = [ "thiserror", "tokio", "tokio-rustls 0.26.0", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", "url", ] @@ -7646,7 +7639,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -7671,7 +7664,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tower", "tracing", ] @@ -7892,7 +7885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -7973,9 +7966,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.19" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -8148,7 +8141,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8158,7 +8151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" dependencies = [ "serde", - "toml 0.8.19", + "toml", ] [[package]] @@ -8272,7 +8265,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8664,7 +8657,7 @@ dependencies = [ "serde_yaml", "sha2 0.10.8", "tempfile", - "toml 0.8.19", + "toml", "toml_edit 0.22.20", "treeline", "walkdir", @@ -8676,7 +8669,7 @@ name = "move-proc-macros" version = "0.1.0" dependencies = [ "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8697,7 +8690,7 @@ dependencies = [ "once_cell", "serde", "simplelog", - "toml 0.8.19", + "toml", ] [[package]] @@ -8929,11 +8922,10 @@ dependencies = [ [[package]] name = "msim" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=6f88ec84644cb1a6809c010f1f534d0d09e0cd89#6f88ec84644cb1a6809c010f1f534d0d09e0cd89" +source = "git+ssh://git@github.com/iotaledger/iota-sim.git?rev=8fe1939f4bf1e54d0638756c82aaa6c29212e2bb#8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" dependencies = [ - "ahash 0.7.8", + "ahash", "async-task", - "bincode", "bytes", "cc", "downcast-rs", @@ -8947,10 +8939,10 @@ dependencies = [ "rand", "real_tokio", "serde", - "socket2 0.4.10", + "socket2", "tap", - "tokio-util 0.7.10", - "toml 0.5.11", + "tokio-util 0.7.11 (git+ssh://git@github.com/iotaledger/tokio-madsim-fork.git?branch=main)", + "toml", "tracing", "tracing-subscriber", ] @@ -8958,7 +8950,7 @@ dependencies = [ [[package]] name = "msim-macros" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=6f88ec84644cb1a6809c010f1f534d0d09e0cd89#6f88ec84644cb1a6809c010f1f534d0d09e0cd89" +source = "git+ssh://git@github.com/iotaledger/iota-sim.git?rev=8fe1939f4bf1e54d0638756c82aaa6c29212e2bb#8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" dependencies = [ "darling 0.14.4", "proc-macro2", @@ -9648,7 +9640,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -9857,7 +9849,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10058,7 +10050,7 @@ version = "52.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e977b9066b4d3b03555c22bdc442f3fadebd96a39111249113087d0edb2691cd" dependencies = [ - "ahash 0.8.11", + "ahash", "arrow-array", "arrow-buffer", "arrow-cast", @@ -10222,7 +10214,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10286,7 +10278,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10315,7 +10307,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10557,12 +10549,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10660,7 +10652,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "version_check", "yansi 1.0.1", ] @@ -10743,7 +10735,7 @@ checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10763,17 +10755,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" dependencies = [ "bytes", - "heck 0.4.1", + "heck 0.5.0", "itertools 0.13.0", "log", "multimap", "once_cell", "petgraph 0.6.5", - "prettyplease 0.2.20", + "prettyplease 0.2.22", "prost", "prost-types", "regex", - "syn 2.0.75", + "syn 2.0.76", "tempfile", ] @@ -10787,7 +10779,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10896,7 +10888,7 @@ dependencies = [ "quinn-udp 0.5.4", "rustc-hash 2.0.0", "rustls 0.23.12", - "socket2 0.5.7", + "socket2", "thiserror", "tokio", "tracing", @@ -10944,7 +10936,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.7", + "socket2", "tracing", "windows-sys 0.48.0", ] @@ -10957,16 +10949,16 @@ checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", - "socket2 0.5.7", + "socket2", "tracing", "windows-sys 0.52.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -11066,9 +11058,9 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba6a365afbe5615999275bea2446b970b10a41102500e27ce7678d50d978303" +checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" dependencies = [ "bitflags 2.6.0", "cassowary", @@ -11134,25 +11126,24 @@ checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "real_tokio" -version = "1.36.0" -source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=e47aafebf98e9c1734a8848a1876d5946c44bdd1#e47aafebf98e9c1734a8848a1876d5946c44bdd1" +version = "1.39.2" +source = "git+ssh://git@github.com/iotaledger/tokio-madsim-fork.git?branch=main#e34a35287024b341db16139a402508aaea8ec955" dependencies = [ "backtrace", "bytes", "libc", - "mio 0.8.11", - "num_cpus", + "mio 1.0.2", "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", - "tokio-macros 2.2.0", - "windows-sys 0.48.0", + "socket2", + "tokio-macros 2.4.0 (git+ssh://git@github.com/iotaledger/tokio-madsim-fork.git?branch=main)", + "windows-sys 0.52.0", ] [[package]] @@ -11210,7 +11201,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -11347,7 +11338,7 @@ dependencies = [ "sync_wrapper 1.0.1", "tokio", "tokio-rustls 0.26.0", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tower-service", "url", "wasm-bindgen", @@ -11578,7 +11569,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.75", + "syn 2.0.76", "unicode-ident", ] @@ -11856,9 +11847,9 @@ checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-platform-verifier" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bda3f493b9abe5b93b3e7e3ecde0df292f2bd28c0296b90586ee0055ff5123" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" dependencies = [ "core-foundation", "core-foundation-sys", @@ -11951,7 +11942,7 @@ checksum = "e5af959c8bf6af1aff6d2b463a57f71aae53d1332da58419e30ad8dc7011d951" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12018,7 +12009,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12150,9 +12141,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -12189,13 +12180,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12206,14 +12197,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "indexmap 2.4.0", "itoa", @@ -12240,7 +12231,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12298,7 +12289,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12346,7 +12337,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12666,16 +12657,6 @@ dependencies = [ "time", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.7" @@ -12914,7 +12895,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -12986,9 +12967,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -13024,9 +13005,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.31.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4115055da5f572fff541dd0c4e61b0262977f453cc9fe04be83aba25a89bdab" +checksum = "2b92e0bdf838cbc1c4c9ba14f9c97a7ec6cdcd1ae66b10e1e42775a25553f45d" dependencies = [ "core-foundation-sys", "libc", @@ -13243,10 +13224,10 @@ dependencies = [ "darling 0.20.10", "itertools 0.13.0", "once_cell", - "prettyplease 0.2.20", + "prettyplease 0.2.22", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -13290,7 +13271,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -13411,9 +13392,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", @@ -13422,31 +13403,31 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", - "tokio-macros 2.4.0", + "socket2", + "tokio-macros 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" -source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=e47aafebf98e9c1734a8848a1876d5946c44bdd1#e47aafebf98e9c1734a8848a1876d5946c44bdd1" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "tokio-macros" version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +source = "git+ssh://git@github.com/iotaledger/tokio-madsim-fork.git?branch=main#e34a35287024b341db16139a402508aaea8ec955" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -13490,7 +13471,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -13507,8 +13488,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" -source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=e47aafebf98e9c1734a8848a1876d5946c44bdd1#e47aafebf98e9c1734a8848a1876d5946c44bdd1" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -13517,16 +13499,13 @@ dependencies = [ "futures-util", "hashbrown 0.14.5", "pin-project-lite", - "real_tokio", - "slab", - "tracing", + "tokio", ] [[package]] name = "tokio-util" version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +source = "git+ssh://git@github.com/iotaledger/tokio-madsim-fork.git?branch=main#e34a35287024b341db16139a402508aaea8ec955" dependencies = [ "bytes", "futures-core", @@ -13535,16 +13514,8 @@ dependencies = [ "futures-util", "hashbrown 0.14.5", "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", + "real_tokio", + "slab", ] [[package]] @@ -13626,7 +13597,7 @@ dependencies = [ "pin-project", "prost", "rustls-pemfile 2.1.3", - "socket2 0.5.7", + "socket2", "tokio", "tokio-rustls 0.26.0", "tokio-stream", @@ -13642,11 +13613,11 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "568392c5a2bd0020723e3f387891176aabafe36fd9fcd074ad309dfa0c8eb964" dependencies = [ - "prettyplease 0.2.20", + "prettyplease 0.2.22", "proc-macro2", "prost-build", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -13677,7 +13648,7 @@ dependencies = [ "rand", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tower-layer", "tower-service", "tracing", @@ -13706,7 +13677,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "tower", "tower-layer", "tower-service", @@ -13758,7 +13729,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -14299,7 +14270,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -14333,7 +14304,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14533,7 +14504,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -14544,7 +14515,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -14926,7 +14897,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -14947,7 +14918,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e1154141a7d..5e4f405a689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -224,7 +224,7 @@ better_any = { version = "0.2", features = ["derive"] } bincode = "1.3" bip32 = "0.5" byteorder = "1.4" -bytes = { version = "1.5", features = ["serde"] } +bytes = { version = "1.7", features = ["serde"] } cached = { version = "0.53", features = ["async"] } camino = "1.1" cfg-if = "1.0" @@ -271,7 +271,7 @@ leb128 = "0.2" lru = "0.12" mockall = "0.13" more-asserts = "0.3" -msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "6f88ec84644cb1a6809c010f1f534d0d09e0cd89", package = "msim" } +msim = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb", package = "msim" } notify = "6.1" num-bigint = "0.4" num_cpus = "1.15" @@ -313,7 +313,9 @@ tap = "1.0" tempfile = "3.12" test-fuzz = "5.2" thiserror = "1.0" -tokio = "1.36" +# tokio is defined at a specific version to support patching with iota-sim +# Do not upgrade without updating https://github.com/iotaledger/iota-sim first +tokio = "=1.39.2" tokio-stream = { version = "0.1", features = ["sync", "net"] } tokio-util = "0.7" toml = { version = "0.8", features = ["preserve_order"] } diff --git a/crates/iota-proc-macros/Cargo.toml b/crates/iota-proc-macros/Cargo.toml index a4446d4d08a..084282af164 100644 --- a/crates/iota-proc-macros/Cargo.toml +++ b/crates/iota-proc-macros/Cargo.toml @@ -15,4 +15,4 @@ quote.workspace = true syn = { version = "2.0", features = ["full", "fold", "extra-traits"] } [target.'cfg(msim)'.dependencies] -msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "6f88ec84644cb1a6809c010f1f534d0d09e0cd89", package = "msim-macros" } +msim-macros = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb", package = "msim-macros" } diff --git a/crates/iota-simulator/README.md b/crates/iota-simulator/README.md index 5e1181e05d6..1587551df11 100644 --- a/crates/iota-simulator/README.md +++ b/crates/iota-simulator/README.md @@ -18,10 +18,10 @@ This allows us to: ## How it works: -The code for the simulator itself lives in the https://github.com/MystenLabs/mysten-sim repository. +The code for the simulator itself lives in the https://github.com/iotaledger/iota-sim repository. It has the following main components: -1. A [runtime](https://github.com/MystenLabs/mysten-sim/blob/main/msim/src/sim/runtime/mod.rs) which provides: +1. A [runtime](https://github.com/iotaledger/iota-sim/blob/main/msim/src/sim/runtime/mod.rs) which provides: - A "node" context for all running tasks. The node is a simulated machine, which can be killed, restarted, or paused. - A randomized but deterministic executor. - Simulated clock facilities, including timers, sleep(), etc. @@ -33,15 +33,15 @@ It has the following main components: - Most facilities from `tokio::runtime` and `tokio::time` are delegated back to the simulator runtime. - Custom implementations of the `tokio::net::Tcp*` structs are provided to interface with the network simulator. - Most other pieces of tokio (e.g. `sync`) did not need to be re-implemented because they don't interface with the runtime or the network. These are simply re-exported as is. - - A minimal [fork of tokio](https://github.com/mystenmark/tokio-madsim-fork) is required in order to expose certain internals to the simulator. This fork has very few modifications, which were written to be easily rebaseable when new tokio releases come out. + - A minimal [fork of tokio](https://github.com/iotaledger/tokio-madsim-fork) is required in order to expose certain internals to the simulator. This fork has very few modifications, which were written to be easily rebaseable when new tokio releases come out. 1. A library of interceptor functions which intercept various posix API calls in order to enforce determinism throughout the test. These include: - `getrandom()`, `getentropy()` - intercepted and delegated to the simulator PRNG. - - Various [socket api calls](https://github.com/MystenLabs/mysten-sim/blob/main/msim/src/sim/net/mod.rs#L195), which intercept networking operations and route them through the network simulator. It was necessary to do this at a very low level because [Quinn](https://github.com/quinn-rs/quinn) does its UDP I/O via direct `libc::` calls rather than using `tokio::net::UdpSocket`. + - Various [socket api calls](https://github.com/iotaledger/iota-sim/blob/main/msim/src/sim/net/mod.rs#L195), which intercept networking operations and route them through the network simulator. It was necessary to do this at a very low level because [Quinn](https://github.com/quinn-rs/quinn) does its UDP I/O via direct `libc::` calls rather than using `tokio::net::UdpSocket`. - `mach_absolute_time()`, `clock_gettime()`: Intercepted to provide deterministic high-resolution timing behavior. - TODO: `gettimeofday()`: We would like to intercept this to provide deterministic wall-clock operations (e.g. on dates, etc). However, intercepting this currently breaks RocksDB. - This interception behavior is in effect only in threads that have explicitly enabled it, which generally includes the main test thread only. In other threads, the interceptors delegate the call to the system library implementation via `dlsym()`. See implementation [here](https://github.com/MystenLabs/mysten-sim/blob/main/msim/src/sim/intercept.rs#L34-L48). + This interception behavior is in effect only in threads that have explicitly enabled it, which generally includes the main test thread only. In other threads, the interceptors delegate the call to the system library implementation via `dlsym()`. See implementation [here](https://github.com/iotaledger/iota-sim/blob/main/msim/src/sim/intercept.rs#L34-L48). 1. Procedural macros that replace `#[tokio::test]` and run test code inside a testing environment. These are `#[iota_test]` and `#[sim_test]` and are documented below. The test harness created by these macros initializes the simulator runtime with a starting seed, generates the simulator configuration, and runs the test inside a newly created thread. The test must be run in its own thread in order to provide each test case with fresh thread local storage. @@ -154,13 +154,13 @@ Also, the world will not end if you break this rule. You just might see confusin `#[sim_test]` currently accepts two arguments: -- `config = "config_expr"` - This argument accepts a string which will be evaluated as an expression that returns the configuration for the test. Generally, you should make this a function call, and then define the function to return the config. The function must return a type that can implements `Into` - the most common choice is `SimConfig`, but `Vec` and `Vec<(usize /* repeat count */, SimConfig)>` are also supported by default. See https://github.com/MystenLabs/mysten-sim/blob/main/msim/src/sim/config.rs for the `TestConfig` implementation. +- `config = "config_expr"` - This argument accepts a string which will be evaluated as an expression that returns the configuration for the test. Generally, you should make this a function call, and then define the function to return the config. The function must return a type that can implements `Into` - the most common choice is `SimConfig`, but `Vec` and `Vec<(usize /* repeat count */, SimConfig)>` are also supported by default. See https://github.com/iotaledger/iota-sim/blob/main/msim/src/sim/config.rs for the `TestConfig` implementation. - `check_determinism` - If set, the framework will run the test twice, and verify that it executes identically each time. (It does this by keeping a log which contains an entry for every call to the PRNG. Each entry contains a hash of the value yielded by the PRNG at that point + the current time.). Tests with `check_determinism` are usually for testing the framework itself, so you probably won't need to use this. ### Configuring the network: -Network latency and packet loss can be configured using [SimConfig](https://github.com/MystenLabs/mysten-sim/blob/main/msim/src/sim/config.rs#L8), which is re-exported from this crate as `iota_simulator::config::SimConfig`. +Network latency and packet loss can be configured using [SimConfig](https://github.com/iotaledger/iota-sim/blob/main/msim/src/sim/config.rs#L8), which is re-exported from this crate as `iota_simulator::config::SimConfig`. To configure a test, you write: @@ -189,7 +189,7 @@ For instance, you might do: ... } -Documentation of network configuration is not finished yet, but reading the code for the [NetworkConfig](https://github.com/MystenLabs/mysten-sim/blob/main/msim/src/sim/net/config.rs#L221) should be very instructive. +Documentation of network configuration is not finished yet, but reading the code for the [NetworkConfig](https://github.com/iotaledger/iota-sim/blob/main/msim/src/sim/net/config.rs#L221) should be very instructive. There is a small but growing library of functions for building network configs in [iota_simulator::configs](https://github.com/iotaledger/iota/blob/main/crates/iota-simulator/src/lib.rs). diff --git a/crates/iota-storage/Cargo.toml b/crates/iota-storage/Cargo.toml index 66ef2187def..e167e839a77 100644 --- a/crates/iota-storage/Cargo.toml +++ b/crates/iota-storage/Cargo.toml @@ -63,3 +63,8 @@ tempfile.workspace = true iota-macros = { workspace = true } iota-test-transaction-builder.workspace = true iota-types = { workspace = true, features = ["test-utils"] } + +[target.'cfg(msim)'.dev-dependencies] +axum.workspace = true +iota-simulator.workspace = true +rustls = "0.23" diff --git a/crates/iota-storage/tests/key_value_tests.rs b/crates/iota-storage/tests/key_value_tests.rs index 1eaa467da4e..dd6fbb9fbba 100644 --- a/crates/iota-storage/tests/key_value_tests.rs +++ b/crates/iota-storage/tests/key_value_tests.rs @@ -423,21 +423,20 @@ async fn test_get_tx_from_fallback() { #[cfg(msim)] mod simtests { - use std::{ - convert::Infallible, - net::SocketAddr, sync::Mutex, time::{Duration, Instant}, }; - use hyper::{ - service::{make_service_fn, service_fn}, - Body, Request, Response, Server, + use axum::{ + extract::{Request, State}, + routing::get, }; use iota_macros::sim_test; use iota_simulator::configs::constant_latency_ms; use iota_storage::http_key_value_store::*; + use rustls::crypto::{ring, CryptoProvider}; + use tokio::net::TcpListener; use tracing::info; use super::*; @@ -447,6 +446,20 @@ mod simtests { let builder = handle.create_node(); let (startup_sender, mut startup_receiver) = tokio::sync::watch::channel(false); let startup_sender = Arc::new(startup_sender); + let (sender, _) = tokio::sync::broadcast::channel::<()>(1); + + async fn get_data( + data: State>>>>, + req: Request, + ) -> Result, String> { + let path = req.uri().path().to_string(); + let key = path.trim_start_matches('/'); + let value = data.lock().unwrap().get(key).cloned(); + info!("Got request for key: {:?}, value: {:?}", key, value); + value.ok_or_else(|| "no value".to_owned()) + } + + let sender_clone = sender.clone(); let _node = builder .ip("10.10.10.10".parse().unwrap()) .name("server") @@ -454,42 +467,21 @@ mod simtests { info!("Server started"); let data = data.clone(); let startup_sender = startup_sender.clone(); + let mut receiver = sender_clone.subscribe(); async move { - let make_svc = make_service_fn(move |_| { - let data = data.clone(); - async { - Ok::<_, Infallible>(service_fn(move |req: Request| { - let data = data.clone(); - async move { - let path = req.uri().path().to_string(); - let key = path.trim_start_matches('/'); - let value = data.lock().unwrap().get(key).cloned(); - info!("Got request for key: {:?}, value: {:?}", key, value); - match value { - Some(v) => { - Ok::<_, Infallible>(Response::new(Body::from(v))) - } - None => Ok::<_, Infallible>( - Response::builder() - .status(hyper::StatusCode::NOT_FOUND) - .body(Body::empty()) - .unwrap(), - ), - } - } - })) - } - }); - - let addr = SocketAddr::from(([10, 10, 10, 10], 8080)); - let server = Server::bind(&addr).serve(make_svc); - - let graceful = server.with_graceful_shutdown(async { - tokio::time::sleep(Duration::from_secs(86400)).await; - }); - - tokio::spawn(async { - let _ = graceful.await; + let app = axum::Router::new() + .route("/", get(get_data)) + .with_state(data); + + let addr = TcpListener::bind(("10.10.10.10", 8080)).await.unwrap(); + + tokio::spawn(async move { + axum::serve(addr, app) + .with_graceful_shutdown(async move { + receiver.recv().await.ok(); + }) + .await + .unwrap() }); startup_sender.send(true).ok(); @@ -497,10 +489,15 @@ mod simtests { }) .build(); startup_receiver.changed().await.unwrap(); + sender.send(()).ok(); } #[sim_test(config = "constant_latency_ms(250)")] async fn test_multi_fetch() { + if CryptoProvider::get_default().is_none() { + ring::default_provider().install_default().ok(); + } + let mut data = HashMap::new(); let tx = random_tx(); diff --git a/deny.toml b/deny.toml index 037d82b10be..1a2d098912c 100644 --- a/deny.toml +++ b/deny.toml @@ -218,11 +218,11 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [ "https://github.com/aya-rs/aya.git", - "https://github.com/MystenLabs/mysten-sim.git", + "https://github.com/iotaledger/iota-sim.git", "https://github.com/MystenLabs/fastcrypto.git", "https://github.com/mystenlabs/anemo.git", "https://github.com/mystenmark/async-task.git", - "https://github.com/mystenmark/tokio-madsim-fork.git", + "https://github.com/iotaledger/tokio-madsim-fork.git", "https://github.com/nextest-rs/datatest-stable.git", "https://github.com/tokio-rs/prost", "https://github.com/zhiburt/tabled.git", diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index a9f3321605e..b1ead2e4e23 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -49,15 +49,15 @@ RUST_FLAGS=('"--cfg"' '"msim"') if [ -n "$LOCAL_MSIM_PATH" ]; then cargo_patch_args=( --config "patch.crates-io.tokio.path = \"$LOCAL_MSIM_PATH/msim-tokio\"" - --config "patch.'https://github.com/MystenLabs/mysten-sim'.msim.path = \"$LOCAL_MSIM_PATH/msim\"" + --config "patch.'https://github.com/iotaledger/iota-sim'.msim.path = \"$LOCAL_MSIM_PATH/msim\"" --config "patch.crates-io.futures-timer.path = \"$LOCAL_MSIM_PATH/mocked-crates/futures-timer\"" ) else cargo_patch_args=( - --config 'patch.crates-io.tokio.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.tokio.rev = "6f88ec84644cb1a6809c010f1f534d0d09e0cd89"' - --config 'patch.crates-io.futures-timer.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.futures-timer.rev = "6f88ec84644cb1a6809c010f1f534d0d09e0cd89"' + --config 'patch.crates-io.tokio.git = "ssh://git@github.com/iotaledger/iota-sim.git"' + --config 'patch.crates-io.tokio.rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb"' + --config 'patch.crates-io.futures-timer.git = "ssh://git@github.com/iotaledger/iota-sim.git"' + --config 'patch.crates-io.futures-timer.rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb"' ) fi diff --git a/scripts/simtest/config-patch b/scripts/simtest/config-patch index 4721ce638e0..3beda75b7f7 100644 --- a/scripts/simtest/config-patch +++ b/scripts/simtest/config-patch @@ -24,5 +24,5 @@ index 3b1ca4591c..e4ff4d61d2 100644 include_dir = "0.7.3" + +[patch.crates-io] -+tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "6f88ec84644cb1a6809c010f1f534d0d09e0cd89" } -+futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "6f88ec84644cb1a6809c010f1f534d0d09e0cd89" } ++tokio = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" } ++futures-timer = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" }