diff --git a/.github/workflows/build-release-binaries.yml b/.github/workflows/build-release-binaries.yml index 9c856a53..48888845 100644 --- a/.github/workflows/build-release-binaries.yml +++ b/.github/workflows/build-release-binaries.yml @@ -45,16 +45,16 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout tagged commit - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 with: ref: ${{ github.event.release.target_commitish }} token: ${{ secrets.BOTTY_GITHUB_TOKEN }} - - uses: Swatinem/rust-cache@v2.2.0 + - uses: Swatinem/rust-cache@v2.7.3 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.63 + toolchain: "1.70" targets: armv7-unknown-linux-gnueabihf - name: Build ${{ matrix.target }} ${{ matrix.bin }} release binary @@ -69,7 +69,7 @@ jobs: run: target/${{ matrix.target }}/release/${{ matrix.bin }} --help # Remove once python 3 is the default - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.x" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fa9eae1..5ff9a6d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,6 @@ on: pull_request: # Need to run on pull-requests, otherwise PRs from forks don't run push: branches: - - "staging" # Bors uses this branch - - "trying" # Bors uses this branch - "master" # Always build head of master for the badge in the README jobs: @@ -13,12 +11,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.2.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "1.70" + components: clippy,rustfmt + + - uses: Swatinem/rust-cache@v2.7.3 - name: Check formatting - uses: dprint/check@v2.1 + uses: dprint/check@v2.2 + with: + dprint-version: 0.39.1 - name: Run clippy with default features run: cargo clippy --workspace --all-targets -- -D warnings @@ -30,9 +35,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.0.2 + - uses: Swatinem/rust-cache@v2.7.3 - name: Build swap run: cargo build --bin swap @@ -44,12 +49,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.0.2 + - uses: Swatinem/rust-cache@v2.7.3 - name: Install sqlx-cli - run: cargo install sqlx-cli + run: cargo install sqlx-cli --locked - name: Run sqlite_dev_setup.sh script run: | @@ -71,13 +76,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.2.0 + - uses: Swatinem/rust-cache@v2.7.3 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.63 + toolchain: "1.70" targets: armv7-unknown-linux-gnueabihf - name: Build binary @@ -93,13 +98,13 @@ jobs: run: cross build -p swap --target ${{ matrix.target }} - name: Upload swap binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: swap-${{ matrix.target }} path: target/${{ matrix.target }}/debug/swap - name: Upload asb binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: asb-${{ matrix.target }} path: target/${{ matrix.target }}/debug/asb @@ -110,10 +115,23 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: + - name: (Free disk space on Ubuntu) + if: matrix.os == 'ubuntu-latest' + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # removing all of these takes ~10 mins, so just do as needed + android: true + dotnet: true + haskell: true + docker-images: false + large-packages: false + swap-storage: false + tool-cache: false + - name: Checkout sources - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.2.0 + - uses: Swatinem/rust-cache@v2.7.3 - name: Build tests run: cargo build --tests --workspace --all-features @@ -148,9 +166,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.2.0 + - uses: Swatinem/rust-cache@v2.7.3 - name: Run test ${{ matrix.test_name }} run: cargo test --package swap --all-features --test ${{ matrix.test_name }} -- --nocapture diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 40e79474..ac24fe3f 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -11,7 +11,7 @@ jobs: if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.1 - name: Extract version from branch name id: extract-version diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index bd9a8298..d980d388 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -12,7 +12,7 @@ jobs: name: "Draft a new release" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.1 with: token: ${{ secrets.BOTTY_GITHUB_TOKEN }} @@ -20,7 +20,7 @@ jobs: run: git checkout -b release/${{ github.event.inputs.version }} - name: Update changelog - uses: thomaseizinger/keep-a-changelog-new-release@1.3.0 + uses: thomaseizinger/keep-a-changelog-new-release@2.0.0 with: version: ${{ github.event.inputs.version }} changelogPath: CHANGELOG.md @@ -41,8 +41,12 @@ jobs: - name: Commit changelog and manifest files id: make-commit + env: + DPRINT_VERSION: 0.39.1 + RUST_TOOLCHAIN: 1.70 run: | - curl -fsSL https://dprint.dev/install.sh | sh + rustup component add rustfmt --toolchain "$RUST_TOOLCHAIN-x86_64-unknown-linux-gnu" + curl -fsSL https://dprint.dev/install.sh | sh -s $DPRINT_VERSION /home/runner/.dprint/bin/dprint fmt git add CHANGELOG.md Cargo.lock swap/Cargo.toml @@ -54,7 +58,7 @@ jobs: run: git push origin release/${{ github.event.inputs.version }} --force - name: Create pull request - uses: thomaseizinger/create-pull-request@1.3.0 + uses: thomaseizinger/create-pull-request@1.3.1 with: GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }} head: release/${{ github.event.inputs.version }} diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 180b8ebb..d27a645a 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -10,7 +10,7 @@ jobs: name: Create preview release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.1 - name: Delete 'preview' release uses: larryjoelane/delete-release-action@v1.0.24 diff --git a/CHANGELOG.md b/CHANGELOG.md index 51a1b67a..4d3ad105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Minimum Supported Rust Version (MSRV) bumped to 1.70 + +## [0.12.3] - 2023-09-20 + +- Swap: If no Monero daemon is manually specified, we will automatically choose one from a list of public daemons by connecting to each and checking their availability. + +## [0.12.2] - 2023-08-08 + ### Changed -- Minimum Supported Rust Version (MSRV) bumped to 1.63 +- Minimum Supported Rust Version (MSRV) bumped to 1.67 +- ASB can now register with multiple rendezvous nodes. The `rendezvous_point` option in `config.toml` can be a string with comma separated addresses, or a toml array of address strings. ## [0.12.1] - 2023-01-09 @@ -342,7 +351,9 @@ It is possible to migrate critical data from the old db to the sqlite but there - Fixed an issue where Alice would not verify if Bob's Bitcoin lock transaction is semantically correct, i.e. pays the agreed upon amount to an output owned by both of them. Fixing this required a **breaking change** on the network layer and hence old versions are not compatible with this version. -[unreleased]: https://github.com/comit-network/xmr-btc-swap/compare/0.12.1...HEAD +[Unreleased]: https://github.com/comit-network/xmr-btc-swap/compare/0.12.3...HEAD +[0.12.3]: https://github.com/comit-network/xmr-btc-swap/compare/0.12.2...0.12.3 +[0.12.2]: https://github.com/comit-network/xmr-btc-swap/compare/0.12.1...0.12.2 [0.12.1]: https://github.com/comit-network/xmr-btc-swap/compare/0.12.0...0.12.1 [0.12.0]: https://github.com/comit-network/xmr-btc-swap/compare/0.11.0...0.12.0 [0.11.0]: https://github.com/comit-network/xmr-btc-swap/compare/0.10.2...0.11.0 diff --git a/Cargo.lock b/Cargo.lock index 57bdbe74..59995984 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "adler32" version = "1.2.0" @@ -49,7 +64,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.11", "once_cell", "version_check", ] @@ -83,9 +98,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arrayref" @@ -105,6 +120,16 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3" +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -114,19 +139,19 @@ dependencies = [ "bzip2", "futures-core", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "tokio", ] [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] @@ -139,7 +164,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", ] [[package]] @@ -166,7 +191,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.18", "libc", "winapi", ] @@ -184,13 +209,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.6", + "getrandom 0.2.11", "instant", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "rand 0.8.3", "tokio", ] +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide 0.7.1", + "object", + "rustc-demangle", +] + [[package]] name = "base32" version = "0.4.0" @@ -220,21 +260,21 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.20.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bdk" -version = "0.25.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e7eb54c6288eca1b698e6e33dd82ebe6c08a93ec1a96bb6926ddceed22c703" +checksum = "e9b650f45ae7dc8558544448253f3e1ae443433637ccd9f9d14d2089ff913480" dependencies = [ "async-trait", "bdk-macros", "bitcoin", "electrum-client", - "getrandom 0.2.6", + "getrandom 0.2.11", "js-sys", "log", "miniscript", @@ -253,7 +293,7 @@ checksum = "81c1980e50ae23bb6efa9283ae8679d6ea2c6fa6a99fe62533f65f4a25a1a56c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -326,7 +366,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "testcontainers 0.14.0", + "testcontainers", "thiserror", "tokio", "tracing", @@ -359,6 +399,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "blake2" version = "0.9.2" @@ -418,47 +464,47 @@ dependencies = [ [[package]] name = "borsh" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +checksum = "822462c1e7b17b31961798a6874b36daea6818e99e0cb7d3b7b0fa3c477751c3" dependencies = [ "borsh-derive", - "hashbrown 0.11.2", + "hashbrown 0.12.3", ] [[package]] name = "borsh-derive" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +checksum = "37626c9e941a687ee9abef6065b44c379478ae563b7483c613dd705ef1dff59e" dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] name = "borsh-derive-internal" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +checksum = "61820b4c5693eafb998b1e67485423c923db4a75f72585c247bdee32bad81e7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "borsh-schema-derive-internal" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +checksum = "c76cdbfa13def20d1f8af3ae7b3c6771f06352a74221d8851262ac384c122b8e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -491,14 +537,14 @@ checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "bytemuck" -version = "1.5.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" @@ -535,11 +581,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -579,12 +626,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "checked_int_cast" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" - [[package]] name = "chrono" version = "0.4.19" @@ -616,7 +657,7 @@ checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ "ansi_term 0.11.0", "atty", - "bitflags", + "bitflags 1.3.2", "strsim 0.8.0", "textwrap", "unicode-width", @@ -629,37 +670,47 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colored" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +dependencies = [ + "is-terminal", + "lazy_static", + "windows-sys 0.48.0", +] + [[package]] name = "comfy-table" -version = "6.1.4" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" +checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" dependencies = [ "crossterm", - "strum", - "strum_macros", + "strum 0.25.0", + "strum_macros 0.25.3", "unicode-width", ] [[package]] name = "config" -version = "0.13.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" dependencies = [ - "async-trait", "lazy_static", "nom", "pathdiff", "serde", - "toml", + "toml 0.8.10", ] [[package]] name = "conquer-once" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c6d3a9775a69f6d1fe2cc888999b67ed30257d3da4d2af91984e722f2ec918a" +checksum = "5d008a441c0f269f36ca13712528069a86a3e60dffee1d98b976eb3b0b2160b4" dependencies = [ "conquer-util", ] @@ -757,9 +808,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -790,35 +841,31 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" dependencies = [ "cfg-if 1.0.0", - "lazy_static", ] [[package]] name = "crossterm" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags", + "bitflags 2.4.0", "crossterm_winapi", "libc", - "mio", "parking_lot 0.12.0", - "signal-hook", - "signal-hook-mio", "winapi", ] [[package]] name = "crossterm_winapi" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" dependencies = [ "winapi", ] @@ -849,16 +896,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "crypto-mac" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-mac" version = "0.11.1" @@ -926,7 +963,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn", + "syn 1.0.109", ] [[package]] @@ -937,7 +974,7 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -953,9 +990,18 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "deranged" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +dependencies = [ + "powerfmt", +] [[package]] name = "derive_more" @@ -967,17 +1013,19 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.109", ] [[package]] name = "dialoguer" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92e7e37ecef6857fdc0c0c5d42fd5b0938e46590c2183cc92dd310a6d078eb1" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ "console", + "shell-words", "tempfile", + "thiserror", "zeroize", ] @@ -992,9 +1040,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.2", "crypto-common", @@ -1119,27 +1167,23 @@ dependencies = [ "heck 0.3.2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "enum-iterator" -version = "1.1.3" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401" -dependencies = [ - "enum-iterator-derive", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "enum-iterator-derive" -version = "1.1.0" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "proc-macro2", - "quote", - "syn", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -1150,12 +1194,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "1.7.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "filetime" @@ -1165,7 +1206,7 @@ checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.10", "winapi", ] @@ -1197,7 +1238,7 @@ dependencies = [ "crc32fast", "libc", "libz-sys", - "miniz_oxide", + "miniz_oxide 0.3.7", ] [[package]] @@ -1220,9 +1261,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1245,9 +1286,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1260,9 +1301,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1270,15 +1311,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1299,19 +1340,19 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] @@ -1327,15 +1368,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -1345,9 +1386,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1356,7 +1397,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "pin-utils", "slab", ] @@ -1400,25 +1441,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", -] - -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -1431,13 +1460,19 @@ dependencies = [ "polyval", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "git2" -version = "0.15.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" +checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ - "bitflags", + "bitflags 2.4.0", "libc", "libgit2-sys", "log", @@ -1446,20 +1481,20 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.11" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap", + "http 0.2.11", + "indexmap 1.7.0", "slab", "tokio", - "tokio-util 0.6.9", + "tokio-util", "tracing", ] @@ -1487,6 +1522,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "hashlink" version = "0.8.1" @@ -1507,9 +1548,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" dependencies = [ "unicode-segmentation", ] @@ -1523,6 +1564,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hex" version = "0.4.3" @@ -1536,14 +1583,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" [[package]] -name = "hmac" -version = "0.10.1" +name = "hex-literal" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" -dependencies = [ - "crypto-mac 0.10.0", - "digest 0.9.0", -] +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -1561,7 +1604,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -1577,13 +1620,24 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ "bytes", "fnv", - "itoa 0.4.7", + "itoa", ] [[package]] @@ -1593,7 +1647,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" dependencies = [ "bytes", - "http", + "http 0.2.11", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.0.0", ] [[package]] @@ -1610,39 +1674,51 @@ checksum = "05842d0d43232b23ccb7060ecb0f0626922c21f30012e97b767b30afd4a5d4b9" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http", - "http-body", + "http 0.2.11", + "http-body 0.4.0", "httparse", "httpdate", - "itoa 1.0.1", - "pin-project-lite 0.2.9", - "socket2 0.4.7", + "itoa", + "pin-project-lite 0.2.13", + "socket2 0.5.5", "tokio", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +dependencies = [ + "bytes", + "http 1.0.0", + "http-body 1.0.0", + "tokio", +] + [[package]] name = "hyper-rustls" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ - "http", - "hyper", - "rustls 0.20.2", + "http 0.2.11", + "hyper 0.14.28", + "rustls 0.21.10", "tokio", - "tokio-rustls 0.23.1", + "tokio-rustls 0.24.0", ] [[package]] @@ -1664,9 +1740,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1684,15 +1760,14 @@ dependencies = [ [[package]] name = "image" -version = "0.23.14" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", "byteorder", "color_quant", - "num-iter", - "num-rational 0.3.2", + "num-rational 0.4.1", "num-traits", ] @@ -1706,6 +1781,16 @@ dependencies = [ "hashbrown 0.11.2", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + [[package]] name = "instant" version = "0.1.12" @@ -1733,6 +1818,17 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.1", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1743,10 +1839,13 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "0.4.7" +name = "itertools" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] [[package]] name = "itoa" @@ -1765,9 +1864,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.48" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -1793,7 +1892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97c11e429f0eaa41fe659013680b459d2368d8f0a3e69dccfb7a35800b0dc27b" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1820,15 +1919,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.14.0+1.5.0" +version = "0.16.1+1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b" +checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" dependencies = [ "cc", "libc", @@ -1836,6 +1935,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + [[package]] name = "libp2p" version = "0.42.2" @@ -1846,7 +1951,7 @@ dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.6", + "getrandom 0.2.11", "instant", "lazy_static", "libp2p-core", @@ -1894,9 +1999,9 @@ dependencies = [ "prost", "prost-build", "rand 0.8.3", - "ring", + "ring 0.16.20", "rw-stream-sink", - "sha2 0.10.6", + "sha2 0.10.8", "smallvec", "thiserror", "unsigned-varint", @@ -1980,7 +2085,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.3", - "sha2 0.10.6", + "sha2 0.10.8", "snow", "static_assertions", "x25519-dalek", @@ -2020,7 +2125,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.3", - "sha2 0.10.6", + "sha2 0.10.8", "thiserror", "unsigned-varint", "void", @@ -2068,7 +2173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33b4d0acd47739fe0b570728d8d11bbb535050d84c0cf05d6477a4891fceae10" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2148,6 +2253,12 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + [[package]] name = "lock_api" version = "0.4.6" @@ -2159,12 +2270,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.14" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -2216,9 +2324,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -2243,9 +2351,9 @@ checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" [[package]] name = "miniscript" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4975078076f0b7b914a3044ad7432d2a7fcec38edb855afdc672e24ca35b69" +checksum = "123a10aae81d0712ecc09b780f6f0ae0b0f506a5c4c912974725760d59ba073e" dependencies = [ "bitcoin", "serde", @@ -2260,16 +2368,43 @@ dependencies = [ "adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" -version = "0.8.4" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.48.0", +] + +[[package]] +name = "mockito" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c84fe1f1d8c56dc157f79942056fad4b9efceebba374a01b222428b553facb" +dependencies = [ + "assert-json-diff", + "colored", + "futures", + "hyper 0.14.28", + "log", + "rand 0.8.3", + "regex", + "serde_json", + "serde_urlencoded", + "similar", + "tokio", ] [[package]] @@ -2281,7 +2416,7 @@ dependencies = [ "curve25519-dalek-ng", "fixed-hash", "hex", - "hex-literal", + "hex-literal 0.3.4", "keccak-hash", "serde", "serde-big-array", @@ -2307,7 +2442,7 @@ dependencies = [ "monero-rpc", "rand 0.7.3", "spectral", - "testcontainers 0.12.0", + "testcontainers", "tokio", "tracing", "tracing-subscriber 0.2.25", @@ -2320,7 +2455,7 @@ dependencies = [ "anyhow", "curve25519-dalek", "hex", - "hex-literal", + "hex-literal 0.4.1", "jsonrpc_client", "monero", "monero-epee-bin-serde", @@ -2343,7 +2478,7 @@ dependencies = [ "monero-harness", "monero-rpc", "rand 0.7.3", - "testcontainers 0.12.0", + "testcontainers", "tokio", "tracing-subscriber 0.2.25", ] @@ -2389,7 +2524,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -2430,6 +2565,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num" version = "0.1.42" @@ -2466,6 +2611,12 @@ dependencies = [ "rustc-serialize", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.44" @@ -2501,9 +2652,9 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", "num-integer", @@ -2512,11 +2663,12 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2525,10 +2677,28 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.18", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.13.0" @@ -2548,7 +2718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f85842b073145726190373213c63f852020fb884c841a3a1f390637267a2fb8c" dependencies = [ "dtoa", - "itoa 1.0.1", + "itoa", "open-metrics-client-derive-text-encode", "owning_ref", ] @@ -2561,7 +2731,7 @@ checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2570,6 +2740,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owning_ref" version = "0.4.1" @@ -2609,7 +2785,7 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.10", "smallvec", "winapi", ] @@ -2622,7 +2798,7 @@ checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.10", "smallvec", "windows-sys 0.32.0", ] @@ -2641,18 +2817,19 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pem" -version = "1.1.0" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", + "serde", ] [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -2670,7 +2847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.7.0", ] [[package]] @@ -2699,7 +2876,7 @@ checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2710,7 +2887,7 @@ checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2721,9 +2898,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2765,6 +2942,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6519412c9e0d4be579b9f0618364d19cb434b324fc6ddb1b27b1e682c7105ed" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.10" @@ -2787,7 +2970,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.11", ] [[package]] @@ -2797,7 +2980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" dependencies = [ "thiserror", - "toml", + "toml 0.5.11", ] [[package]] @@ -2809,7 +2992,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -2826,31 +3009,31 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.0.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", - "bitflags", - "byteorder", + "bit-vec", + "bitflags 2.4.0", "lazy_static", "num-traits", - "quick-error 2.0.0", "rand 0.8.3", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.8.2", "rusty-fork", "tempfile", + "unarray", ] [[package]] @@ -2871,7 +3054,7 @@ checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ "bytes", "heck 0.3.2", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -2890,10 +3073,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2923,16 +3106,15 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "qrcode" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" +checksum = "166f136dfdb199f98186f3649cf7a0536534a61417a1a30221b492b4fb60ce3f" dependencies = [ - "checked_int_cast", "image", ] @@ -2942,12 +3124,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quick-error" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda" - [[package]] name = "quicksink" version = "0.1.2" @@ -2961,9 +3137,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -3056,7 +3232,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.11", ] [[package]] @@ -3101,7 +3277,16 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ - "bitflags", + "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]] @@ -3110,19 +3295,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.6", - "redox_syscall", + "getrandom 0.2.11", + "redox_syscall 0.2.10", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] @@ -3132,23 +3317,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" dependencies = [ "byteorder", - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rend" @@ -3161,19 +3343,19 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http", - "http-body", - "hyper", + "http 0.2.11", + "http-body 0.4.0", + "hyper 0.14.28", "hyper-rustls", "ipnet", "js-sys", @@ -3181,23 +3363,26 @@ dependencies = [ "mime", "once_cell", "percent-encoding", - "pin-project-lite 0.2.9", - "rustls 0.20.2", + "pin-project-lite 0.2.13", + "rustls 0.21.10", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", - "tokio-rustls 0.23.1", + "tokio-rustls 0.24.0", "tokio-socks", - "tokio-util 0.7.3", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", - "webpki-roots 0.22.2", - "winreg 0.10.1", + "webpki-roots 0.25.3", + "winreg 0.50.0", ] [[package]] @@ -3207,7 +3392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ "hostname", - "quick-error 1.2.3", + "quick-error", ] [[package]] @@ -3220,11 +3405,25 @@ dependencies = [ "libc", "once_cell", "spin 0.5.2", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +dependencies = [ + "cc", + "getrandom 0.2.11", + "libc", + "spin 0.9.4", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "rkyv" version = "0.7.39" @@ -3247,14 +3446,14 @@ checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "rust_decimal" -version = "1.27.0" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c321ee4e17d2b7abe12b5d20c1231db708dd36185c8a21e9de5fed6da4dbe9" +checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" dependencies = [ "arrayvec", "borsh", @@ -3270,14 +3469,20 @@ dependencies = [ [[package]] name = "rust_decimal_macros" -version = "1.27.0" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7e2dba1342e9f1166786a4329ba0d6d6b8d9db7e81d702ec9ba3b39591ddff" +checksum = "7ca5c398d85f83b9a44de754a2048625a8c5eafcf070da7b8f116b685e2f6608" dependencies = [ "quote", "rust_decimal", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -3299,6 +3504,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "rustls" version = "0.19.0" @@ -3307,7 +3525,7 @@ checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" dependencies = [ "base64 0.13.1", "log", - "ring", + "ring 0.16.20", "sct 0.6.0", "webpki 0.21.4", ] @@ -3319,11 +3537,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct 0.7.0", "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring 0.17.3", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-native-certs" version = "0.5.0" @@ -3345,11 +3575,21 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.3", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rusty-fork" @@ -3358,7 +3598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error 1.2.3", + "quick-error", "tempfile", "wait-timeout", ] @@ -3402,8 +3642,8 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3412,8 +3652,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3448,7 +3688,7 @@ name = "secp256kfun" version = "0.7.1" source = "git+https://github.com/LLFourn/secp256kfun#9657d8c12fd26df5e57254a0063eaf41082a38ca" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", "rand_core 0.6.2", "secp256k1", "serde", @@ -3461,7 +3701,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -3498,9 +3738,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -3527,26 +3767,35 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ - "itoa 1.0.1", + "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3554,7 +3803,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.1", + "itoa", "ryu", "serde", ] @@ -3578,14 +3827,14 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "serial_test" -version = "0.10.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c789ec87f4687d022a2405cf46e0cd6284889f1839de292cadeb6c6019506f2" +checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" dependencies = [ "dashmap", "futures", @@ -3597,13 +3846,13 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "0.10.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64f9e531ce97c88b4778aad0ceee079216071cffec6ac9b904277f8f92e7fe3" +checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] @@ -3634,13 +3883,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures 0.2.1", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -3657,47 +3906,32 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.1" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "sigma_fun" version = "0.4.1" source = "git+https://github.com/LLFourn/secp256kfun#9657d8c12fd26df5e57254a0063eaf41082a38ca" dependencies = [ "curve25519-dalek-ng", - "digest 0.10.5", + "digest 0.10.7", "generic-array", "rand_core 0.6.2", "secp256kfun", "serde", ] -[[package]] -name = "signal-hook" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" -dependencies = [ - "libc", - "mio", - "signal-hook", -] - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -3713,6 +3947,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + [[package]] name = "slab" version = "0.4.2" @@ -3752,7 +3992,7 @@ dependencies = [ "chacha20poly1305", "rand 0.8.3", "rand_core 0.6.2", - "ring", + "ring 0.16.20", "rustc_version", "sha2 0.9.8", "subtle", @@ -3780,6 +4020,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soketto" version = "0.7.0" @@ -3826,16 +4076,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" dependencies = [ - "itertools", + "itertools 0.10.5", "nom", "unicode_categories", ] [[package]] name = "sqlx" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" +checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" dependencies = [ "sqlx-core", "sqlx-macros", @@ -3843,13 +4093,13 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" +checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" dependencies = [ "ahash", "atoi", - "bitflags", + "bitflags 1.3.2", "byteorder", "bytes", "crc", @@ -3865,8 +4115,8 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap", - "itoa 1.0.1", + "indexmap 1.7.0", + "itoa", "libc", "libsqlite3-sys", "log", @@ -3877,7 +4127,7 @@ dependencies = [ "rustls 0.20.2", "rustls-pemfile", "serde", - "sha2 0.10.6", + "sha2 0.10.8", "smallvec", "sqlformat", "sqlx-rt", @@ -3890,31 +4140,31 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" +checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" dependencies = [ "dotenvy", "either", - "heck 0.4.0", + "heck 0.4.1", "hex", "once_cell", "proc-macro2", "quote", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.8", "sqlx-core", "sqlx-rt", - "syn", + "syn 1.0.109", "url", ] [[package]] name = "sqlx-rt" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" +checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" dependencies = [ "once_cell", "tokio", @@ -3976,29 +4226,48 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "strum" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" + +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" dependencies = [ - "strum_macros", + "strum_macros 0.26.1", ] [[package]] name = "strum_macros" -version = "0.24.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn", + "syn 2.0.46", +] + +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.46", ] [[package]] @@ -4015,14 +4284,14 @@ checksum = "8049cf85f0e715d6af38dde439cb0ccb91f67fb9f5f63c80f8b43e48356e1a3f" [[package]] name = "swap" -version = "0.12.1" +version = "0.12.3" dependencies = [ "anyhow", "async-compression", "async-trait", "atty", "backoff", - "base64 0.20.0", + "base64 0.21.7", "bdk", "big-bytes", "bitcoin", @@ -4040,9 +4309,10 @@ dependencies = [ "futures", "get-port", "hex", - "hyper", - "itertools", + "hyper 1.2.0", + "itertools 0.12.1", "libp2p", + "mockito", "monero", "monero-harness", "monero-rpc", @@ -4060,27 +4330,27 @@ dependencies = [ "serde_json", "serde_with", "serial_test", - "sha2 0.10.6", + "sha2 0.10.8", "sigma_fun", "spectral", "sqlx", "structopt", - "strum", + "strum 0.26.1", "tempfile", - "testcontainers 0.12.0", + "testcontainers", "thiserror", - "time 0.3.17", + "time 0.3.34", "tokio", "tokio-socks", "tokio-tar", "tokio-tungstenite", - "tokio-util 0.7.3", - "toml", + "tokio-util", + "toml 0.8.10", "torut", "tracing", "tracing-appender", "tracing-futures", - "tracing-subscriber 0.3.15", + "tracing-subscriber 0.3.18", "url", "uuid", "vergen", @@ -4090,15 +4360,32 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.104" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "synstructure" version = "0.12.4" @@ -4107,22 +4394,41 @@ checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" -version = "3.3.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -4135,21 +4441,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "testcontainers" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5e3ed6e3598dbf32cba8cb356b881c085e0adea57597f387723430dd94b4084" -dependencies = [ - "hex", - "hmac 0.10.1", - "log", - "rand 0.8.3", - "serde", - "serde_json", - "sha2 0.9.8", -] - [[package]] name = "testcontainers" version = "0.14.0" @@ -4164,7 +4455,7 @@ dependencies = [ "rand 0.8.3", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.8", ] [[package]] @@ -4178,22 +4469,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] @@ -4217,11 +4508,16 @@ dependencies = [ [[package]] name = "time" -version = "0.3.17" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ - "itoa 1.0.1", + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -4229,16 +4525,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -4268,33 +4565,32 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.2" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", - "once_cell", "parking_lot 0.12.0", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.4.7", + "socket2 0.5.5", "tokio-macros", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.7.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] @@ -4319,6 +4615,16 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "tokio-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +dependencies = [ + "rustls 0.21.10", + "tokio", +] + [[package]] name = "tokio-socks" version = "0.5.1" @@ -4338,20 +4644,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "tokio", ] [[package]] name = "tokio-tar" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50188549787c32c1c3d9c8c71ad7e003ccf2f102489c5a96e385c84760477f4" +checksum = "9d5714c010ca3e5c27114c1cdeb9d14641ace49874aa5626d7149e47aedace75" dependencies = [ "filetime", "futures-core", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "tokio", "tokio-stream", "xattr", @@ -4376,39 +4682,59 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "tokio", + "tracing", ] [[package]] -name = "tokio-util" -version = "0.7.3" +name = "toml" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite 0.2.9", - "tokio", - "tracing", + "serde", ] [[package]] name = "toml" -version = "0.5.10" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] @@ -4437,43 +4763,43 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.13", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-appender" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "time 0.3.17", - "tracing-subscriber 0.3.15", + "thiserror", + "time 0.3.34", + "tracing-subscriber 0.3.18", ] [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -4502,6 +4828,17 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-serde" version = "0.1.3" @@ -4527,27 +4864,27 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.1.2", ] [[package]] name = "tracing-subscriber" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term 0.12.1", "matchers 0.1.0", + "nu-ansi-term", "once_cell", "regex", "serde", "serde_json", "sharded-slab", "thread_local", - "time 0.3.17", + "time 0.3.34", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", "tracing-serde", ] @@ -4611,7 +4948,7 @@ dependencies = [ "base64 0.13.1", "byteorder", "bytes", - "http", + "http 0.2.11", "httparse", "log", "rand 0.8.3", @@ -4648,14 +4985,17 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -4665,9 +5005,9 @@ checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -4724,14 +5064,20 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -4744,11 +5090,11 @@ checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "uuid" -version = "1.2.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.11", "serde", ] @@ -4772,18 +5118,15 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vergen" -version = "7.4.4" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efadd36bc6fde40c6048443897d69511a19161c0756cb704ed403f8dfd2b7d1c" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" dependencies = [ "anyhow", "cfg-if 1.0.0", - "enum-iterator", - "getset", "git2", "rustversion", - "thiserror", - "time 0.3.17", + "time 0.3.34", ] [[package]] @@ -4823,12 +5166,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4837,9 +5174,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.71" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -4847,24 +5184,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.71" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.46", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.21" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -4874,9 +5211,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.71" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4884,28 +5221,41 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.71" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.46", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.71" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] [[package]] name = "web-sys" -version = "0.3.48" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -4917,8 +5267,8 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -4927,8 +5277,8 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -4949,6 +5299,12 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + [[package]] name = "which" version = "4.0.2" @@ -5002,17 +5358,64 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[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.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "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.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[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.32.0" @@ -5021,9 +5424,15 @@ checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[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" @@ -5033,9 +5442,15 @@ checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[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" @@ -5045,9 +5460,15 @@ checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -5057,9 +5478,27 @@ checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[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.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[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" @@ -5069,9 +5508,24 @@ checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[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.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" +dependencies = [ + "memchr", +] [[package]] name = "winreg" @@ -5084,11 +5538,12 @@ dependencies = [ [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] [[package]] @@ -5104,11 +5559,13 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" +checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] @@ -5142,7 +5599,7 @@ checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] diff --git a/README.md b/README.md index 3e6c3765..71a37896 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,13 @@ It is not recommended to bump fees when swapping because it can have unpredictab ## Contributing -We are encourage community contributions whether it be a bug fix or an improvement to the documentation. +We encourage community contributions whether it be a bug fix or an improvement to the documentation. Please have a look at the [contribution guidelines](./CONTRIBUTING.md). ## Rust Version Support Please note that only the latest stable Rust toolchain is supported. -All stable toolchains since 1.63 _should_ work. +All stable toolchains since 1.70 _should_ work. ## Contact diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 92e8a84c..00000000 --- a/bors.toml +++ /dev/null @@ -1,25 +0,0 @@ -status = [ - "static_analysis", - "bdk_test", - "sqlx_test", - "build (x86_64-unknown-linux-gnu, ubuntu-latest)", - "build (armv7-unknown-linux-gnueabihf, ubuntu-latest)", - "build (x86_64-apple-darwin, macos-latest)", - "build (x86_64-pc-windows-msvc, windows-latest)", - "test (ubuntu-latest)", - "test (macos-latest)", - "docker_tests (happy_path)", - "docker_tests (happy_path_restart_bob_after_xmr_locked)", - "docker_tests (happy_path_restart_alice_after_xmr_locked)", - "docker_tests (happy_path_restart_bob_before_xmr_locked)", - "docker_tests (alice_and_bob_refund_using_cancel_and_refund_command)", - "docker_tests (alice_and_bob_refund_using_cancel_then_refund_command)", - "docker_tests (alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired)", - "docker_tests (punish)", - "docker_tests (alice_punishes_after_restart_bob_dead)", - "docker_tests (alice_manually_punishes_after_bob_dead)", - "docker_tests (alice_refunds_after_restart_bob_refunded)", - "docker_tests (ensure_same_swap_id)", - "docker_tests (concurrent_bobs_before_xmr_lock_proof_sent)", - "docker_tests (alice_manually_redeems_after_enc_sig_learned)" -] diff --git a/docs/asb/README.md b/docs/asb/README.md index e0991d8d..16e0a602 100644 --- a/docs/asb/README.md +++ b/docs/asb/README.md @@ -42,13 +42,16 @@ Since the ASB is a long running task we specify the person running an ASB as ser The ASB daemon supports the libp2p [rendezvous-protocol](https://github.com/libp2p/specs/tree/master/rendezvous). Usage of the rendezvous functionality is entirely optional. -You can configure a rendezvous point in the `[network]` section of your config file. +You can configure one or more rendezvous points in the `[network]` section of your config file. For the registration to be successful, you also need to configure the externally reachable addresses within the `[network]` section. For example: ```toml [network] -rendezvous_point = "/dns4/discover.unstoppableswap.net/tcp/8888/p2p/12D3KooWA6cnqJpVnreBVnoro8midDL9Lpzmg8oJPoAGi7YYaamE" +rendezvous_point = [ + "/dns4/discover.unstoppableswap.net/tcp/8888/p2p/12D3KooWA6cnqJpVnreBVnoro8midDL9Lpzmg8oJPoAGi7YYaamE", + "/dns4/eratosthen.es/tcp/7798/p2p/12D3KooWAh7EXXa2ZyegzLGdjvj1W4G3EXrTGrf6trraoT1MEobs", +] external_addresses = ["/dns4/example.com/tcp/9939"] ``` diff --git a/dprint.json b/dprint.json index 18c300b2..8f18b0bf 100644 --- a/dprint.json +++ b/dprint.json @@ -3,22 +3,16 @@ "projectType": "openSource", "incremental": true, "markdown": {}, - "rustfmt": { - "edition": 2021, - "condense_wildcard_suffixes": true, - "format_macro_matchers": true, - "imports_granularity": "Module", - "use_field_init_shorthand": true, - "format_code_in_doc_comments": true, - "normalize_comments": true, - "wrap_comments": true, - "overflow_delimited_expr": true + "exec": { + "associations": "**/*.{rs}", + "rustfmt": "rustfmt --edition 2021", + "rustfmt.associations": "**/*.rs" }, "includes": ["**/*.{md}", "**/*.{toml}", "**/*.{rs}"], "excludes": ["target/"], "plugins": [ "https://plugins.dprint.dev/markdown-0.13.1.wasm", "https://github.com/thomaseizinger/dprint-plugin-cargo-toml/releases/download/0.1.0/cargo-toml-0.1.0.wasm", - "https://plugins.dprint.dev/rustfmt-0.6.1.exe-plugin@99b89a0599fd3a63e597e03436862157901f3facae2f0c2fbd0b9f656cdbc2a5" + "https://plugins.dprint.dev/exec-0.3.5.json@d687dda57be0fe9a0088ccdaefa5147649ff24127d8b3ea227536c68ee7abeab" ] } diff --git a/monero-harness/Cargo.toml b/monero-harness/Cargo.toml index b659220b..6780dbd8 100644 --- a/monero-harness/Cargo.toml +++ b/monero-harness/Cargo.toml @@ -11,7 +11,7 @@ futures = "0.3" monero-rpc = { path = "../monero-rpc" } rand = "0.7" spectral = "0.6" -testcontainers = "0.12" +testcontainers = "0.14" tokio = { version = "1", default-features = false, features = [ "rt-multi-thread", "time", "macros" ] } tracing = "0.1" tracing-subscriber = { version = "0.2", default-features = false, features = [ "fmt", "ansi", "env-filter", "tracing-log" ] } diff --git a/monero-harness/src/image.rs b/monero-harness/src/image.rs index 63cc4b20..d4dd3942 100644 --- a/monero-harness/src/image.rs +++ b/monero-harness/src/image.rs @@ -1,6 +1,4 @@ -use std::collections::HashMap; -use testcontainers::core::{Container, Docker, WaitForMessage}; -use testcontainers::Image; +use testcontainers::{core::WaitFor, Image, ImageArgs}; pub const MONEROD_DAEMON_CONTAINER_NAME: &str = "monerod"; pub const MONEROD_DEFAULT_NETWORK: &str = "monero_network"; @@ -13,43 +11,22 @@ pub const MONEROD_DEFAULT_NETWORK: &str = "monero_network"; /// this doesn't matter. pub const RPC_PORT: u16 = 18081; -#[derive(Debug, Default)] -pub struct Monerod { - args: MonerodArgs, -} +#[derive(Clone, Copy, Debug, Default)] +pub struct Monerod; impl Image for Monerod { type Args = MonerodArgs; - type EnvVars = HashMap; - type Volumes = HashMap; - type EntryPoint = str; - - fn descriptor(&self) -> String { - "rinocommunity/monero:v0.18.1.2".to_owned() - } - - fn wait_until_ready(&self, container: &Container<'_, D, Self>) { - container - .logs() - .stdout - .wait_for_message("RPC server started ok") - .unwrap(); - } - - fn args(&self) -> ::Args { - self.args.clone() - } - fn volumes(&self) -> Self::Volumes { - HashMap::new() + fn name(&self) -> String { + "rinocommunity/monero".into() } - fn env_vars(&self) -> Self::EnvVars { - HashMap::new() + fn tag(&self) -> String { + "v0.18.1.2".into() } - fn with_args(self, args: ::Args) -> Self { - Self { args } + fn ready_conditions(&self) -> Vec { + vec![WaitFor::message_on_stdout("RPC server started ok")] } fn entrypoint(&self) -> Option { @@ -58,43 +35,22 @@ impl Image for Monerod { } } -#[derive(Debug, Default)] -pub struct MoneroWalletRpc { - args: MoneroWalletRpcArgs, -} +#[derive(Clone, Copy, Debug)] +pub struct MoneroWalletRpc; impl Image for MoneroWalletRpc { type Args = MoneroWalletRpcArgs; - type EnvVars = HashMap; - type Volumes = HashMap; - type EntryPoint = str; - - fn descriptor(&self) -> String { - "rinocommunity/monero:v0.18.1.2".to_owned() - } - - fn wait_until_ready(&self, container: &Container<'_, D, Self>) { - container - .logs() - .stdout - .wait_for_message("Run server thread name: RPC") - .unwrap(); - } - - fn args(&self) -> ::Args { - self.args.clone() - } - fn volumes(&self) -> Self::Volumes { - HashMap::new() + fn name(&self) -> String { + "rinocommunity/monero".into() } - fn env_vars(&self) -> Self::EnvVars { - HashMap::new() + fn tag(&self) -> String { + "v0.18.1.2".into() } - fn with_args(self, args: ::Args) -> Self { - Self { args } + fn ready_conditions(&self) -> Vec { + vec![WaitFor::message_on_stdout("Run server thread name: RPC")] } fn entrypoint(&self) -> Option { @@ -104,10 +60,9 @@ impl Image for MoneroWalletRpc { } impl MoneroWalletRpc { - pub fn new(name: &str, daemon_address: String) -> Self { - Self { - args: MoneroWalletRpcArgs::new(name, daemon_address), - } + pub fn new(name: &str, daemon_address: String) -> (Self, MoneroWalletRpcArgs) { + let args = MoneroWalletRpcArgs::new(name, daemon_address); + (Self, args) } } @@ -191,6 +146,12 @@ impl IntoIterator for MonerodArgs { } } +impl ImageArgs for MonerodArgs { + fn into_iterator(self) -> Box> { + Box::new(self.into_iter()) + } +} + #[derive(Debug, Clone)] pub struct MoneroWalletRpcArgs { pub disable_rpc_login: bool, @@ -200,12 +161,6 @@ pub struct MoneroWalletRpcArgs { pub daemon_address: String, } -impl Default for MoneroWalletRpcArgs { - fn default() -> Self { - unimplemented!("A default instance for `MoneroWalletRpc` doesn't make sense because we always need to connect to a node.") - } -} - impl MoneroWalletRpcArgs { pub fn new(wallet_name: &str, daemon_address: String) -> Self { Self { @@ -247,3 +202,9 @@ impl IntoIterator for MoneroWalletRpcArgs { args.into_iter() } } + +impl ImageArgs for MoneroWalletRpcArgs { + fn into_iterator(self) -> Box> { + Box::new(self.into_iter()) + } +} diff --git a/monero-harness/src/lib.rs b/monero-harness/src/lib.rs index f762d5c5..d5f8a513 100644 --- a/monero-harness/src/lib.rs +++ b/monero-harness/src/lib.rs @@ -20,17 +20,20 @@ //! every BLOCK_TIME_SECS seconds. //! //! Also provides standalone JSON RPC clients for monerod and monero-wallet-rpc. -pub mod image; +use std::time::Duration; -use crate::image::{MONEROD_DAEMON_CONTAINER_NAME, MONEROD_DEFAULT_NETWORK, RPC_PORT}; use anyhow::{anyhow, bail, Context, Result}; +use testcontainers::clients::Cli; +use testcontainers::{Container, RunnableImage}; +use tokio::time; + use monero_rpc::monerod; use monero_rpc::monerod::MonerodRpc as _; use monero_rpc::wallet::{self, GetAddress, MoneroWalletRpc as _, Refreshed, Transfer}; -use std::time::Duration; -use testcontainers::clients::Cli; -use testcontainers::{Container, Docker, RunArgs}; -use tokio::time; + +use crate::image::{MONEROD_DAEMON_CONTAINER_NAME, MONEROD_DEFAULT_NETWORK, RPC_PORT}; + +pub mod image; /// How often we mine a block. const BLOCK_TIME_SECS: u64 = 1; @@ -56,8 +59,8 @@ impl<'c> Monero { additional_wallets: Vec<&'static str>, ) -> Result<( Self, - Container<'c, Cli, image::Monerod>, - Vec>, + Container<'c, image::Monerod>, + Vec>, )> { let prefix = format!("{}_", random_prefix()); let monerod_name = format!("{}{}", prefix, MONEROD_DAEMON_CONTAINER_NAME); @@ -221,15 +224,14 @@ impl<'c> Monerod { cli: &'c Cli, name: String, network: String, - ) -> Result<(Self, Container<'c, Cli, image::Monerod>)> { + ) -> Result<(Self, Container<'c, image::Monerod>)> { let image = image::Monerod::default(); - let run_args = RunArgs::default() - .with_name(name.clone()) + let image: RunnableImage = RunnableImage::from(image) + .with_container_name(name.clone()) .with_network(network.clone()); - let container = cli.run_with_args(image, run_args); - let monerod_rpc_port = container - .get_host_port(RPC_PORT) - .context("port not exposed")?; + + let container = cli.run(image); + let monerod_rpc_port = container.get_host_port_ipv4(RPC_PORT); Ok(( Self { @@ -249,7 +251,7 @@ impl<'c> Monerod { /// address pub async fn start_miner(&self, miner_wallet_address: &str) -> Result<()> { let monerod = self.client().clone(); - let _ = tokio::spawn(mine(monerod, miner_wallet_address.to_string())); + tokio::spawn(mine(monerod, miner_wallet_address.to_string())); Ok(()) } } @@ -262,19 +264,15 @@ impl<'c> MoneroWalletRpc { name: &str, monerod: &Monerod, prefix: String, - ) -> Result<(Self, Container<'c, Cli, image::MoneroWalletRpc>)> { + ) -> Result<(Self, Container<'c, image::MoneroWalletRpc>)> { let daemon_address = format!("{}:{}", monerod.name, RPC_PORT); - let image = image::MoneroWalletRpc::new(name, daemon_address); + let (image, args) = image::MoneroWalletRpc::new(name, daemon_address); + let image = RunnableImage::from((image, args)) + .with_container_name(format!("{}{}", prefix, name)) + .with_network(monerod.network.clone()); - let network = monerod.network.clone(); - let run_args = RunArgs::default() - // prefix the container name so we can run multiple tests - .with_name(format!("{}{}", prefix, name)) - .with_network(network.clone()); - let container = cli.run_with_args(image, run_args); - let wallet_rpc_port = container - .get_host_port(RPC_PORT) - .context("port not exposed")?; + let container = cli.run(image); + let wallet_rpc_port = container.get_host_port_ipv4(RPC_PORT); let client = wallet::Client::localhost(wallet_rpc_port)?; diff --git a/monero-rpc/Cargo.toml b/monero-rpc/Cargo.toml index 427345d6..6da1e88a 100644 --- a/monero-rpc/Cargo.toml +++ b/monero-rpc/Cargo.toml @@ -19,5 +19,5 @@ serde_json = "1.0" tracing = "0.1" [dev-dependencies] -hex-literal = "0.3" +hex-literal = "0.4" tokio = { version = "1", features = [ "full" ] } diff --git a/monero-rpc/src/monerod.rs b/monero-rpc/src/monerod.rs index 830aafdb..debb999f 100644 --- a/monero-rpc/src/monerod.rs +++ b/monero-rpc/src/monerod.rs @@ -47,9 +47,10 @@ impl Client { } pub async fn get_o_indexes(&self, txid: Hash) -> Result { - self.binary_request(self.get_o_indexes_bin_url.clone(), GetOIndexesPayload { - txid, - }) + self.binary_request( + self.get_o_indexes_bin_url.clone(), + GetOIndexesPayload { txid }, + ) .await } @@ -194,7 +195,7 @@ mod monero_serde_hex_block { { let hex = String::deserialize(deserializer)?; - let bytes = hex::decode(&hex).map_err(D::Error::custom)?; + let bytes = hex::decode(hex).map_err(D::Error::custom)?; let mut cursor = Cursor::new(bytes); let block = monero::Block::consensus_decode(&mut cursor).map_err(D::Error::custom)?; diff --git a/monero-wallet/Cargo.toml b/monero-wallet/Cargo.toml index f767b08e..81982c83 100644 --- a/monero-wallet/Cargo.toml +++ b/monero-wallet/Cargo.toml @@ -14,6 +14,6 @@ rand = "0.7" curve25519-dalek = "3" monero-harness = { path = "../monero-harness" } rand = "0.7" -testcontainers = "0.12" +testcontainers = "0.14" tokio = { version = "1", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs" ] } tracing-subscriber = { version = "0.2", default-features = false, features = [ "fmt", "ansi", "env-filter", "chrono", "tracing-log" ] } diff --git a/monero-wallet/src/lib.rs b/monero-wallet/src/lib.rs index 2058f476..080c2599 100644 --- a/monero-wallet/src/lib.rs +++ b/monero-wallet/src/lib.rs @@ -61,13 +61,12 @@ mod tests { use monero_harness::image::Monerod; use monero_rpc::monerod::{Client, GetOutputsOut}; use testcontainers::clients::Cli; - use testcontainers::Docker; #[tokio::test] async fn get_outs_for_key_offsets() { let cli = Cli::default(); let container = cli.run(Monerod::default()); - let rpc_client = Client::localhost(container.get_host_port(18081).unwrap()).unwrap(); + let rpc_client = Client::localhost(container.get_host_port_ipv4(18081)).unwrap(); rpc_client.generateblocks(150, "498AVruCDWgP9Az9LjMm89VWjrBrSZ2W2K3HFBiyzzrRjUJWUcCVxvY1iitfuKoek2FdX6MKGAD9Qb1G1P8QgR5jPmmt3Vj".to_owned()).await.unwrap(); let wallet = Wallet { client: rpc_client.clone(), diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8e45b7f1..d03c251b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.63" # also update this in the readme, changelog, and github actions +channel = "1.70" # also update this in the readme, changelog, and github actions components = ["clippy"] targets = ["armv7-unknown-linux-gnueabihf"] diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 3f40ce71..d5e2b529 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swap" -version = "0.12.1" +version = "0.12.3" authors = [ "The COMIT guys " ] edition = "2021" description = "XMR/BTC trustless atomic swaps." @@ -14,29 +14,29 @@ async-compression = { version = "0.3", features = [ "bzip2", "tokio" ] } async-trait = "0.1" atty = "0.2" backoff = { version = "0.4", features = [ "tokio" ] } -base64 = "0.20" -bdk = "0.25" +base64 = "0.21" +bdk = "0.28" big-bytes = "1" bitcoin = { version = "0.29", features = [ "rand", "serde" ] } bmrng = "0.5" -comfy-table = "6.1" -config = { version = "0.13", default-features = false, features = [ "toml" ] } -conquer-once = "0.3" +comfy-table = "7.1" +config = { version = "0.14", default-features = false, features = [ "toml" ] } +conquer-once = "0.4" curve25519-dalek = { package = "curve25519-dalek-ng", version = "4" } -data-encoding = "2.3" -dialoguer = "0.10" +data-encoding = "2.5" +dialoguer = "0.11" directories-next = "2" ecdsa_fun = { git = "https://github.com/LLFourn/secp256kfun", default-features = false, features = [ "libsecp_compat", "serde", "adaptor" ] } ed25519-dalek = "1" futures = { version = "0.3", default-features = false } hex = "0.4" -itertools = "0.10" +itertools = "0.12" libp2p = { version = "0.42.2", default-features = false, features = [ "tcp-tokio", "yamux", "mplex", "dns-tokio", "noise", "request-response", "websocket", "ping", "rendezvous", "identify" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } -pem = "1.1" +pem = "3.0" proptest = "1" -qrcode = "0.12" +qrcode = "0.13" rand = "0.8" rand_chacha = "0.3" reqwest = { version = "0.11", features = [ "rustls-tls", "stream", "socks" ], default-features = false } @@ -50,21 +50,21 @@ sha2 = "0.10" sigma_fun = { git = "https://github.com/LLFourn/secp256kfun", default-features = false, features = [ "ed25519", "serde", "secp256k1", "alloc" ] } sqlx = { version = "0.6", features = [ "sqlite", "runtime-tokio-rustls", "offline" ] } structopt = "0.3" -strum = { version = "0.24", features = [ "derive" ] } +strum = { version = "0.26", features = [ "derive" ] } thiserror = "1" time = "0.3" tokio = { version = "1", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] } tokio-socks = "0.5" tokio-tungstenite = { version = "0.15", features = [ "rustls-tls" ] } tokio-util = { version = "0.7", features = [ "io", "codec" ] } -toml = "0.5" +toml = "0.8" torut = { version = "0.2", default-features = false, features = [ "v3", "control" ] } tracing = { version = "0.1", features = [ "attributes" ] } tracing-appender = "0.2" tracing-futures = { version = "0.2", features = [ "std-future", "futures-03" ] } tracing-subscriber = { version = "0.3", default-features = false, features = [ "fmt", "ansi", "env-filter", "time", "tracing-log", "json" ] } url = { version = "2", features = [ "serde" ] } -uuid = { version = "1.2", features = [ "serde", "v4" ] } +uuid = { version = "1.7", features = [ "serde", "v4" ] } void = "1" [target.'cfg(not(windows))'.dependencies] @@ -76,16 +76,17 @@ zip = "0.5" [dev-dependencies] bitcoin-harness = "0.2.2" get-port = "3" -hyper = "0.14" +hyper = "1.2" +mockito = "1.3.0" monero-harness = { path = "../monero-harness" } port_check = "0.1" proptest = "1" serde_cbor = "0.11" -serial_test = "0.10" +serial_test = "3.0" spectral = "0.6" tempfile = "3" -testcontainers = "0.12" +testcontainers = "0.14" [build-dependencies] anyhow = "1" -vergen = { version = "7", default-features = false, features = [ "git", "build" ] } +vergen = { version = "8.3", default-features = false, features = [ "build", "git", "git2" ] } diff --git a/swap/build.rs b/swap/build.rs index 10b11e3c..57bbce40 100644 --- a/swap/build.rs +++ b/swap/build.rs @@ -1,9 +1,9 @@ use anyhow::Result; -use vergen::{vergen, Config, SemverKind}; +use vergen::EmitBuilder; fn main() -> Result<()> { - let mut config = Config::default(); - *config.git_mut().semver_kind_mut() = SemverKind::Lightweight; - - vergen(config) + EmitBuilder::builder() + .git_describe(true, true, None) + .emit()?; + Ok(()) } diff --git a/swap/src/asb.rs b/swap/src/asb.rs index fccd2f8b..b5ed8ac1 100644 --- a/swap/src/asb.rs +++ b/swap/src/asb.rs @@ -8,6 +8,7 @@ pub mod tracing; pub use event_loop::{EventLoop, EventLoopHandle, FixedRate, KrakenRate, LatestRate}; pub use network::behaviour::{Behaviour, OutEvent}; +pub use network::rendezvous::RendezvousNode; pub use network::transport; pub use rate::Rate; pub use recovery::cancel::cancel; @@ -18,4 +19,4 @@ pub use recovery::safely_abort::safely_abort; pub use recovery::{cancel, refund}; #[cfg(test)] -pub use network::rendezous; +pub use network::rendezvous; diff --git a/swap/src/asb/command.rs b/swap/src/asb/command.rs index 6831e595..f22e1500 100644 --- a/swap/src/asb/command.rs +++ b/swap/src/asb/command.rs @@ -226,7 +226,7 @@ pub enum Command { name = "asb", about = "Automated Swap Backend for swapping XMR for BTC", author, - version = env!("VERGEN_GIT_SEMVER_LIGHTWEIGHT") + version = env!("VERGEN_GIT_DESCRIBE") )] pub struct RawArguments { #[structopt(long, help = "Swap on testnet")] diff --git a/swap/src/asb/config.rs b/swap/src/asb/config.rs index 7e8492ec..ac651c71 100644 --- a/swap/src/asb/config.rs +++ b/swap/src/asb/config.rs @@ -134,8 +134,8 @@ pub struct Data { pub struct Network { #[serde(deserialize_with = "addr_list::deserialize")] pub listen: Vec, - #[serde(default)] - pub rendezvous_point: Option, + #[serde(default, deserialize_with = "addr_list::deserialize")] + pub rendezvous_point: Vec, #[serde(default, deserialize_with = "addr_list::deserialize")] pub external_addresses: Vec, } @@ -156,7 +156,7 @@ mod addr_list { let list: Result, _> = s .split(',') .filter(|s| !s.is_empty()) - .map(|s| s.parse().map_err(de::Error::custom)) + .map(|s| s.trim().parse().map_err(de::Error::custom)) .collect(); Ok(list?) } @@ -165,7 +165,7 @@ mod addr_list { .iter() .map(|v| { if let Value::String(s) = v { - s.parse().map_err(de::Error::custom) + s.trim().parse().map_err(de::Error::custom) } else { Err(de::Error::custom("expected a string")) } @@ -347,10 +347,27 @@ pub fn query_user_for_initial_config(testnet: bool) -> Result { } let ask_spread = Decimal::from_f64(ask_spread).context("Unable to parse spread")?; - let rendezvous_point = Input::::with_theme(&ColorfulTheme::default()) - .with_prompt("Do you want to advertise your ASB instance with a rendezvous node? Enter an empty string if not.") - .allow_empty(true) - .interact_text()?; + let mut number = 1; + let mut done = false; + let mut rendezvous_points = Vec::new(); + println!("ASB can register with multiple rendezvous nodes for discoverability. This can also be edited in the config file later."); + while !done { + let prompt = format!( + "Enter the address for rendezvous node ({number}). Or just hit Enter to continue." + ); + let rendezvous_addr = Input::::with_theme(&ColorfulTheme::default()) + .with_prompt(prompt) + .allow_empty(true) + .interact_text()?; + if rendezvous_addr.is_empty() { + done = true; + } else if rendezvous_points.contains(&rendezvous_addr) { + println!("That rendezvous address is already in the list."); + } else { + rendezvous_points.push(rendezvous_addr); + number += 1; + } + } println!(); @@ -358,11 +375,7 @@ pub fn query_user_for_initial_config(testnet: bool) -> Result { data: Data { dir: data_dir }, network: Network { listen: listen_addresses, - rendezvous_point: if rendezvous_point.is_empty() { - None - } else { - Some(rendezvous_point) - }, + rendezvous_point: rendezvous_points, // keeping the singular key name for backcompat external_addresses: vec![], }, bitcoin: Bitcoin { @@ -417,7 +430,7 @@ mod tests { }, network: Network { listen: vec![defaults.listen_address_tcp, defaults.listen_address_ws], - rendezvous_point: None, + rendezvous_point: vec![], external_addresses: vec![], }, monero: Monero { @@ -461,7 +474,7 @@ mod tests { }, network: Network { listen: vec![defaults.listen_address_tcp, defaults.listen_address_ws], - rendezvous_point: None, + rendezvous_point: vec![], external_addresses: vec![], }, monero: Monero { @@ -515,7 +528,7 @@ mod tests { }, network: Network { listen, - rendezvous_point: None, + rendezvous_point: vec![], external_addresses, }, monero: Monero { diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 130494bc..4083f130 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -253,8 +253,8 @@ where channel }.boxed()); } - SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::Registered { .. })) => { - tracing::info!("Successfully registered with rendezvous node"); + SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::Registered { rendezvous_node, ttl, namespace })) => { + tracing::info!("Successfully registered with rendezvous node: {} with namespace: {} and TTL: {:?}", rendezvous_node, namespace, ttl); } SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::RegisterFailed(error))) => { tracing::error!("Registration with rendezvous node failed: {:?}", error); diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 41b62c31..181ec9bc 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -44,7 +44,9 @@ pub mod transport { } pub mod behaviour { - use super::*; + use libp2p::swarm::behaviour::toggle::Toggle; + + use super::{rendezvous::RendezvousNode, *}; #[allow(clippy::large_enum_variant)] #[derive(Debug)] @@ -108,7 +110,7 @@ pub mod behaviour { where LR: LatestRate + Send + 'static, { - pub rendezvous: libp2p::swarm::behaviour::toggle::Toggle, + pub rendezvous: Toggle, pub quote: quote::Behaviour, pub swap_setup: alice::Behaviour, pub transfer_proof: transfer_proof::Behaviour, @@ -132,25 +134,22 @@ pub mod behaviour { resume_only: bool, env_config: env::Config, identify_params: (identity::Keypair, XmrBtcNamespace), - rendezvous_params: Option<(identity::Keypair, PeerId, Multiaddr, XmrBtcNamespace)>, + rendezvous_nodes: Vec, ) -> Self { - let agentVersion = format!("asb/{} ({})", env!("CARGO_PKG_VERSION"), identify_params.1); - let protocolVersion = "/comit/xmr/btc/1.0.0".to_string(); - let identifyConfig = IdentifyConfig::new(protocolVersion, identify_params.0.public()) - .with_agent_version(agentVersion); + let (identity, namespace) = identify_params; + let agent_version = format!("asb/{} ({})", env!("CARGO_PKG_VERSION"), namespace); + let protocol_version = "/comit/xmr/btc/1.0.0".to_string(); + let identifyConfig = IdentifyConfig::new(protocol_version, identity.public()) + .with_agent_version(agent_version); + + let behaviour = if rendezvous_nodes.is_empty() { + None + } else { + Some(rendezvous::Behaviour::new(identity, rendezvous_nodes)) + }; Self { - rendezvous: libp2p::swarm::behaviour::toggle::Toggle::from(rendezvous_params.map( - |(identity, rendezvous_peer_id, rendezvous_address, namespace)| { - rendezous::Behaviour::new( - identity, - rendezvous_peer_id, - rendezvous_address, - namespace, - None, // use default ttl on rendezvous point - ) - }, - )), + rendezvous: Toggle::from(behaviour), quote: quote::asb(), swap_setup: alice::Behaviour::new( min_buy, @@ -186,13 +185,14 @@ pub mod behaviour { } } -pub mod rendezous { +pub mod rendezvous { use super::*; use libp2p::swarm::dial_opts::DialOpts; use libp2p::swarm::DialError; + use std::collections::VecDeque; use std::pin::Pin; - #[derive(PartialEq)] + #[derive(Clone, PartialEq)] enum ConnectionStatus { Disconnected, Dialling, @@ -209,39 +209,59 @@ pub mod rendezous { pub struct Behaviour { inner: libp2p::rendezvous::client::Behaviour, - rendezvous_point: Multiaddr, - rendezvous_peer_id: PeerId, - namespace: XmrBtcNamespace, - registration_status: RegistrationStatus, + rendezvous_nodes: Vec, + to_dial: VecDeque, + } + + pub struct RendezvousNode { + pub address: Multiaddr, connection_status: ConnectionStatus, - registration_ttl: Option, + pub peer_id: PeerId, + registration_status: RegistrationStatus, + pub registration_ttl: Option, + pub namespace: XmrBtcNamespace, } - impl Behaviour { + impl RendezvousNode { pub fn new( - identity: identity::Keypair, - rendezvous_peer_id: PeerId, - rendezvous_address: Multiaddr, + address: &Multiaddr, + peer_id: PeerId, namespace: XmrBtcNamespace, registration_ttl: Option, ) -> Self { Self { - inner: libp2p::rendezvous::client::Behaviour::new(identity), - rendezvous_point: rendezvous_address, - rendezvous_peer_id, + address: address.to_owned(), + connection_status: ConnectionStatus::Disconnected, namespace, + peer_id, registration_status: RegistrationStatus::RegisterOnNextConnection, - connection_status: ConnectionStatus::Disconnected, registration_ttl, } } - fn register(&mut self) { - self.inner.register( - self.namespace.into(), - self.rendezvous_peer_id, - self.registration_ttl, - ); + fn set_connection(&mut self, status: ConnectionStatus) { + self.connection_status = status; + } + + fn set_registration(&mut self, status: RegistrationStatus) { + self.registration_status = status; + } + } + + impl Behaviour { + pub fn new(identity: identity::Keypair, rendezvous_nodes: Vec) -> Self { + Self { + inner: libp2p::rendezvous::client::Behaviour::new(identity), + rendezvous_nodes, + to_dial: VecDeque::new(), + } + } + + /// Calls the rendezvous register method of the node at node_index in the Vec of rendezvous nodes + fn register(&mut self, node_index: usize) { + let node = &self.rendezvous_nodes[node_index]; + self.inner + .register(node.namespace.into(), node.peer_id, node.registration_ttl); } } @@ -255,31 +275,37 @@ pub mod rendezous { } fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec { - if peer_id == &self.rendezvous_peer_id { - return vec![self.rendezvous_point.clone()]; + for node in self.rendezvous_nodes.iter() { + if peer_id == &node.peer_id { + return vec![node.address.clone()]; + } } vec![] } fn inject_connected(&mut self, peer_id: &PeerId) { - if peer_id == &self.rendezvous_peer_id { - self.connection_status = ConnectionStatus::Connected; - - match &self.registration_status { - RegistrationStatus::RegisterOnNextConnection => { - self.register(); - self.registration_status = RegistrationStatus::Pending; + for i in 0..self.rendezvous_nodes.len() { + if peer_id == &self.rendezvous_nodes[i].peer_id { + self.rendezvous_nodes[i].set_connection(ConnectionStatus::Connected); + match &self.rendezvous_nodes[i].registration_status { + RegistrationStatus::RegisterOnNextConnection => { + self.register(i); + self.rendezvous_nodes[i].set_registration(RegistrationStatus::Pending); + } + RegistrationStatus::Registered { .. } => {} + RegistrationStatus::Pending => {} } - RegistrationStatus::Registered { .. } => {} - RegistrationStatus::Pending => {} } } } fn inject_disconnected(&mut self, peer_id: &PeerId) { - if peer_id == &self.rendezvous_peer_id { - self.connection_status = ConnectionStatus::Disconnected; + for i in 0..self.rendezvous_nodes.len() { + let mut node = &mut self.rendezvous_nodes[i]; + if peer_id == &node.peer_id { + node.connection_status = ConnectionStatus::Disconnected; + } } } @@ -298,9 +324,12 @@ pub mod rendezous { _handler: Self::ProtocolsHandler, _error: &DialError, ) { - if let Some(id) = peer_id { - if id == self.rendezvous_peer_id { - self.connection_status = ConnectionStatus::Disconnected; + for i in 0..self.rendezvous_nodes.len() { + let mut node = &mut self.rendezvous_nodes[i]; + if let Some(id) = peer_id { + if id == node.peer_id { + node.connection_status = ConnectionStatus::Disconnected; + } } } } @@ -311,62 +340,73 @@ pub mod rendezous { cx: &mut std::task::Context<'_>, params: &mut impl PollParameters, ) -> Poll> { - match &mut self.registration_status { - RegistrationStatus::RegisterOnNextConnection => match self.connection_status { - ConnectionStatus::Disconnected => { - self.connection_status = ConnectionStatus::Dialling; - - return Poll::Ready(NetworkBehaviourAction::Dial { - opts: DialOpts::peer_id(self.rendezvous_peer_id) - .condition(PeerCondition::Disconnected) - .build(), - - handler: Self::ProtocolsHandler::new(Duration::from_secs(30)), - }); - } - ConnectionStatus::Dialling => {} - ConnectionStatus::Connected => { - self.registration_status = RegistrationStatus::Pending; - self.register(); - } - }, - RegistrationStatus::Registered { re_register_in } => { - if let Poll::Ready(()) = re_register_in.poll_unpin(cx) { - match self.connection_status { - ConnectionStatus::Connected => { - self.registration_status = RegistrationStatus::Pending; - self.register(); - } - ConnectionStatus::Disconnected => { - self.registration_status = - RegistrationStatus::RegisterOnNextConnection; - - return Poll::Ready(NetworkBehaviourAction::Dial { - opts: DialOpts::peer_id(self.rendezvous_peer_id) - .condition(PeerCondition::Disconnected) - .build(), - handler: Self::ProtocolsHandler::new(Duration::from_secs(30)), - }); + if let Some(peer_id) = self.to_dial.pop_front() { + return Poll::Ready(NetworkBehaviourAction::Dial { + opts: DialOpts::peer_id(peer_id) + .condition(PeerCondition::Disconnected) + .build(), + + handler: Self::ProtocolsHandler::new(Duration::from_secs(30)), + }); + } + // check the status of each rendezvous node + for i in 0..self.rendezvous_nodes.len() { + let connection_status = self.rendezvous_nodes[i].connection_status.clone(); + match &mut self.rendezvous_nodes[i].registration_status { + RegistrationStatus::RegisterOnNextConnection => match connection_status { + ConnectionStatus::Disconnected => { + self.rendezvous_nodes[i].set_connection(ConnectionStatus::Dialling); + self.to_dial.push_back(self.rendezvous_nodes[i].peer_id); + } + ConnectionStatus::Dialling => {} + ConnectionStatus::Connected => { + self.rendezvous_nodes[i].set_registration(RegistrationStatus::Pending); + self.register(i); + } + }, + RegistrationStatus::Registered { re_register_in } => { + if let Poll::Ready(()) = re_register_in.poll_unpin(cx) { + match connection_status { + ConnectionStatus::Connected => { + self.rendezvous_nodes[i] + .set_registration(RegistrationStatus::Pending); + self.register(i); + } + ConnectionStatus::Disconnected => { + self.rendezvous_nodes[i].set_registration( + RegistrationStatus::RegisterOnNextConnection, + ); + self.to_dial.push_back(self.rendezvous_nodes[i].peer_id); + } + ConnectionStatus::Dialling => {} } - ConnectionStatus::Dialling => {} } } + RegistrationStatus::Pending => {} } - RegistrationStatus::Pending => {} } let inner_poll = self.inner.poll(cx, params); - // reset the timer if we successfully registered + // reset the timer for the specific rendezvous node if we successfully registered if let Poll::Ready(NetworkBehaviourAction::GenerateEvent( - libp2p::rendezvous::client::Event::Registered { ttl, .. }, + libp2p::rendezvous::client::Event::Registered { + ttl, + rendezvous_node, + .. + }, )) = &inner_poll { - let half_of_ttl = Duration::from_secs(*ttl) / 2; - - self.registration_status = RegistrationStatus::Registered { - re_register_in: Box::pin(tokio::time::sleep(half_of_ttl)), - }; + if let Some(i) = self + .rendezvous_nodes + .iter() + .position(|n| &n.peer_id == rendezvous_node) + { + let half_of_ttl = Duration::from_secs(*ttl) / 2; + let re_register_in = Box::pin(tokio::time::sleep(half_of_ttl)); + let status = RegistrationStatus::Registered { re_register_in }; + self.rendezvous_nodes[i].set_registration(status); + } } inner_poll @@ -380,6 +420,7 @@ pub mod rendezous { use futures::StreamExt; use libp2p::rendezvous; use libp2p::swarm::SwarmEvent; + use std::collections::HashMap; #[tokio::test] async fn given_no_initial_connection_when_constructed_asb_connects_and_registers_with_rendezvous_node( @@ -387,16 +428,16 @@ pub mod rendezous { let mut rendezvous_node = new_swarm(|_, _| { rendezvous::server::Behaviour::new(rendezvous::server::Config::default()) }); - let rendezvous_address = rendezvous_node.listen_on_random_memory_address().await; + let address = rendezvous_node.listen_on_random_memory_address().await; + let rendezvous_point = RendezvousNode::new( + &address, + rendezvous_node.local_peer_id().to_owned(), + XmrBtcNamespace::Testnet, + None, + ); let mut asb = new_swarm(|_, identity| { - rendezous::Behaviour::new( - identity, - *rendezvous_node.local_peer_id(), - rendezvous_address, - XmrBtcNamespace::Testnet, - None, - ) + super::rendezvous::Behaviour::new(identity, vec![rendezvous_point]) }); asb.listen_on_random_memory_address().await; // this adds an external address @@ -428,16 +469,16 @@ pub mod rendezous { rendezvous::server::Config::default().with_min_ttl(2), ) }); - let rendezvous_address = rendezvous_node.listen_on_random_memory_address().await; + let address = rendezvous_node.listen_on_random_memory_address().await; + let rendezvous_point = RendezvousNode::new( + &address, + rendezvous_node.local_peer_id().to_owned(), + XmrBtcNamespace::Testnet, + Some(5), + ); let mut asb = new_swarm(|_, identity| { - rendezous::Behaviour::new( - identity, - *rendezvous_node.local_peer_id(), - rendezvous_address, - XmrBtcNamespace::Testnet, - Some(5), - ) + super::rendezvous::Behaviour::new(identity, vec![rendezvous_point]) }); asb.listen_on_random_memory_address().await; // this adds an external address @@ -467,5 +508,62 @@ pub mod rendezous { .unwrap() .unwrap(); } + + #[tokio::test] + async fn asb_registers_multiple() { + let registration_ttl = Some(10); + let mut rendezvous_nodes = Vec::new(); + let mut registrations = HashMap::new(); + // register with 5 rendezvous nodes + for _ in 0..5 { + let mut rendezvous = new_swarm(|_, _| { + rendezvous::server::Behaviour::new( + rendezvous::server::Config::default().with_min_ttl(2), + ) + }); + let address = rendezvous.listen_on_random_memory_address().await; + let id = *rendezvous.local_peer_id(); + registrations.insert(id, 0); + rendezvous_nodes.push(RendezvousNode::new( + &address, + *rendezvous.local_peer_id(), + XmrBtcNamespace::Testnet, + registration_ttl, + )); + tokio::spawn(async move { + loop { + rendezvous.next().await; + } + }); + } + + let mut asb = new_swarm(|_, identity| { + super::rendezvous::Behaviour::new(identity, rendezvous_nodes) + }); + asb.listen_on_random_memory_address().await; // this adds an external address + + let handle = tokio::spawn(async move { + loop { + if let SwarmEvent::Behaviour(rendezvous::client::Event::Registered { + rendezvous_node, + .. + }) = asb.select_next_some().await + { + registrations + .entry(rendezvous_node) + .and_modify(|counter| *counter += 1); + } + + if registrations.iter().all(|(_, &count)| count >= 4) { + break; + } + } + }); + + tokio::time::timeout(Duration::from_secs(30), handle) + .await + .unwrap() + .unwrap(); + } } } diff --git a/swap/src/bin/asb.rs b/swap/src/bin/asb.rs index d05a0dbb..ff3b0e4c 100644 --- a/swap/src/bin/asb.rs +++ b/swap/src/bin/asb.rs @@ -102,6 +102,19 @@ async fn main() -> Result<()> { match cmd { Command::Start { resume_only } => { + // check and warn for duplicate rendezvous points + let mut rendezvous_addrs = config.network.rendezvous_point.clone(); + let prev_len = rendezvous_addrs.len(); + rendezvous_addrs.sort(); + rendezvous_addrs.dedup(); + let new_len = rendezvous_addrs.len(); + if new_len < prev_len { + tracing::warn!( + "`rendezvous_point` config has {} duplicate entries, they are being ignored.", + prev_len - new_len + ); + } + let monero_wallet = init_monero_wallet(&config, env_config).await?; let monero_address = monero_wallet.get_main_address(); tracing::info!(%monero_address, "Monero wallet address"); @@ -161,7 +174,7 @@ async fn main() -> Result<()> { resume_only, env_config, namespace, - config.network.rendezvous_point, + &rendezvous_addrs, )?; for listen in config.network.listen.clone() { diff --git a/swap/src/bin/swap.rs b/swap/src/bin/swap.rs index 33c718c3..292a4586 100644 --- a/swap/src/bin/swap.rs +++ b/swap/src/bin/swap.rs @@ -521,7 +521,7 @@ async fn init_bitcoin_wallet( async fn init_monero_wallet( data_dir: PathBuf, - monero_daemon_address: String, + monero_daemon_address: Option, env_config: Config, ) -> Result<(monero::Wallet, monero::WalletRpcProcess)> { let network = env_config.monero_network; @@ -531,7 +531,7 @@ async fn init_monero_wallet( let monero_wallet_rpc = monero::WalletRpc::new(data_dir.join("monero")).await?; let monero_wallet_rpc_process = monero_wallet_rpc - .run(network, monero_daemon_address.as_str()) + .run(network, monero_daemon_address) .await?; let monero_wallet = monero::Wallet::open_or_create( diff --git a/swap/src/bitcoin/cancel.rs b/swap/src/bitcoin/cancel.rs index 354b0c00..35b6b197 100644 --- a/swap/src/bitcoin/cancel.rs +++ b/swap/src/bitcoin/cancel.rs @@ -210,14 +210,20 @@ impl TxCancel { }; // The order in which these are inserted doesn't matter - satisfier.insert(A, ::bitcoin::EcdsaSig { - sig: sig_a.into(), - hash_ty: EcdsaSighashType::All, - }); - satisfier.insert(B, ::bitcoin::EcdsaSig { - sig: sig_b.into(), - hash_ty: EcdsaSighashType::All, - }); + satisfier.insert( + A, + ::bitcoin::EcdsaSig { + sig: sig_a.into(), + hash_ty: EcdsaSighashType::All, + }, + ); + satisfier.insert( + B, + ::bitcoin::EcdsaSig { + sig: sig_b.into(), + hash_ty: EcdsaSighashType::All, + }, + ); satisfier }; diff --git a/swap/src/bitcoin/punish.rs b/swap/src/bitcoin/punish.rs index df7a1367..247c904f 100644 --- a/swap/src/bitcoin/punish.rs +++ b/swap/src/bitcoin/punish.rs @@ -65,14 +65,20 @@ impl TxPunish { let B = B.try_into()?; // The order in which these are inserted doesn't matter - satisfier.insert(A, ::bitcoin::EcdsaSig { - sig: sig_a.into(), - hash_ty: EcdsaSighashType::All, - }); - satisfier.insert(B, ::bitcoin::EcdsaSig { - sig: sig_b.into(), - hash_ty: EcdsaSighashType::All, - }); + satisfier.insert( + A, + ::bitcoin::EcdsaSig { + sig: sig_a.into(), + hash_ty: EcdsaSighashType::All, + }, + ); + satisfier.insert( + B, + ::bitcoin::EcdsaSig { + sig: sig_b.into(), + hash_ty: EcdsaSighashType::All, + }, + ); satisfier }; diff --git a/swap/src/bitcoin/redeem.rs b/swap/src/bitcoin/redeem.rs index d94f03d9..e91c25ee 100644 --- a/swap/src/bitcoin/redeem.rs +++ b/swap/src/bitcoin/redeem.rs @@ -87,14 +87,20 @@ impl TxRedeem { }; // The order in which these are inserted doesn't matter - satisfier.insert(A, ::bitcoin::EcdsaSig { - sig: sig_a.into(), - hash_ty: EcdsaSighashType::All, - }); - satisfier.insert(B, ::bitcoin::EcdsaSig { - sig: sig_b.into(), - hash_ty: EcdsaSighashType::All, - }); + satisfier.insert( + A, + ::bitcoin::EcdsaSig { + sig: sig_a.into(), + hash_ty: EcdsaSighashType::All, + }, + ); + satisfier.insert( + B, + ::bitcoin::EcdsaSig { + sig: sig_b.into(), + hash_ty: EcdsaSighashType::All, + }, + ); satisfier }; diff --git a/swap/src/bitcoin/refund.rs b/swap/src/bitcoin/refund.rs index 55aa6c25..a73dd0e3 100644 --- a/swap/src/bitcoin/refund.rs +++ b/swap/src/bitcoin/refund.rs @@ -70,14 +70,20 @@ impl TxRefund { }; // The order in which these are inserted doesn't matter - satisfier.insert(A, ::bitcoin::EcdsaSig { - sig: sig_a.into(), - hash_ty: EcdsaSighashType::All, - }); - satisfier.insert(B, ::bitcoin::EcdsaSig { - sig: sig_b.into(), - hash_ty: EcdsaSighashType::All, - }); + satisfier.insert( + A, + ::bitcoin::EcdsaSig { + sig: sig_a.into(), + hash_ty: EcdsaSighashType::All, + }, + ); + satisfier.insert( + B, + ::bitcoin::EcdsaSig { + sig: sig_b.into(), + hash_ty: EcdsaSighashType::All, + }, + ); satisfier }; diff --git a/swap/src/bitcoin/wallet.rs b/swap/src/bitcoin/wallet.rs index cf1530d1..2e5732f8 100644 --- a/swap/src/bitcoin/wallet.rs +++ b/swap/src/bitcoin/wallet.rs @@ -54,7 +54,7 @@ impl Wallet { ) -> Result { let data_dir = data_dir.as_ref(); let wallet_dir = data_dir.join(WALLET); - let database = bdk::sled::open(&wallet_dir)?.open_tree(SLED_TREE_NAME)?; + let database = bdk::sled::open(wallet_dir)?.open_tree(SLED_TREE_NAME)?; let network = env_config.bitcoin_network; let wallet = match bdk::Wallet::new( @@ -97,7 +97,7 @@ impl Wallet { std::fs::rename(from, to)?; let wallet_dir = data_dir.join(WALLET); - let database = bdk::sled::open(&wallet_dir)?.open_tree(SLED_TREE_NAME)?; + let database = bdk::sled::open(wallet_dir)?.open_tree(SLED_TREE_NAME)?; let wallet = bdk::Wallet::new( bdk::template::Bip84(xprivkey, KeychainKind::External), @@ -738,12 +738,15 @@ impl Client { let client = bdk::electrum_client::Client::new(electrum_rpc_url.as_str()) .context("Failed to initialize Electrum RPC client")?; let blockchain = ElectrumBlockchain::from(client); + let last_sync = Instant::now() + .checked_sub(interval) + .expect("no underflow since block time is only 600 secs"); Ok(Self { electrum, blockchain, latest_block_height: BlockHeight::try_from(latest_block)?, - last_sync: Instant::now() - interval, + last_sync, sync_interval: interval, script_history: Default::default(), subscriptions: Default::default(), @@ -758,9 +761,10 @@ impl Client { self.blockchain.get_tx(txid) } - fn update_state(&mut self) -> Result<()> { + fn update_state(&mut self, force_sync: bool) -> Result<()> { let now = Instant::now(); - if now < self.last_sync + self.sync_interval { + + if !force_sync && now < self.last_sync + self.sync_interval { return Ok(()); } @@ -780,9 +784,14 @@ impl Client { if !self.script_history.contains_key(&script) { self.script_history.insert(script.clone(), vec![]); - } - self.update_state()?; + // When we first subscribe to a script we want to immediately fetch its status + // Otherwise we would have to wait for the next sync interval, which can take a minute + // This would result in potentially inaccurate status updates until that next sync interval is hit + self.update_state(true)?; + } else { + self.update_state(false)?; + } let history = self.script_history.entry(script).or_default(); diff --git a/swap/src/cli.rs b/swap/src/cli.rs index c98634d2..f0faf146 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -15,6 +15,7 @@ pub use list_sellers::{list_sellers, Seller, Status as SellerStatus}; mod tests { use super::*; use crate::asb; + use crate::asb::rendezvous::RendezvousNode; use crate::cli::list_sellers::{Seller, Status}; use crate::network::quote; use crate::network::quote::BidQuote; @@ -33,10 +34,8 @@ mod tests { async fn list_sellers_should_report_all_registered_asbs_with_a_quote() { let namespace = XmrBtcNamespace::Mainnet; let (rendezvous_address, rendezvous_peer_id) = setup_rendezvous_point().await; - let expected_seller_1 = - setup_asb(rendezvous_peer_id, rendezvous_address.clone(), namespace).await; - let expected_seller_2 = - setup_asb(rendezvous_peer_id, rendezvous_address.clone(), namespace).await; + let expected_seller_1 = setup_asb(rendezvous_peer_id, &rendezvous_address, namespace).await; + let expected_seller_2 = setup_asb(rendezvous_peer_id, &rendezvous_address, namespace).await; let list_sellers = list_sellers( rendezvous_peer_id, @@ -72,7 +71,7 @@ mod tests { async fn setup_asb( rendezvous_peer_id: PeerId, - rendezvous_address: Multiaddr, + rendezvous_address: &Multiaddr, namespace: XmrBtcNamespace, ) -> Seller { let static_quote = BidQuote { @@ -81,18 +80,18 @@ mod tests { max_quantity: bitcoin::Amount::from_sat(9001), }; - let mut asb = new_swarm(|_, identity| StaticQuoteAsbBehaviour { - rendezvous: asb::rendezous::Behaviour::new( - identity, - rendezvous_peer_id, - rendezvous_address, - namespace, - None, - ), - ping: Default::default(), - quote: quote::asb(), - static_quote, - registered: false, + let mut asb = new_swarm(|_, identity| { + let rendezvous_node = + RendezvousNode::new(rendezvous_address, rendezvous_peer_id, namespace, None); + let rendezvous = asb::rendezvous::Behaviour::new(identity, vec![rendezvous_node]); + + StaticQuoteAsbBehaviour { + rendezvous, + ping: Default::default(), + quote: quote::asb(), + static_quote, + registered: false, + } }); let asb_address = asb.listen_on_tcp_localhost().await; @@ -121,7 +120,7 @@ mod tests { #[derive(libp2p::NetworkBehaviour)] #[behaviour(event_process = true)] struct StaticQuoteAsbBehaviour { - rendezvous: asb::rendezous::Behaviour, + rendezvous: asb::rendezvous::Behaviour, // Support `Ping` as a workaround until https://github.com/libp2p/rust-libp2p/issues/2109 is fixed. ping: libp2p::ping::Ping, quote: quote::Behaviour, diff --git a/swap/src/cli/command.rs b/swap/src/cli/command.rs index e4da8e7d..5c3b2827 100644 --- a/swap/src/cli/command.rs +++ b/swap/src/cli/command.rs @@ -14,10 +14,6 @@ use structopt::{clap, StructOpt}; use url::Url; use uuid::Uuid; -// See: https://moneroworld.com/ -pub const DEFAULT_MONERO_DAEMON_ADDRESS: &str = "node.community.rino.io:18081"; -pub const DEFAULT_MONERO_DAEMON_ADDRESS_STAGENET: &str = "stagenet.community.rino.io:38081"; - // See: https://1209k.com/bitcoin-eye/ele.php?chain=btc const DEFAULT_ELECTRUM_RPC_URL: &str = "ssl://blockstream.info:700"; // See: https://1209k.com/bitcoin-eye/ele.php?chain=tbtc @@ -80,11 +76,11 @@ where } => { let (bitcoin_electrum_rpc_url, bitcoin_target_block) = bitcoin.apply_defaults(is_testnet)?; - let monero_daemon_address = monero.apply_defaults(is_testnet); let monero_receive_address = validate_monero_address(monero_receive_address, is_testnet)?; let bitcoin_change_address = validate_bitcoin_address(bitcoin_change_address, is_testnet)?; + let monero_daemon_address = monero.monero_daemon_address; Arguments { env_config: env_config_from(is_testnet), @@ -167,7 +163,7 @@ where } => { let (bitcoin_electrum_rpc_url, bitcoin_target_block) = bitcoin.apply_defaults(is_testnet)?; - let monero_daemon_address = monero.apply_defaults(is_testnet); + let monero_daemon_address = monero.monero_daemon_address; Arguments { env_config: env_config_from(is_testnet), @@ -254,7 +250,7 @@ pub enum Command { bitcoin_target_block: usize, bitcoin_change_address: bitcoin::Address, monero_receive_address: monero::Address, - monero_daemon_address: String, + monero_daemon_address: Option, tor_socks5_port: u16, namespace: XmrBtcNamespace, }, @@ -274,7 +270,7 @@ pub enum Command { swap_id: Uuid, bitcoin_electrum_rpc_url: Url, bitcoin_target_block: usize, - monero_daemon_address: String, + monero_daemon_address: Option, tor_socks5_port: u16, namespace: XmrBtcNamespace, }, @@ -302,7 +298,7 @@ pub enum Command { name = "swap", about = "CLI for swapping BTC for XMR", author, - version = env!("VERGEN_GIT_SEMVER_LIGHTWEIGHT") + version = env!("VERGEN_GIT_DESCRIBE") )] struct RawArguments { // global is necessary to ensure that clap can match against testnet in subcommands @@ -436,23 +432,11 @@ enum RawCommand { struct Monero { #[structopt( long = "monero-daemon-address", - help = "Specify to connect to a monero daemon of your choice: :" + help = "Specify to connect to a monero daemon of your choice: :. If none is specified, we will connect to a public node." )] monero_daemon_address: Option, } -impl Monero { - fn apply_defaults(self, testnet: bool) -> String { - if let Some(address) = self.monero_daemon_address { - address - } else if testnet { - DEFAULT_MONERO_DAEMON_ADDRESS_STAGENET.to_string() - } else { - DEFAULT_MONERO_DAEMON_ADDRESS.to_string() - } - } -} - #[derive(structopt::StructOpt, Debug)] struct Bitcoin { #[structopt(long = "electrum-rpc", help = "Provide the Bitcoin Electrum RPC URL")] @@ -1174,7 +1158,7 @@ mod tests { bitcoin_change_address: BITCOIN_TESTNET_ADDRESS.parse().unwrap(), monero_receive_address: monero::Address::from_str(MONERO_STAGENET_ADDRESS) .unwrap(), - monero_daemon_address: DEFAULT_MONERO_DAEMON_ADDRESS_STAGENET.to_string(), + monero_daemon_address: None, tor_socks5_port: DEFAULT_SOCKS5_PORT, namespace: XmrBtcNamespace::Testnet, }, @@ -1194,7 +1178,7 @@ mod tests { bitcoin_change_address: BITCOIN_MAINNET_ADDRESS.parse().unwrap(), monero_receive_address: monero::Address::from_str(MONERO_MAINNET_ADDRESS) .unwrap(), - monero_daemon_address: DEFAULT_MONERO_DAEMON_ADDRESS.to_string(), + monero_daemon_address: None, tor_socks5_port: DEFAULT_SOCKS5_PORT, namespace: XmrBtcNamespace::Mainnet, }, @@ -1212,7 +1196,7 @@ mod tests { bitcoin_electrum_rpc_url: Url::from_str(DEFAULT_ELECTRUM_RPC_URL_TESTNET) .unwrap(), bitcoin_target_block: DEFAULT_BITCOIN_CONFIRMATION_TARGET_TESTNET, - monero_daemon_address: DEFAULT_MONERO_DAEMON_ADDRESS_STAGENET.to_string(), + monero_daemon_address: None, tor_socks5_port: DEFAULT_SOCKS5_PORT, namespace: XmrBtcNamespace::Testnet, }, @@ -1229,7 +1213,7 @@ mod tests { swap_id: Uuid::from_str(SWAP_ID).unwrap(), bitcoin_electrum_rpc_url: Url::from_str(DEFAULT_ELECTRUM_RPC_URL).unwrap(), bitcoin_target_block: DEFAULT_BITCOIN_CONFIRMATION_TARGET, - monero_daemon_address: DEFAULT_MONERO_DAEMON_ADDRESS.to_string(), + monero_daemon_address: None, tor_socks5_port: DEFAULT_SOCKS5_PORT, namespace: XmrBtcNamespace::Mainnet, }, diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 95a52386..381c561f 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -350,23 +350,26 @@ mod tests { list.sort(); - assert_eq!(list, vec![ - Seller { - multiaddr: "/ip4/127.0.0.1/tcp/5678".parse().unwrap(), - status: Status::Online(BidQuote { - price: Default::default(), - min_quantity: Default::default(), - max_quantity: Default::default(), - }) - }, - Seller { - multiaddr: Multiaddr::empty(), - status: Status::Unreachable - }, - Seller { - multiaddr: "/ip4/127.0.0.1/tcp/1234".parse().unwrap(), - status: Status::Unreachable - }, - ]) + assert_eq!( + list, + vec![ + Seller { + multiaddr: "/ip4/127.0.0.1/tcp/5678".parse().unwrap(), + status: Status::Online(BidQuote { + price: Default::default(), + min_quantity: Default::default(), + max_quantity: Default::default(), + }) + }, + Seller { + multiaddr: Multiaddr::empty(), + status: Status::Unreachable + }, + Seller { + multiaddr: "/ip4/127.0.0.1/tcp/1234".parse().unwrap(), + status: Status::Unreachable + }, + ] + ) } } diff --git a/swap/src/env.rs b/swap/src/env.rs index a80d402d..1ba8c432 100644 --- a/swap/src/env.rs +++ b/swap/src/env.rs @@ -46,7 +46,7 @@ pub struct Regtest; impl GetConfig for Mainnet { fn get_config() -> Config { Config { - bitcoin_lock_mempool_timeout: 3.std_minutes(), + bitcoin_lock_mempool_timeout: 10.std_minutes(), bitcoin_lock_confirmed_timeout: 2.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), @@ -63,7 +63,7 @@ impl GetConfig for Mainnet { impl GetConfig for Testnet { fn get_config() -> Config { Config { - bitcoin_lock_mempool_timeout: 3.std_minutes(), + bitcoin_lock_mempool_timeout: 10.std_minutes(), bitcoin_lock_confirmed_timeout: 1.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), diff --git a/swap/src/monero/wallet.rs b/swap/src/monero/wallet.rs index a66a18e9..95bb6323 100644 --- a/swap/src/monero/wallet.rs +++ b/swap/src/monero/wallet.rs @@ -174,11 +174,6 @@ impl Wallet { pub async fn transfer(&self, request: TransferRequest) -> Result { let inner = self.inner.lock().await; - inner - .open_wallet(self.name.clone()) - .await - .with_context(|| format!("Failed to open wallet {}", self.name))?; - let TransferRequest { public_spend_key, public_view_key, diff --git a/swap/src/monero/wallet_rpc.rs b/swap/src/monero/wallet_rpc.rs index 819eeccb..e44d800e 100644 --- a/swap/src/monero/wallet_rpc.rs +++ b/swap/src/monero/wallet_rpc.rs @@ -1,19 +1,45 @@ use ::monero::Network; -use anyhow::{Context, Result}; +use anyhow::{bail, Context, Error, Result}; use big_bytes::BigByte; use futures::{StreamExt, TryStreamExt}; use monero_rpc::wallet::{Client, MoneroWalletRpc as _}; use reqwest::header::CONTENT_LENGTH; use reqwest::Url; +use serde::Deserialize; +use std::fmt; +use std::fmt::{Debug, Display, Formatter}; use std::io::ErrorKind; use std::path::{Path, PathBuf}; use std::process::Stdio; +use std::time::Duration; use tokio::fs::{remove_file, OpenOptions}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::process::{Child, Command}; use tokio_util::codec::{BytesCodec, FramedRead}; use tokio_util::io::StreamReader; +// See: https://www.moneroworld.com/#nodes, https://monero.fail +// We don't need any testnet nodes because we don't support testnet at all +const MONERO_DAEMONS: [MoneroDaemon; 17] = [ + MoneroDaemon::new("xmr-node.cakewallet.com", 18081, Network::Mainnet), + MoneroDaemon::new("nodex.monerujo.io", 18081, Network::Mainnet), + MoneroDaemon::new("node.moneroworld.com", 18089, Network::Mainnet), + MoneroDaemon::new("nodes.hashvault.pro", 18081, Network::Mainnet), + MoneroDaemon::new("p2pmd.xmrvsbeast.com", 18081, Network::Mainnet), + MoneroDaemon::new("node.monerodevs.org", 18089, Network::Mainnet), + MoneroDaemon::new("xmr-node-usa-east.cakewallet.com", 18081, Network::Mainnet), + MoneroDaemon::new("xmr-node-uk.cakewallet.com", 18081, Network::Mainnet), + MoneroDaemon::new("node.community.rino.io", 18081, Network::Mainnet), + MoneroDaemon::new("testingjohnross.com", 20031, Network::Mainnet), + MoneroDaemon::new("xmr.litepay.ch", 18081, Network::Mainnet), + MoneroDaemon::new("node.trocador.app", 18089, Network::Mainnet), + MoneroDaemon::new("stagenet.xmr-tw.org", 38081, Network::Stagenet), + MoneroDaemon::new("node.monerodevs.org", 38089, Network::Stagenet), + MoneroDaemon::new("singapore.node.xmr.pm", 38081, Network::Stagenet), + MoneroDaemon::new("xmr-lux.boldsuck.org", 38081, Network::Stagenet), + MoneroDaemon::new("stagenet.community.rino.io", 38081, Network::Stagenet), +]; + #[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))] compile_error!("unsupported operating system"); @@ -50,6 +76,91 @@ pub struct WalletRpcProcess { port: u16, } +struct MoneroDaemon { + address: &'static str, + port: u16, + network: Network, +} + +impl MoneroDaemon { + const fn new(address: &'static str, port: u16, network: Network) -> Self { + Self { + address, + port, + network, + } + } + + /// Checks if the Monero daemon is available by sending a request to its `get_info` endpoint. + async fn is_available(&self, client: &reqwest::Client) -> Result { + let url = format!("http://{}:{}/get_info", self.address, self.port); + let res = client + .get(url) + .send() + .await + .context("Failed to send request to get_info endpoint")?; + + let json: MoneroDaemonGetInfoResponse = res + .json() + .await + .context("Failed to deserialize daemon get_info response")?; + + let is_status_ok = json.status == "OK"; + let is_synchronized = json.synchronized; + let is_correct_network = match self.network { + Network::Mainnet => json.mainnet, + Network::Stagenet => json.stagenet, + Network::Testnet => json.testnet, + }; + + Ok(is_status_ok && is_synchronized && is_correct_network) + } +} + +impl Display for MoneroDaemon { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "{}:{}", self.address, self.port) + } +} + +#[derive(Deserialize)] +struct MoneroDaemonGetInfoResponse { + status: String, + synchronized: bool, + mainnet: bool, + stagenet: bool, + testnet: bool, +} + +/// Chooses an available Monero daemon based on the specified network. +async fn choose_monero_daemon(network: Network) -> Result<&'static MoneroDaemon, Error> { + let client = reqwest::Client::builder() + .timeout(Duration::from_secs(30)) + .https_only(false) + .build()?; + + // We only want to check for daemons that match the specified network + let network_matching_daemons = MONERO_DAEMONS + .iter() + .filter(|daemon| daemon.network == network); + + for daemon in network_matching_daemons { + match daemon.is_available(&client).await { + Ok(true) => { + tracing::debug!(%daemon, "Found available Monero daemon"); + return Ok(daemon); + } + Err(err) => { + tracing::debug!(%err, %daemon, "Failed to connect to Monero daemon"); + continue; + } + Ok(false) => continue, + } + } + + bail!("No Monero daemon could be found. Please specify one manually or try again later.") +} + impl WalletRpcProcess { pub fn endpoint(&self) -> Url { Url::parse(&format!("http://127.0.0.1:{}/json_rpc", self.port)) @@ -153,13 +264,23 @@ impl WalletRpc { Ok(monero_wallet_rpc) } - pub async fn run(&self, network: Network, daemon_address: &str) -> Result { + pub async fn run( + &self, + network: Network, + daemon_address: Option, + ) -> Result { let port = tokio::net::TcpListener::bind("127.0.0.1:0") .await? .local_addr()? .port(); + let daemon_address = match daemon_address { + Some(daemon_address) => daemon_address, + None => choose_monero_daemon(network).await?.to_string(), + }; + tracing::debug!( + %daemon_address, %port, "Starting monero-wallet-rpc" ); @@ -232,7 +353,6 @@ impl WalletRpc { #[cfg(not(target_os = "windows"))] async fn extract_archive(monero_wallet_rpc: &Self) -> Result<()> { - use anyhow::bail; use tokio_tar::Archive; let mut options = OpenOptions::new(); @@ -297,3 +417,123 @@ impl WalletRpc { Ok(()) } } + +#[cfg(test)] +mod tests { + use super::*; + + fn extract_host_and_port(address: String) -> (&'static str, u16) { + let parts: Vec<&str> = address.split(':').collect(); + + if parts.len() == 2 { + let host = parts[0].to_string(); + let port = parts[1].parse::().unwrap(); + let static_str_host: &'static str = Box::leak(host.into_boxed_str()); + return (static_str_host, port); + } + panic!("Could not extract host and port from address: {}", address) + } + + #[tokio::test] + async fn test_is_daemon_available_success() { + let mut server = mockito::Server::new(); + + let _ = server + .mock("GET", "/get_info") + .with_status(200) + .with_body( + r#" + { + "status": "OK", + "synchronized": true, + "mainnet": true, + "stagenet": false, + "testnet": false + } + "#, + ) + .create(); + + let (host, port) = extract_host_and_port(server.host_with_port()); + + let client = reqwest::Client::new(); + let result = MoneroDaemon::new(host, port, Network::Mainnet) + .is_available(&client) + .await; + + assert!(result.is_ok()); + assert!(result.unwrap()); + } + + #[tokio::test] + async fn test_is_daemon_available_wrong_network_failure() { + let mut server = mockito::Server::new(); + + let _ = server + .mock("GET", "/get_info") + .with_status(200) + .with_body( + r#" + { + "status": "OK", + "synchronized": true, + "mainnet": true, + "stagenet": false, + "testnet": false + } + "#, + ) + .create(); + + let (host, port) = extract_host_and_port(server.host_with_port()); + + let client = reqwest::Client::new(); + let result = MoneroDaemon::new(host, port, Network::Stagenet) + .is_available(&client) + .await; + + assert!(result.is_ok()); + assert!(!result.unwrap()); + } + + #[tokio::test] + async fn test_is_daemon_available_not_synced_failure() { + let mut server = mockito::Server::new(); + + let _ = server + .mock("GET", "/get_info") + .with_status(200) + .with_body( + r#" + { + "status": "OK", + "synchronized": false, + "mainnet": true, + "stagenet": false, + "testnet": false + } + "#, + ) + .create(); + + let (host, port) = extract_host_and_port(server.host_with_port()); + + let client = reqwest::Client::new(); + let result = MoneroDaemon::new(host, port, Network::Mainnet) + .is_available(&client) + .await; + + assert!(result.is_ok()); + assert!(!result.unwrap()); + } + + #[tokio::test] + async fn test_is_daemon_available_network_error_failure() { + let client = reqwest::Client::new(); + let result = MoneroDaemon::new("does.not.exist.com", 18081, Network::Mainnet) + .is_available(&client) + .await; + + assert!(result.is_err()); + } +} diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 18972319..bee70c24 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -155,13 +155,16 @@ impl ProtocolsHandler for Handler { let env_config = self.env_config; let protocol = tokio::time::timeout(self.timeout, async move { - write_cbor_message(&mut substream, SpotPriceRequest { - btc: info.btc, - blockchain_network: BlockchainNetwork { - bitcoin: env_config.bitcoin_network, - monero: env_config.monero_network, + write_cbor_message( + &mut substream, + SpotPriceRequest { + btc: info.btc, + blockchain_network: BlockchainNetwork { + bitcoin: env_config.bitcoin_network, + monero: env_config.monero_network, + }, }, - }) + ) .await?; let xmr = Result::from(read_cbor_message::(&mut substream).await?)?; diff --git a/swap/src/network/swarm.rs b/swap/src/network/swarm.rs index 21bbfc4d..37bb0a5e 100644 --- a/swap/src/network/swarm.rs +++ b/swap/src/network/swarm.rs @@ -1,9 +1,9 @@ -use crate::asb::LatestRate; +use crate::asb::{LatestRate, RendezvousNode}; use crate::libp2p_ext::MultiAddrExt; use crate::network::rendezvous::XmrBtcNamespace; use crate::seed::Seed; use crate::{asb, bitcoin, cli, env, tor}; -use anyhow::{Context, Result}; +use anyhow::Result; use libp2p::swarm::{NetworkBehaviour, SwarmBuilder}; use libp2p::{identity, Multiaddr, Swarm}; use std::fmt::Debug; @@ -17,22 +17,23 @@ pub fn asb( resume_only: bool, env_config: env::Config, namespace: XmrBtcNamespace, - rendezvous_point: Option, + rendezvous_addrs: &[Multiaddr], ) -> Result>> where LR: LatestRate + Send + 'static + Debug + Clone, { let identity = seed.derive_libp2p_identity(); - let rendezvous_params = if let Some(address) = rendezvous_point { - let peer_id = address - .extract_peer_id() - .context("Rendezvous node address must contain peer ID")?; + let rendezvous_nodes = rendezvous_addrs + .iter() + .map(|addr| { + let peer_id = addr + .extract_peer_id() + .expect("Rendezvous node address must contain peer ID"); - Some((identity.clone(), peer_id, address, namespace)) - } else { - None - }; + RendezvousNode::new(addr, peer_id, namespace, None) + }) + .collect(); let behaviour = asb::Behaviour::new( min_buy, @@ -41,7 +42,7 @@ where resume_only, env_config, (identity.clone(), namespace), - rendezvous_params, + rendezvous_nodes, ); let transport = asb::transport::new(&identity)?; diff --git a/swap/src/network/test.rs b/swap/src/network/test.rs index da5bac77..a5c316b1 100644 --- a/swap/src/network/test.rs +++ b/swap/src/network/test.rs @@ -21,7 +21,7 @@ struct GlobalSpawnTokioExecutor; impl Executor for GlobalSpawnTokioExecutor { fn exec(&self, future: Pin + Send>>) { - let _ = tokio::spawn(future); + tokio::spawn(future); } } diff --git a/swap/src/protocol/alice/state.rs b/swap/src/protocol/alice/state.rs index 9dcf3f46..b34e0326 100644 --- a/swap/src/protocol/alice/state.rs +++ b/swap/src/protocol/alice/state.rs @@ -184,29 +184,32 @@ impl State0 { let v = self.v_a + msg.v_b; - Ok((msg.swap_id, State1 { - a: self.a, - B: msg.B, - s_a: self.s_a, - S_a_monero: self.S_a_monero, - S_a_bitcoin: self.S_a_bitcoin, - S_b_monero: msg.S_b_monero, - S_b_bitcoin: msg.S_b_bitcoin, - v, - v_a: self.v_a, - dleq_proof_s_a: self.dleq_proof_s_a, - btc: self.btc, - xmr: self.xmr, - cancel_timelock: self.cancel_timelock, - punish_timelock: self.punish_timelock, - refund_address: msg.refund_address, - redeem_address: self.redeem_address, - punish_address: self.punish_address, - tx_redeem_fee: self.tx_redeem_fee, - tx_punish_fee: self.tx_punish_fee, - tx_refund_fee: msg.tx_refund_fee, - tx_cancel_fee: msg.tx_cancel_fee, - })) + Ok(( + msg.swap_id, + State1 { + a: self.a, + B: msg.B, + s_a: self.s_a, + S_a_monero: self.S_a_monero, + S_a_bitcoin: self.S_a_bitcoin, + S_b_monero: msg.S_b_monero, + S_b_bitcoin: msg.S_b_bitcoin, + v, + v_a: self.v_a, + dleq_proof_s_a: self.dleq_proof_s_a, + btc: self.btc, + xmr: self.xmr, + cancel_timelock: self.cancel_timelock, + punish_timelock: self.punish_timelock, + refund_address: msg.refund_address, + redeem_address: self.redeem_address, + punish_address: self.punish_address, + tx_redeem_fee: self.tx_redeem_fee, + tx_punish_fee: self.tx_punish_fee, + tx_refund_fee: msg.tx_refund_fee, + tx_cancel_fee: msg.tx_cancel_fee, + }, + )) } } diff --git a/swap/src/seed.rs b/swap/src/seed.rs index 9e34c2db..5ffe9124 100644 --- a/swap/src/seed.rs +++ b/swap/src/seed.rs @@ -61,7 +61,7 @@ impl Seed { let file_path = Path::new(&file_path_buf); if file_path.exists() { - return Self::from_file(&file_path); + return Self::from_file(file_path); } tracing::debug!("No seed file found, creating at {}", file_path.display()); @@ -106,11 +106,12 @@ impl Seed { } fn from_pem(pem: pem::Pem) -> Result { - if pem.contents.len() != SEED_LENGTH { - Err(Error::IncorrectLength(pem.contents.len())) + let contents = pem.contents(); + if contents.len() != SEED_LENGTH { + Err(Error::IncorrectLength(contents.len())) } else { let mut array = [0; SEED_LENGTH]; - for (i, b) in pem.contents.iter().enumerate() { + for (i, b) in contents.iter().enumerate() { array[i] = *b; } @@ -122,10 +123,7 @@ impl Seed { ensure_directory_exists(&seed_file)?; let data = self.bytes(); - let pem = Pem { - tag: String::from("SEED"), - contents: data.to_vec(), - }; + let pem = Pem::new("SEED", data); let pem_string = encode(&pem); @@ -187,6 +185,9 @@ mod tests { #[test] fn seed_from_pem_works() { + use base64::engine::general_purpose; + use base64::Engine; + let payload: &str = "syl9wSYaruvgxg9P5Q1qkZaq5YkM6GvXkxe+VYrL/XM="; // 32 bytes base64 encoded. @@ -195,7 +196,7 @@ syl9wSYaruvgxg9P5Q1qkZaq5YkM6GvXkxe+VYrL/XM= -----END SEED----- "; - let want = base64::decode(payload).unwrap(); + let want = general_purpose::STANDARD.decode(payload).unwrap(); let pem = pem::parse(pem_string).unwrap(); let got = Seed::from_pem(pem).unwrap(); @@ -221,19 +222,20 @@ VnZUNFZ4dlY= } #[test] - #[should_panic] fn seed_from_pem_fails_for_long_seed() { let long = "-----BEGIN SEED----- -mbKANv2qKGmNVg1qtquj6Hx1pFPelpqOfE2JaJJAMEg1FlFhNRNlFlE= -mbKANv2qKGmNVg1qtquj6Hx1pFPelpqOfE2JaJJAMEg1FlFhNRNlFlE= +MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc +dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO -----END SEED----- "; let pem = pem::parse(long).unwrap(); + assert_eq!(pem.contents().len(), 96); + match Seed::from_pem(pem) { Ok(_) => panic!("should fail for long payload"), Err(e) => { match e { - Error::IncorrectLength(_) => {} // pass + Error::IncorrectLength(len) => assert_eq!(len, 96), // pass _ => panic!("should fail with IncorrectLength error"), } } diff --git a/swap/tests/ensure_same_swap_id.rs b/swap/tests/ensure_same_swap_id.rs index 48758ecd..28f09823 100644 --- a/swap/tests/ensure_same_swap_id.rs +++ b/swap/tests/ensure_same_swap_id.rs @@ -8,7 +8,7 @@ async fn ensure_same_swap_id_for_alice_and_bob() { harness::setup_test(SlowCancelConfig, |mut ctx| async move { let (bob_swap, _) = ctx.bob_swap().await; let bob_swap_id = bob_swap.id; - let _ = tokio::spawn(bob::run(bob_swap)); + tokio::spawn(bob::run(bob_swap)); // once Bob's swap is spawned we can retrieve Alice's swap and assert on the // swap ID diff --git a/swap/tests/harness/bitcoind.rs b/swap/tests/harness/bitcoind.rs index 13aa5658..fc70161b 100644 --- a/swap/tests/harness/bitcoind.rs +++ b/swap/tests/harness/bitcoind.rs @@ -1,6 +1,5 @@ -use std::collections::HashMap; -use testcontainers::core::{Container, Docker, WaitForMessage}; -use testcontainers::Image; +use std::collections::BTreeMap; +use testcontainers::{core::WaitFor, Image, ImageArgs}; pub const RPC_USER: &str = "admin"; pub const RPC_PASSWORD: &str = "123"; @@ -10,57 +9,27 @@ pub const DATADIR: &str = "/home/bdk"; #[derive(Debug)] pub struct Bitcoind { - args: BitcoindArgs, entrypoint: Option, - volume: Option, + volumes: BTreeMap, } impl Image for Bitcoind { type Args = BitcoindArgs; - type EnvVars = HashMap; - type Volumes = HashMap; - type EntryPoint = str; - fn descriptor(&self) -> String { - "coblox/bitcoin-core:0.21.0".to_string() + fn name(&self) -> String { + "coblox/bitcoin-core".into() } - fn wait_until_ready(&self, container: &Container<'_, D, Self>) { - container - .logs() - .stdout - .wait_for_message("init message: Done loading") - .unwrap(); + fn tag(&self) -> String { + "0.21.0".into() } - fn args(&self) -> ::Args { - self.args.clone() + fn ready_conditions(&self) -> Vec { + vec![WaitFor::message_on_stdout("init message: Done loading")] } - fn volumes(&self) -> Self::Volumes { - let mut volumes = HashMap::new(); - match self.volume.clone() { - None => {} - Some(volume) => { - volumes.insert(volume, DATADIR.to_string()); - } - } - volumes - } - - fn env_vars(&self) -> Self::EnvVars { - HashMap::new() - } - - fn with_args(self, args: ::Args) -> Self { - Bitcoind { args, ..self } - } - - fn with_entrypoint(self, entrypoint: &Self::EntryPoint) -> Self { - Self { - entrypoint: Some(entrypoint.to_string()), - ..self - } + fn volumes(&self) -> Box + '_> { + Box::new(self.volumes.iter()) } fn entrypoint(&self) -> Option { @@ -71,16 +40,15 @@ impl Image for Bitcoind { impl Default for Bitcoind { fn default() -> Self { Bitcoind { - args: BitcoindArgs::default(), entrypoint: Some("/usr/bin/bitcoind".into()), - volume: None, + volumes: BTreeMap::default(), } } } impl Bitcoind { pub fn with_volume(mut self, volume: String) -> Self { - self.volume = Some(volume); + self.volumes.insert(volume, DATADIR.to_string()); self } } @@ -109,7 +77,6 @@ impl IntoIterator for BitcoindArgs { format!("-rpcuser={}", RPC_USER), format!("-rpcpassword={}", RPC_PASSWORD), "-printtoconsole".to_string(), - "-rest".to_string(), "-fallbackfee=0.0002".to_string(), format!("-datadir={}", DATADIR), format!("-rpcport={}", RPC_PORT), @@ -120,3 +87,9 @@ impl IntoIterator for BitcoindArgs { args.into_iter() } } + +impl ImageArgs for BitcoindArgs { + fn into_iterator(self) -> Box> { + Box::new(self.into_iter()) + } +} diff --git a/swap/tests/harness/electrs.rs b/swap/tests/harness/electrs.rs index 538fbf27..773a4e3a 100644 --- a/swap/tests/harness/electrs.rs +++ b/swap/tests/harness/electrs.rs @@ -1,8 +1,8 @@ +use std::collections::BTreeMap; + use crate::harness::bitcoind; use bitcoin::Network; -use std::collections::HashMap; -use testcontainers::core::{Container, Docker, WaitForMessage}; -use testcontainers::Image; +use testcontainers::{core::WaitFor, Image, ImageArgs}; pub const HTTP_PORT: u16 = 60401; pub const RPC_PORT: u16 = 3002; @@ -13,50 +13,25 @@ pub struct Electrs { args: ElectrsArgs, entrypoint: Option, wait_for_message: String, - volume: String, + volumes: BTreeMap, } impl Image for Electrs { type Args = ElectrsArgs; - type EnvVars = HashMap; - type Volumes = HashMap; - type EntryPoint = str; - - fn descriptor(&self) -> String { - format!("vulpemventures/electrs:{}", self.tag) - } - - fn wait_until_ready(&self, container: &Container<'_, D, Self>) { - container - .logs() - .stderr - .wait_for_message(&self.wait_for_message) - .unwrap(); + fn name(&self) -> String { + "vulpemventures/electrs".into() } - fn args(&self) -> ::Args { - self.args.clone() + fn tag(&self) -> String { + self.tag.clone() } - fn volumes(&self) -> Self::Volumes { - let mut volumes = HashMap::new(); - volumes.insert(self.volume.clone(), bitcoind::DATADIR.to_string()); - volumes + fn ready_conditions(&self) -> Vec { + vec![WaitFor::message_on_stderr(self.wait_for_message.clone())] } - fn env_vars(&self) -> Self::EnvVars { - HashMap::new() - } - - fn with_args(self, args: ::Args) -> Self { - Electrs { args, ..self } - } - - fn with_entrypoint(self, entrypoint: &Self::EntryPoint) -> Self { - Self { - entrypoint: Some(entrypoint.to_string()), - ..self - } + fn volumes(&self) -> Box + '_> { + Box::new(self.volumes.iter()) } fn entrypoint(&self) -> Option { @@ -71,7 +46,7 @@ impl Default for Electrs { args: ElectrsArgs::default(), entrypoint: Some("/build/electrs".into()), wait_for_message: "Running accept thread".to_string(), - volume: uuid::Uuid::new_v4().to_string(), + volumes: BTreeMap::default(), } } } @@ -85,7 +60,7 @@ impl Electrs { } pub fn with_volume(mut self, volume: String) -> Self { - self.volume = volume; + self.volumes.insert(volume, bitcoind::DATADIR.to_string()); self } @@ -93,6 +68,11 @@ impl Electrs { self.args.daemon_rpc_addr = name; self } + + pub fn self_and_args(self) -> (Self, ElectrsArgs) { + let args = self.args.clone(); + (self, args) + } } #[derive(Debug, Clone)] @@ -137,7 +117,7 @@ impl IntoIterator for ElectrsArgs { } args.push("-vvvvv".to_string()); - args.push(format!("--daemon-dir=={}", self.daemon_dir.as_str())); + args.push(format!("--daemon-dir={}", self.daemon_dir.as_str())); args.push(format!("--daemon-rpc-addr={}", self.daemon_rpc_addr)); args.push(format!("--cookie={}", self.cookie)); args.push(format!("--http-addr={}", self.http_addr)); @@ -147,3 +127,9 @@ impl IntoIterator for ElectrsArgs { args.into_iter() } } + +impl ImageArgs for ElectrsArgs { + fn into_iterator(self) -> Box> { + Box::new(self.into_iter()) + } +} diff --git a/swap/tests/harness/mod.rs b/swap/tests/harness/mod.rs index 74afcc83..bd039477 100644 --- a/swap/tests/harness/mod.rs +++ b/swap/tests/harness/mod.rs @@ -28,7 +28,7 @@ use swap::seed::Seed; use swap::{asb, bitcoin, cli, env, monero}; use tempfile::{tempdir, NamedTempFile}; use testcontainers::clients::Cli; -use testcontainers::{Container, Docker, RunArgs}; +use testcontainers::{Container, RunnableImage}; use tokio::sync::mpsc; use tokio::sync::mpsc::Receiver; use tokio::task::JoinHandle; @@ -61,10 +61,7 @@ where let alice_starting_balances = StartingBalances::new(bitcoin::Amount::ZERO, xmr_amount, Some(10)); - let electrs_rpc_port = containers - .electrs - .get_host_port(electrs::RPC_PORT) - .expect("Could not map electrs rpc port"); + let electrs_rpc_port = containers.electrs.get_host_port_ipv4(electrs::RPC_PORT); let alice_seed = Seed::random().unwrap(); let (alice_bitcoin_wallet, alice_monero_wallet) = init_test_wallets( @@ -146,25 +143,28 @@ where async fn init_containers(cli: &Cli) -> (Monero, Containers<'_>) { let prefix = random_prefix(); let bitcoind_name = format!("{}_{}", prefix, "bitcoind"); - let (bitcoind, bitcoind_url) = + let (_bitcoind, bitcoind_url, mapped_port) = init_bitcoind_container(cli, prefix.clone(), bitcoind_name.clone(), prefix.clone()) .await .expect("could not init bitcoind"); - let electrs = init_electrs_container(cli, prefix.clone(), bitcoind_name, prefix) + let electrs = init_electrs_container(cli, prefix.clone(), bitcoind_name, prefix, mapped_port) .await .expect("could not init electrs"); - let (monero, monerod_container, monero_wallet_rpc_containers) = + let (monero, _monerod_container, _monero_wallet_rpc_containers) = Monero::new(cli, vec![MONERO_WALLET_NAME_ALICE, MONERO_WALLET_NAME_BOB]) .await .unwrap(); - (monero, Containers { - bitcoind_url, - bitcoind, - monerod_container, - monero_wallet_rpc_containers, - electrs, - }) + ( + monero, + Containers { + bitcoind_url, + _bitcoind, + _monerod_container, + _monero_wallet_rpc_containers, + electrs, + }, + ) } async fn init_bitcoind_container( @@ -172,29 +172,28 @@ async fn init_bitcoind_container( volume: String, name: String, network: String, -) -> Result<(Container<'_, Cli, bitcoind::Bitcoind>, Url)> { +) -> Result<(Container<'_, bitcoind::Bitcoind>, Url, u16)> { let image = bitcoind::Bitcoind::default().with_volume(volume); + let image = RunnableImage::from(image) + .with_container_name(name) + .with_network(network); - let run_args = RunArgs::default().with_name(name).with_network(network); - - let docker = cli.run_with_args(image, run_args); - let a = docker - .get_host_port(bitcoind::RPC_PORT) - .context("Could not map bitcoind rpc port")?; + let docker = cli.run(image); + let port = docker.get_host_port_ipv4(bitcoind::RPC_PORT); let bitcoind_url = { let input = format!( "http://{}:{}@localhost:{}", bitcoind::RPC_USER, bitcoind::RPC_PASSWORD, - a + port ); Url::parse(&input).unwrap() }; init_bitcoind(bitcoind_url.clone(), 5).await?; - Ok((docker, bitcoind_url.clone())) + Ok((docker, bitcoind_url.clone(), bitcoind::RPC_PORT)) } pub async fn init_electrs_container( @@ -202,16 +201,18 @@ pub async fn init_electrs_container( volume: String, bitcoind_container_name: String, network: String, -) -> Result> { - let bitcoind_rpc_addr = format!("{}:{}", bitcoind_container_name, bitcoind::RPC_PORT); + port: u16, +) -> Result> { + let bitcoind_rpc_addr = format!("{}:{}", bitcoind_container_name, port); let image = electrs::Electrs::default() .with_volume(volume) .with_daemon_rpc_addr(bitcoind_rpc_addr) .with_tag("latest"); + let image = RunnableImage::from(image.self_and_args()) + .with_network(network.clone()) + .with_container_name(format!("{}_electrs", network)); - let run_args = RunArgs::default().with_network(network); - - let docker = cli.run_with_args(image, run_args); + let docker = cli.run(image); Ok(docker) } @@ -245,7 +246,7 @@ async fn start_alice( resume_only, env_config, XmrBtcNamespace::Testnet, - None, + &[], ) .unwrap(); swarm.listen_on(listen_address).unwrap(); @@ -925,7 +926,7 @@ async fn init_bitcoind(node_url: Url, spendable_quantity: u32) -> Result bitcoind_client .generatetoaddress(101 + spendable_quantity, reward_address.clone()) .await?; - let _ = tokio::spawn(mine(bitcoind_client.clone(), reward_address)); + tokio::spawn(mine(bitcoind_client.clone(), reward_address)); Ok(bitcoind_client) } @@ -949,13 +950,12 @@ pub async fn mint(node_url: Url, address: bitcoin::Address, amount: bitcoin::Amo } // This is just to keep the containers alive -#[allow(dead_code)] struct Containers<'a> { bitcoind_url: Url, - bitcoind: Container<'a, Cli, bitcoind::Bitcoind>, - monerod_container: Container<'a, Cli, image::Monerod>, - monero_wallet_rpc_containers: Vec>, - electrs: Container<'a, Cli, electrs::Electrs>, + _bitcoind: Container<'a, bitcoind::Bitcoind>, + _monerod_container: Container<'a, image::Monerod>, + _monero_wallet_rpc_containers: Vec>, + electrs: Container<'a, electrs::Electrs>, } pub mod alice_run_until {