diff --git a/CHANGELOG.md b/CHANGELOG.md index e094730e..40a1c801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Updated faucet optional deployment to use an empty transaction (#[182](https://github.com/0xMiden/miden-faucet/pull/182)). - Added a feature `tokio` for the `miden-pow-rate-limiter` crate ([#188](https://github.com/0xMiden/miden-faucet/pull/188).) - Added integration to import mint private notes directly to the wallet ([#189](https://github.com/0xMiden/miden-faucet/pull/189)). +- Added a new `miden-faucet-client` binary with the `mint` command ([#196](https://github.com/0xMiden/miden-faucet/pull/196)). ## 0.12.4 (2025-12-04) @@ -87,7 +88,7 @@ - Redesigned the home frontend ([#20](https://github.com/0xMiden/miden-faucet/pull/20)). - Redesigned the tokens request flows ([#25](https://github.com/0xMiden/miden-faucet/pull/25)). - Added faucet supply amounts to the metadata ([#30](https://github.com/0xMiden/miden-faucet/pull/30)). -- Added supply exceeded check ([#31](https://github.com/0xMiden/miden-faucet/pull/31)). +- Added supply exceeded check ([#31](https://github.com/0xMiden/miden-faucet/pull/31)). - Use HTTP 429 status code for rate limited error ([#51](https://github.com/0xMiden/miden-faucet/pull/51)). - Replace amount options validation for maximum claimable amount ([#52](https://github.com/0xMiden/miden-faucet/pull/52)). - Added `mdbook` documentation ([#61](https://github.com/0xMiden/miden-faucet/pull/61)). diff --git a/Cargo.lock b/Cargo.lock index a0e524da..5dc6797d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,13 +133,12 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e86f6d3dc9dc4352edeea6b8e499e13e3f5dc3b964d7ca5fd411415a3498473" +checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" dependencies = [ "compression-codecs", "compression-core", - "futures-core", "pin-project-lite", "tokio", ] @@ -152,7 +151,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -178,9 +177,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "axum" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b098575ebe77cb6d14fc7f32749631a6e44edbef6b796f89b020e99ba20d425" +checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" dependencies = [ "axum-core", "bytes", @@ -211,9 +210,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59446ce19cd142f8833f856eb31f3eb097812d1479ab224f54d72428ca21ea22" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ "bytes", "futures-core", @@ -262,7 +261,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -288,9 +287,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bech32" @@ -327,15 +326,16 @@ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "blake3" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", + "cpufeatures", ] [[package]] @@ -349,9 +349,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "bytemuck" @@ -373,9 +373,9 @@ checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.48" +version = "1.2.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c481bdbf0ed3b892f6f806287d72acd515b352a4ec27a208489b8c1bc839633a" +checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" dependencies = [ "find-msvc-tools", "jobserver", @@ -389,6 +389,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha20" version = "0.9.1" @@ -415,15 +421,15 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -439,9 +445,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.53" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" dependencies = [ "clap_builder", "clap_derive", @@ -449,9 +455,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.53" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" dependencies = [ "anstream", "anstyle", @@ -468,14 +474,14 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "clap_lex" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "colorchoice" @@ -485,9 +491,9 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "compression-codecs" -version = "0.4.33" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302266479cb963552d11bd042013a58ef1adc56768016c8b82b4199488f2d4ad" +checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" dependencies = [ "compression-core", "flate2", @@ -508,9 +514,9 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" [[package]] name = "cookie" @@ -658,7 +664,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -712,23 +718,23 @@ dependencies = [ [[package]] name = "derive_more" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -751,7 +757,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -946,9 +952,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" [[package]] name = "fixedbitset" @@ -958,9 +964,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.1.5" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" dependencies = [ "crc32fast", "miniz_oxide", @@ -1022,9 +1028,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "3.2.0" +version = "3.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d91fd049c123429b018c47887d3f75a265540dd3c30ba9cb7bae9197edb03a" +checksum = "baf68cef89750956493a66a10f512b9e58d9db21f2a573c079c0bdf1207a54a7" dependencies = [ "autocfg", ] @@ -1085,7 +1091,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1120,16 +1126,17 @@ dependencies = [ [[package]] name = "generator" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2" +checksum = "52f04ae4152da20c76fe800fa48659201d5cf627c5149ca0b707b69d7eef6cf9" dependencies = [ "cc", "cfg-if", "libc", "log", "rustversion", - "windows", + "windows-link", + "windows-result", ] [[package]] @@ -1145,9 +1152,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", @@ -1195,9 +1202,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", @@ -1365,6 +1372,23 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http 1.4.0", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + [[package]] name = "hyper-timeout" version = "0.5.2" @@ -1430,7 +1454,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core", ] [[package]] @@ -1514,9 +1538,9 @@ checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ "icu_collections 2.1.1", "icu_locale_core", @@ -1528,9 +1552,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" @@ -1572,7 +1596,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1626,9 +1650,9 @@ checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" [[package]] name = "indexmap" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -1657,9 +1681,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" dependencies = [ "memchr", "serde", @@ -1688,15 +1712,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jiff" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" +checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" dependencies = [ "jiff-static", "log", @@ -1707,13 +1731,13 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" +checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1728,9 +1752,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -1797,9 +1821,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.178" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libm" @@ -1879,7 +1903,7 @@ dependencies = [ "quote", "regex-syntax", "rustc_version 0.4.1", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1906,9 +1930,15 @@ dependencies = [ [[package]] name = "lru" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "matchers" @@ -1931,24 +1961,40 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "miden-agglayer" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" +dependencies = [ + "fs-err", + "miden-assembly", + "miden-core", + "miden-core-lib", + "miden-protocol", + "miden-standards", + "miden-utils-sync", + "regex", + "walkdir", +] + [[package]] name = "miden-air" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e663337017ed028dff8c18a0ce1db64aad0e850996e3214f137f98317533c2e1" +checksum = "3d819876b9e9b630e63152400e6df2a201668a9bdfd33d54d6806b9d7b992ff8" dependencies = [ "miden-core", "miden-utils-indexing", - "thiserror 2.0.17", + "thiserror 2.0.18", "winter-air", "winter-prover", ] [[package]] name = "miden-assembly" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001249195c227624695529c82ebf51c390ec1c28e99a567549ce3a272a2aedf3" +checksum = "24c6a18e29c03141cf9044604390a00691c7342924ec865b4acfdd560ff41ede" dependencies = [ "env_logger", "log", @@ -1956,14 +2002,14 @@ dependencies = [ "miden-core", "miden-mast-package", "smallvec", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "miden-assembly-syntax" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1963cfa667aa6a157c99982df340a7bd42b054652e6f33d5e3513217531eca73" +checksum = "7458ff670f5a514bf972aa84d6e1851a4c4e9afa351f53b71bdc2218b99254b6" dependencies = [ "aho-corasick", "env_logger", @@ -1980,22 +2026,22 @@ dependencies = [ "rustc_version 0.4.1", "semver 1.0.27", "smallvec", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "miden-block-prover" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "miden-protocol", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "miden-client" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-client?branch=next#d8dee63e64e7fc9223e7dbc51dbd4c2669e05b85" +source = "git+https://github.com/0xMiden/miden-client?branch=next#8adc8d193b223dacc7e0480a5c9ef4141129229b" dependencies = [ "anyhow", "async-trait", @@ -2015,7 +2061,7 @@ dependencies = [ "prost", "prost-types", "rand", - "thiserror 2.0.17", + "thiserror 2.0.18", "tonic", "tonic-health", "tonic-prost", @@ -2029,7 +2075,7 @@ dependencies = [ [[package]] name = "miden-client-sqlite-store" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-client?branch=next#d8dee63e64e7fc9223e7dbc51dbd4c2669e05b85" +source = "git+https://github.com/0xMiden/miden-client?branch=next#8adc8d193b223dacc7e0480a5c9ef4141129229b" dependencies = [ "anyhow", "async-trait", @@ -2040,15 +2086,15 @@ dependencies = [ "miden-protocol", "rusqlite", "rusqlite_migration", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] [[package]] name = "miden-core" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136debf5474190dc584df3252710dac07a0e45315740c9538a7fc0b72c596365" +checksum = "21a5c9c8c3d42ae8381ed49e47ff9ad2d2e345c4726761be36b7d4000ebb40ae" dependencies = [ "derive_more", "itertools", @@ -2061,16 +2107,16 @@ dependencies = [ "num-traits", "proptest", "proptest-derive", - "thiserror 2.0.17", + "thiserror 2.0.18", "winter-math", "winter-utils", ] [[package]] name = "miden-core-lib" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcec9fb9a256d2fae347162d9a94653a1790dd33b4af73ad29686475b63deb34" +checksum = "6556494ea5576803730fa15015bee6bd9d1a117450f22e7df0883421e7423674" dependencies = [ "env_logger", "fs-err", @@ -2080,14 +2126,14 @@ dependencies = [ "miden-processor", "miden-utils-sync", "sha2", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "miden-crypto" -version = "0.19.2" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7981c1d907bb9864e24f2bd6304c4fca03a41fc4606c09edd6a7f5a8fc80fc" +checksum = "f0b49de9b0d8370c992ee04791f68a4509078198b6f42e5f72a262e7d4456487" dependencies = [ "blake3", "cc", @@ -2104,13 +2150,13 @@ dependencies = [ "num-complex", "rand", "rand_chacha", - "rand_core 0.9.3", + "rand_core 0.9.5", "rand_hc", "rayon", "sha2", "sha3", "subtle", - "thiserror 2.0.17", + "thiserror 2.0.18", "winter-crypto", "winter-math", "winter-utils", @@ -2119,19 +2165,19 @@ dependencies = [ [[package]] name = "miden-crypto-derive" -version = "0.19.2" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83479e7af490784c6f2d2e02cec5210fd6e5bc6ce3d4427734e36a773bca72d2" +checksum = "16a27c656284ef1985c1af92b9e68d2171c7996d6c8c557a2c57d1ef32f107ed" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "miden-debug-types" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dc25083822c3d582c42ad10aeee0138dec15a130f3017b05495bb91e31fde4a" +checksum = "19123e896f24b575e69921a79a39a0a4babeb98404a8601017feb13b75d653b3" dependencies = [ "memchr", "miden-crypto", @@ -2141,8 +2187,8 @@ dependencies = [ "miden-utils-sync", "paste", "serde", - "serde_spanned 1.0.3", - "thiserror 2.0.17", + "serde_spanned 1.0.4", + "thiserror 2.0.18", ] [[package]] @@ -2173,7 +2219,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tokio-stream", "tonic", @@ -2187,6 +2233,26 @@ dependencies = [ "uuid", ] +[[package]] +name = "miden-faucet-client" +version = "0.13.0" +dependencies = [ + "anyhow", + "axum", + "clap", + "hex", + "miden-client", + "miden-faucet-lib", + "miden-pow-rate-limiter", + "rand", + "reqwest", + "serde", + "serde_json", + "thiserror 2.0.18", + "tokio", + "url", +] + [[package]] name = "miden-faucet-lib" version = "0.13.0" @@ -2195,7 +2261,8 @@ dependencies = [ "miden-client", "miden-client-sqlite-store", "rand", - "thiserror 2.0.17", + "serde", + "thiserror 2.0.18", "tokio", "tracing", "url", @@ -2213,14 +2280,14 @@ dependencies = [ [[package]] name = "miden-mast-package" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da35f2fc1eacbfd0b6b995e888c2b778bd646acebf34dab27f9f7ed9b3effaa2" +checksum = "f0d6a322b91efa1bb71e224395ca1fb9ca00e2614f89427e35d8c42a903868a3" dependencies = [ "derive_more", "miden-assembly-syntax", "miden-core", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -2246,10 +2313,10 @@ dependencies = [ "supports-color", "supports-hyperlinks", "supports-unicode", - "syn 2.0.111", + "syn 2.0.114", "terminal_size 0.3.0", "textwrap", - "thiserror 2.0.17", + "thiserror 2.0.18", "trybuild", "unicode-width 0.1.14", ] @@ -2262,22 +2329,22 @@ checksum = "86a905f3ea65634dd4d1041a4f0fd0a3e77aa4118341d265af1a94339182222f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "miden-node-grpc-error-macro" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-node?branch=next#34b15eca26d7ab04d45394d1be06d65b3b52c626" +source = "git+https://github.com/0xMiden/miden-node?branch=next#a64cc317c862698d87dc615e36173718180df013" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "miden-node-proto" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-node?branch=next#34b15eca26d7ab04d45394d1be06d65b3b52c626" +source = "git+https://github.com/0xMiden/miden-node?branch=next#a64cc317c862698d87dc615e36173718180df013" dependencies = [ "anyhow", "fs-err", @@ -2289,7 +2356,7 @@ dependencies = [ "miden-protocol", "miette", "prost", - "thiserror 2.0.17", + "thiserror 2.0.18", "tonic", "tonic-prost", "tonic-prost-build", @@ -2299,7 +2366,7 @@ dependencies = [ [[package]] name = "miden-node-proto-build" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-node?branch=next#77471e2232c102e9e57099da3f8557aeece55917" +source = "git+https://github.com/0xMiden/miden-node?branch=next#a64cc317c862698d87dc615e36173718180df013" dependencies = [ "fs-err", "miette", @@ -2310,7 +2377,7 @@ dependencies = [ [[package]] name = "miden-node-utils" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-node?branch=next#34b15eca26d7ab04d45394d1be06d65b3b52c626" +source = "git+https://github.com/0xMiden/miden-node?branch=next#a64cc317c862698d87dc615e36173718180df013" dependencies = [ "anyhow", "bytes", @@ -2326,7 +2393,7 @@ dependencies = [ "opentelemetry_sdk", "rand", "serde", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tonic", "tower-http", @@ -2353,15 +2420,15 @@ version = "0.13.0" dependencies = [ "serde_json", "sha2", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] [[package]] name = "miden-processor" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb298dbdda739080497c18eace4d56c58f3e8d257676c9b2f407be441131ecd" +checksum = "4a659fac55de14647e2695f03d96b83ff94fe65fd31e74d81c225ec52af25acf" dependencies = [ "itertools", "miden-air", @@ -2371,7 +2438,7 @@ dependencies = [ "miden-utils-indexing", "paste", "rayon", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", "winter-prover", @@ -2379,8 +2446,8 @@ dependencies = [ [[package]] name = "miden-protocol" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "bech32", "fs-err", @@ -2401,27 +2468,27 @@ dependencies = [ "regex", "semver 1.0.27", "serde", - "thiserror 2.0.17", - "toml 0.9.8", + "thiserror 2.0.18", + "toml 0.9.11+spec-1.1.0", "walkdir", "winter-rand-utils", ] [[package]] name = "miden-protocol-macros" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "miden-prover" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8506c8eb4d980134c0145887af50bd4631df4010eb23d6e454764cb1ee28836c" +checksum = "4e5df61f50f27886f6f777d6e0cdf785f7db87dd881799a84a801e7330c189c8" dependencies = [ "miden-air", "miden-debug-types", @@ -2434,7 +2501,7 @@ dependencies = [ [[package]] name = "miden-remote-prover-client" version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-node?branch=next#77471e2232c102e9e57099da3f8557aeece55917" +source = "git+https://github.com/0xMiden/miden-node?branch=next#a64cc317c862698d87dc615e36173718180df013" dependencies = [ "fs-err", "getrandom 0.3.4", @@ -2443,7 +2510,7 @@ dependencies = [ "miden-tx", "miette", "prost", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tonic", "tonic-prost", @@ -2453,8 +2520,8 @@ dependencies = [ [[package]] name = "miden-standards" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "fs-err", "miden-assembly", @@ -2464,18 +2531,21 @@ dependencies = [ "miden-protocol", "rand", "regex", - "thiserror 2.0.17", + "thiserror 2.0.18", "walkdir", ] [[package]] name = "miden-testing" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "anyhow", "itertools", + "miden-agglayer", + "miden-assembly", "miden-block-prover", + "miden-core-lib", "miden-processor", "miden-protocol", "miden-standards", @@ -2483,26 +2553,27 @@ dependencies = [ "miden-tx-batch-prover", "rand", "rand_chacha", + "thiserror 2.0.18", "winterfell", ] [[package]] name = "miden-tx" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "miden-processor", "miden-protocol", "miden-prover", "miden-standards", "miden-verifier", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "miden-tx-batch-prover" -version = "0.13.0" -source = "git+https://github.com/0xMiden/miden-base?branch=next#e062f7522e118c19b54b5ae496a9bf4a70debd78" +version = "0.14.0" +source = "git+https://github.com/0xMiden/miden-base?branch=next#9411b6a140e394ff044c5591f6a5d8ac2f6a5118" dependencies = [ "miden-protocol", "miden-tx", @@ -2510,9 +2581,9 @@ dependencies = [ [[package]] name = "miden-utils-core-derive" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0807840c07a4491a292153258cfae27914333e1a7240777a77c22d8ca3b55873" +checksum = "aa207ffd8b26a79d9b5b246a352812f0015c0bb8f75492ec089c5c8e6d5f9e2b" dependencies = [ "proc-macro2", "quote", @@ -2521,9 +2592,9 @@ dependencies = [ [[package]] name = "miden-utils-diagnostics" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b28b1b29e300b471b0f1cbc286997a1326c900814a73b0b28338d5926ce192c" +checksum = "6b2f55477d410542a5d8990ca04856adf5bef91bfa3b54ca3c03a5ff14a6e25c" dependencies = [ "miden-crypto", "miden-debug-types", @@ -2534,18 +2605,18 @@ dependencies = [ [[package]] name = "miden-utils-indexing" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8bd0c1966de07d48a4ed0b2821466919c061f4866296be87afc56970a49716a" +checksum = "f39efae17e14ec8f8a1266cffd29eb7a08ac837143cd09223b1af361bbb55730" dependencies = [ - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "miden-utils-sync" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1fa7e37db2fbf2dee6ba6e411b3570ef48d52ec780b9c8125623f9ddca30da3" +checksum = "da7fa8f5fd27f122c83f55752f2a964bbfc2b713de419e9c152f7dcc05c194ec" dependencies = [ "lock_api", "loom", @@ -2554,13 +2625,13 @@ dependencies = [ [[package]] name = "miden-verifier" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383c934eed92f89be4c1e3dbc97ccf37b48433a0b33727c92a5abbfa2d45f420" +checksum = "fbddac2e76486fb657929338323c68b9e7f40e33b8cfb593d0fb5bf637db046e" dependencies = [ "miden-air", "miden-core", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", "winter-verifier", ] @@ -2573,7 +2644,7 @@ checksum = "9d4cfab04baffdda3fb9eafa5f873604059b89a1699aa95e4f1057397a69f0b5" dependencies = [ "miden-formatting", "smallvec", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -2603,7 +2674,7 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2645,7 +2716,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", ] [[package]] @@ -2657,7 +2728,7 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "schannel", "security-framework 2.11.1", @@ -2727,7 +2798,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2831,7 +2902,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2840,6 +2911,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-probe" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391" + [[package]] name = "openssl-sys" version = "0.9.111" @@ -2862,7 +2939,7 @@ dependencies = [ "futures-sink", "js-sys", "pin-project-lite", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", ] @@ -2877,7 +2954,7 @@ dependencies = [ "opentelemetry-proto", "opentelemetry_sdk", "prost", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tonic", ] @@ -2907,7 +2984,7 @@ dependencies = [ "opentelemetry", "percent-encoding", "rand", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tokio-stream", ] @@ -2938,7 +3015,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -2967,7 +3044,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3012,7 +3089,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3056,9 +3133,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" [[package]] name = "portable-atomic-util" @@ -3106,14 +3183,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" dependencies = [ "unicode-ident", ] @@ -3126,7 +3203,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "version_check", "yansi", ] @@ -3154,7 +3231,7 @@ checksum = "fb6dc647500e84a25a85b100e76c85b8ace114c209432dc174f20aac11d4ed6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3185,21 +3262,21 @@ dependencies = [ "pulldown-cmark", "pulldown-cmark-to-cmark", "regex", - "syn 2.0.111", + "syn 2.0.114", "tempfile", ] [[package]] name = "prost-derive" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3235,7 +3312,7 @@ dependencies = [ "prost-reflect", "prost-types", "protox-parse", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3247,7 +3324,7 @@ dependencies = [ "logos", "miette", "prost-types", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3270,11 +3347,66 @@ dependencies = [ "pulldown-cmark", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" dependencies = [ "proc-macro2", ] @@ -3292,7 +3424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -3302,7 +3434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -3311,14 +3443,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", ] [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ "getrandom 0.3.4", ] @@ -3338,7 +3470,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -3347,7 +3479,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f703f4665700daf5512dcca5f43afa6af89f09db47fb56be587f80636bda2d41" dependencies = [ - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -3410,9 +3542,9 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" -version = "0.12.24" +version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ "base64", "bytes", @@ -3421,16 +3553,21 @@ dependencies = [ "http-body", "http-body-util", "hyper", + "hyper-rustls", "hyper-util", "js-sys", "log", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", + "tokio-rustls", "tower", "tower-http", "tower-service", @@ -3438,6 +3575,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", ] [[package]] @@ -3458,7 +3596,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.16", + "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", @@ -3490,9 +3628,15 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -3527,9 +3671,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags", "errno", @@ -3540,9 +3684,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.35" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "log", "once_cell", @@ -3555,11 +3699,11 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "openssl-probe", + "openssl-probe 0.2.0", "rustls-pki-types", "schannel", "security-framework 3.5.1", @@ -3567,18 +3711,19 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ + "web-time", "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -3593,9 +3738,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "same-file" @@ -3729,20 +3874,20 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] @@ -3767,9 +3912,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ "serde_core", ] @@ -3824,10 +3969,11 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.7" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -3843,9 +3989,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "siphasher" @@ -3950,9 +4096,9 @@ dependencies = [ [[package]] name = "supports-hyperlinks" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" +checksum = "e396b6523b11ccb83120b115a0b7366de372751aa6edf19844dfb13a6af97e91" [[package]] name = "supports-unicode" @@ -3973,9 +4119,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.111" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -3999,7 +4145,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4010,22 +4156,22 @@ checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b" [[package]] name = "tempfile" -version = "3.23.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ "fastrand", "getrandom 0.3.4", "once_cell", - "rustix 1.1.2", + "rustix 1.1.3", "windows-sys 0.61.2", ] [[package]] name = "term" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2111ef44dae28680ae9752bb89409e7310ca33a8c621ebe7b106cf5c928b3ac0" +checksum = "d8c27177b12a6399ffc08b98f76f7c9a1f4fe9fc967c784c5a071fa8d93cf7e1" dependencies = [ "windows-sys 0.61.2", ] @@ -4055,7 +4201,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" dependencies = [ - "rustix 1.1.2", + "rustix 1.1.3", "windows-sys 0.60.2", ] @@ -4081,11 +4227,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.17", + "thiserror-impl 2.0.18", ] [[package]] @@ -4096,18 +4242,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4121,30 +4267,30 @@ dependencies = [ [[package]] name = "time" -version = "0.3.44" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" +checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" [[package]] name = "time-macros" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd" dependencies = [ "num-conv", "time-core", @@ -4169,11 +4315,26 @@ dependencies = [ "zerovec 0.11.5", ] +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" -version = "1.48.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ "bytes", "libc", @@ -4193,7 +4354,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4218,9 +4379,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -4230,9 +4391,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -4255,14 +4416,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.8" +version = "0.9.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.0.3", - "toml_datetime 0.7.3", + "serde_spanned 1.0.4", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", "winnow", @@ -4279,9 +4440,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.3" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] @@ -4302,9 +4463,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.4" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ "winnow", ] @@ -4317,9 +4478,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.0.4" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tonic" @@ -4361,7 +4522,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4399,7 +4560,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.111", + "syn 2.0.114", "tempfile", "tonic-build", ] @@ -4438,7 +4599,7 @@ dependencies = [ "httparse", "js-sys", "pin-project", - "thiserror 2.0.17", + "thiserror 2.0.18", "tonic", "tower-service", "wasm-bindgen", @@ -4449,9 +4610,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -4468,9 +4629,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf146f99d442e8e68e585f5d798ccd3cad9a7835b917e09728880a862706456" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "async-compression", "bitflags", @@ -4504,9 +4665,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -4522,14 +4683,14 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "tracing-core" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -4548,16 +4709,13 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6e5658463dd88089aba75c7791e1d3120633b1bfde22478b28f625a9bb1b8e" +checksum = "1ac28f2d093c6c477eaa76b23525478f38de514fa9aeb1285738d4b97a9552fc" dependencies = [ "js-sys", "opentelemetry", - "opentelemetry_sdk", - "rustversion", "smallvec", - "thiserror 2.0.17", "tracing", "tracing-core", "tracing-log", @@ -4615,7 +4773,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 0.9.8", + "toml 0.9.11+spec-1.1.0", ] [[package]] @@ -4641,9 +4799,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" @@ -4693,14 +4851,15 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.7" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", "percent-encoding", "serde", + "serde_derive", ] [[package]] @@ -4781,18 +4940,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -4803,11 +4962,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.56" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -4816,9 +4976,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4826,22 +4986,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] @@ -4861,9 +5021,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -4900,47 +5060,21 @@ dependencies = [ ] [[package]] -name = "winapi-util" -version = "0.1.11" +name = "webpki-roots" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "windows" -version = "0.61.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" -dependencies = [ - "windows-collections", - "windows-core 0.61.2", - "windows-future", - "windows-link 0.1.3", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core 0.61.2", + "rustls-pki-types", ] [[package]] -name = "windows-core" -version = "0.61.2" +name = "winapi-util" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", + "windows-sys 0.61.2", ] [[package]] @@ -4951,20 +5085,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", - "windows-threading", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -4975,7 +5098,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4986,56 +5109,22 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows-result" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -5044,7 +5133,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -5089,7 +5178,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -5129,7 +5218,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", + "windows-link", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", @@ -5140,15 +5229,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5348,7 +5428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d31a19dae58475d019850e25b0170e94b16d382fbf6afee9c0e80fdc935e73e" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5411,9 +5491,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" [[package]] name = "writeable" @@ -5474,7 +5554,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure", ] @@ -5486,28 +5566,28 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5527,7 +5607,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure", ] @@ -5578,7 +5658,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5589,5 +5669,11 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] + +[[package]] +name = "zmij" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f63c051f4fe3c1509da62131a678643c5b6fbdc9273b2b79d4378ebda003d2" diff --git a/Cargo.toml b/Cargo.toml index 3ea48b11..51a639b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["bin/faucet", "crates/faucet"] +members = ["bin/faucet", "bin/faucet-client", "crates/faucet"] resolver = "2" diff --git a/Makefile b/Makefile index c27c2c6a..555351e6 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,7 @@ check: ## Check all targets and features for errors without code generation .PHONY: install-faucet install-faucet: ## Installs faucet ${BUILD_PROTO} cargo install --path bin/faucet --locked + ${BUILD_PROTO} cargo install --path bin/faucet-client --locked .PHONY: check-tools check-tools: ## Checks if development tools are installed diff --git a/README.md b/README.md index 01638ced..ad954061 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,16 @@ For comprehensive guides, API reference, and examples, see the [Miden Faucet Doc ## Running the faucet -1. Install the faucet: +The faucet comes with two CLI tools: +- **miden-faucet**: Runs the faucet, used for initializing and starting the faucet. +- **miden-faucet-client**: Used for interacting with a live faucet, i.e. for requesting tokens from a running faucet. + +1. Install both faucet binaries: ```bash make install-faucet ``` -2. Initialize the faucet. This will generate a new account with the specified token configuration and save the account data to a local SQLite store: +2. Initialize the faucet server. This will generate a new account with the specified token configuration and save the account data to a local SQLite store: ```bash miden-faucet init \ @@ -25,6 +29,8 @@ miden-faucet init \ > [!TIP] > This account will not be created on chain yet, creation on chain will happen on the first minting transaction. +> You can also run the legacy alias `miden-faucet` for backwards compatibility; it runs the same `miden-faucet` binary. + 3. Start the faucet: ```bash miden-faucet start \ @@ -32,6 +38,13 @@ miden-faucet start \ --network testnet ``` +## Requesting tokens from a live faucet + +You can use the `miden-faucet-client` binary to request tokens from any running faucet instance, whether it's your local faucet or the remote testnet faucet: +```bash +miden-faucet-client mint --url --target-account --amount +``` + After a few seconds you may go to `http://localhost:8080` and see the faucet UI. ## Faucet security features: diff --git a/bin/faucet-client/Cargo.toml b/bin/faucet-client/Cargo.toml new file mode 100644 index 00000000..d66b90fb --- /dev/null +++ b/bin/faucet-client/Cargo.toml @@ -0,0 +1,33 @@ +[package] +authors.workspace = true +description = "Client CLI to request tokens from a remote Miden faucet (PoW mint)" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "miden-faucet-client" +readme = "README.md" +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[lints] +workspace = true + +[dependencies] +anyhow = { workspace = true } +clap = { features = ["derive", "env", "string"], version = "4.5" } +hex = { version = "0.4" } +miden-client = { workspace = true } +miden-faucet-lib = { workspace = true } +miden-pow-rate-limiter = { workspace = true } +rand = { features = ["thread_rng"], workspace = true } +reqwest = { default-features = false, features = ["json", "rustls-tls"], version = "0.12" } +serde_json = { workspace = true } +thiserror = { workspace = true } +tokio = { features = ["macros", "net", "rt-multi-thread", "sync", "time"], workspace = true } +url = { workspace = true } + +[dev-dependencies] +axum = { features = ["tokio"], version = "0.8" } +serde = { workspace = true } +tokio = { features = ["macros", "net", "rt-multi-thread", "time"], workspace = true } diff --git a/bin/faucet-client/README.md b/bin/faucet-client/README.md new file mode 100644 index 00000000..d13d1d43 --- /dev/null +++ b/bin/faucet-client/README.md @@ -0,0 +1,13 @@ +# miden-faucet-client + +Command-line tool for interacting with a live Miden faucet. + +## Commands + +### `mint` + +Requests tokens from a faucet by solving its PoW challenge and minting a public P2ID note. + +```bash +miden-faucet-client mint --url --target-account --amount +``` diff --git a/bin/faucet-client/src/lib.rs b/bin/faucet-client/src/lib.rs new file mode 100644 index 00000000..7e5e8b22 --- /dev/null +++ b/bin/faucet-client/src/lib.rs @@ -0,0 +1 @@ +pub mod mint; diff --git a/bin/faucet-client/src/main.rs b/bin/faucet-client/src/main.rs new file mode 100644 index 00000000..adf44cce --- /dev/null +++ b/bin/faucet-client/src/main.rs @@ -0,0 +1,29 @@ +use clap::{Parser, Subcommand}; +use miden_faucet_client::mint; + +/// Client CLI for interacting with a live faucet. +#[derive(Parser)] +#[command(version, about, long_about = None)] +struct Cli { + #[command(subcommand)] + command: Command, +} + +#[derive(Subcommand)] +enum Command { + /// Request tokens from a remote faucet (does not consume the resulting note). + Mint(mint::MintCmd), +} + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + let cli = Cli::parse(); + + match cli.command { + Command::Mint(cmd) => { + cmd.execute().await.map_err(anyhow::Error::from)?; + }, + } + + Ok(()) +} diff --git a/bin/faucet-client/src/mint.rs b/bin/faucet-client/src/mint.rs new file mode 100644 index 00000000..3df0868b --- /dev/null +++ b/bin/faucet-client/src/mint.rs @@ -0,0 +1,298 @@ +//! CLI command to request a public P2ID note from a remote faucet by solving its `PoW` challenge. + +use std::time::Duration; + +use clap::Parser; +use miden_client::Word; +use miden_client::account::{AccountId, Address}; +use miden_client::address::AddressId; +use miden_client::note::NoteId; +use miden_client::transaction::TransactionId; +use miden_faucet_lib::requests::{ + GetPowResponse, + GetTokensQueryParams, + GetTokensResponse, + MintResponse, + PowQueryParams, +}; +use miden_pow_rate_limiter::{Challenge, ChallengeError}; +use rand::Rng; +use reqwest::{Client as HttpClient, Url}; +use tokio::task; + +// CONSTANTS +// ================================================================================================ + +const DEFAULT_FAUCET_URL: &str = "https://faucet-api.testnet.miden.io"; +const REQUEST_TIMEOUT_MS: u64 = 30_000; + +// CLI +// ================================================================================================ + +/// Mint tokens from a remote faucet by solving its `PoW` challenge and requesting a **public** +/// P2ID note. +#[derive(Debug, Parser, Clone)] +pub struct MintCmd { + /// Faucet API base URL. Defaults to the public testnet faucet. + #[arg(long = "url", default_value = DEFAULT_FAUCET_URL, value_name = "URL")] + api_url: String, + + /// Account ID or address to receive the minted tokens. + #[arg(short = 't', long = "target-account", value_name = "ACCOUNT")] + target_account: String, + + /// Amount to mint (in base units). + #[arg(short = 'a', long = "amount", value_name = "U64")] + amount: u64, + + /// Optional faucet API key. + #[arg(long = "api-key", value_name = "STRING")] + api_key: Option, +} + +impl MintCmd { + /// Executes the mint command. + pub async fn execute(&self) -> Result<(), MintClientError> { + if self.amount == 0 { + return Err(MintClientError::AmountZero); + } + + let account_id = parse_account_id(&self.target_account)?; + let faucet_client = + FaucetHttpClient::new(&self.api_url, REQUEST_TIMEOUT_MS, self.api_key.clone())?; + + println!( + "Requesting PoW challenge for account {} from faucet at {}...", + account_id.to_hex(), + faucet_client.base_url + ); + + let (challenge, target) = faucet_client.request_pow(&account_id, self.amount).await?; + + println!("Solving faucet PoW challenge, this can take some time..."); + let nonce = solve_challenge(&challenge, target).await?; + + println!("Submitting mint request for a public P2ID note..."); + let mint_response = faucet_client + .request_tokens(&challenge, nonce, &account_id, self.amount) + .await?; + + println!("Mint request accepted. Transaction: {}", mint_response.tx_id.to_hex()); + println!("Public P2ID note commitment: {}", mint_response.note_id.to_hex()); + + Ok(()) + } +} + +// HTTP CLIENT +// ================================================================================================ + +/// HTTP client for interacting with the faucet API. +#[derive(Clone)] +struct FaucetHttpClient { + http_client: HttpClient, + base_url: Url, + api_key: Option, +} + +impl FaucetHttpClient { + /// Creates a new `FaucetHttpClient` instance. + fn new( + endpoint: &str, + timeout_ms: u64, + api_key: Option, + ) -> Result { + let base_url = Url::parse(endpoint) + .map_err(|err| MintClientError::InvalidUrl(endpoint.to_owned(), err))?; + + let http_client = HttpClient::builder() + .timeout(Duration::from_millis(timeout_ms)) + .build() + .map_err(MintClientError::HttpClient)?; + + Ok(Self { http_client, base_url, api_key }) + } + + /// Requests a `PoW` challenge from the faucet API. + async fn request_pow( + &self, + account_id: &AccountId, + amount: u64, + ) -> Result<(String, u64), MintClientError> { + let pow_url = self + .base_url + .join("pow") + .map_err(|err| MintClientError::InvalidUrl(self.base_url.to_string(), err))?; + + let params = PowQueryParams { + account_id: account_id.to_hex(), + amount, + api_key: self.api_key.clone(), + }; + + let response = self + .http_client + .get(pow_url) + .query(¶ms) + .send() + .await + .map_err(|err| MintClientError::Request("PoW", err))?; + + if !response.status().is_success() { + let status = response.status(); + let body = + response.text().await.map_err(|err| MintClientError::ResponseBody("pow", err))?; + return Err(MintClientError::UnexpectedStatus("pow", status, body)); + } + + let body = + response.text().await.map_err(|err| MintClientError::ResponseBody("pow", err))?; + let parsed = serde_json::from_str::(&body) + .map_err(|err| MintClientError::ParseResponse("PoW", err, body.clone()))?; + + Ok((parsed.challenge, parsed.target)) + } + + /// Requests tokens from the faucet API. + async fn request_tokens( + &self, + challenge: &str, + nonce: u64, + account_id: &AccountId, + amount: u64, + ) -> Result { + let url = self + .base_url + .join("get_tokens") + .map_err(|err| MintClientError::InvalidUrl(self.base_url.to_string(), err))?; + + let params = GetTokensQueryParams { + account_id: account_id.to_hex(), + asset_amount: amount, + is_private_note: false, + challenge: challenge.to_owned(), + nonce, + api_key: self.api_key.clone(), + }; + + let response = self + .http_client + .get(url) + .query(¶ms) + .send() + .await + .map_err(|err| MintClientError::Request("get_tokens", err))?; + + if !response.status().is_success() { + let status = response.status(); + let body = response + .text() + .await + .map_err(|err| MintClientError::ResponseBody("get_tokens", err))?; + return Err(MintClientError::UnexpectedStatus("get_tokens", status, body)); + } + + let body = response + .text() + .await + .map_err(|err| MintClientError::ResponseBody("get_tokens", err))?; + let parsed = serde_json::from_str::(&body) + .map_err(|err| MintClientError::ParseResponse("get_tokens", err, body.clone()))?; + + let note_id = NoteId::try_from_hex(&parsed.note_id).map_err(|err| { + MintClientError::InvalidNoteId(parsed.note_id.clone(), err.to_string()) + })?; + + let tx_id = + Word::try_from(parsed.tx_id.as_str()).map(TransactionId::from).map_err(|err| { + MintClientError::InvalidTransactionId(parsed.tx_id.clone(), err.to_string()) + })?; + + Ok(MintResponse { note_id, tx_id }) + } +} + +// ERRORS +// ================================================================================================ + +/// Errors that can occur while interacting with the faucet API. +#[derive(Debug, thiserror::Error)] +pub enum MintClientError { + #[error("amount must be greater than zero")] + AmountZero, + #[error("invalid account `{0}`: {1}")] + InvalidAccount(String, String), + #[error("invalid faucet URL `{0}`: {1}")] + InvalidUrl(String, url::ParseError), + #[error("failed to build HTTP client: {0}")] + HttpClient(#[source] reqwest::Error), + #[error("{0} request failed: {1}")] + Request(&'static str, #[source] reqwest::Error), + #[error("{0} request failed with status {1}: {2}")] + UnexpectedStatus(&'static str, reqwest::StatusCode, String), + #[error("failed to parse {0} response: {1}. Body: {2}")] + ParseResponse(&'static str, #[source] serde_json::Error, String), + #[error("failed to read {0} response body: {1}")] + ResponseBody(&'static str, #[source] reqwest::Error), + #[error("faucet returned a PoW target of 0")] + ZeroTarget, + #[error("invalid challenge hex returned by faucet: {0}")] + InvalidChallengeHex(#[source] hex::FromHexError), + #[error("invalid challenge returned by faucet: {0}")] + InvalidChallenge(#[source] ChallengeError), + #[error("PoW solving task failed: {0}")] + PowTask(String), + #[error("invalid note id `{0}`: {1}")] + InvalidNoteId(String, String), + #[error("invalid transaction id `{0}`: {1}")] + InvalidTransactionId(String, String), +} + +// HELPERS +// ================================================================================================ + +/// Parses a user provided account ID string and returns the corresponding `AccountId` +fn parse_account_id(input: &str) -> Result { + if input.starts_with("0x") { + AccountId::from_hex(input) + .map_err(|err| MintClientError::InvalidAccount(input.to_owned(), err.to_string())) + } else { + Address::decode(input) + .map_err(|err| MintClientError::InvalidAccount(input.to_owned(), err.to_string())) + .and_then(|(_, address)| match address.id() { + AddressId::AccountId(account_id) => Ok(account_id), + _ => Err(MintClientError::InvalidAccount( + input.to_owned(), + "address is not account-based".to_owned(), + )), + }) + } +} + +/// Solves the `PoW` challenge and returns the nonce that satisfies the target. +/// +/// Heavy work runs on a blocking thread so we don't stall the async runtime. +async fn solve_challenge(challenge_hex: &str, target: u64) -> Result { + if target == 0 { + return Err(MintClientError::ZeroTarget); + } + + let challenge_bytes = + hex::decode(challenge_hex).map_err(MintClientError::InvalidChallengeHex)?; + let challenge = Challenge::try_from(challenge_bytes.as_slice()) + .map_err(MintClientError::InvalidChallenge)?; + + task::spawn_blocking(move || { + let mut rng = rand::rng(); + + loop { + let nonce: u64 = rng.random(); + + if challenge.validate_pow(nonce) { + return nonce; + } + } + }) + .await + .map_err(|err| MintClientError::PowTask(err.to_string())) +} diff --git a/bin/faucet-client/tests/mint.rs b/bin/faucet-client/tests/mint.rs new file mode 100644 index 00000000..e34cce14 --- /dev/null +++ b/bin/faucet-client/tests/mint.rs @@ -0,0 +1,134 @@ +use std::sync::Arc; + +use axum::extract::{Query, State}; +use axum::routing::get; +use axum::{Json, Router}; +use clap::Parser; +use miden_client::account::AccountId; +use miden_client::note::NoteId; +use miden_client::utils::ToHex; +use miden_faucet_client::mint::MintCmd; +use miden_faucet_lib::requests::{ + GetPowResponse, + GetTokensQueryParams, + GetTokensResponse, + PowQueryParams, +}; +use miden_pow_rate_limiter::Challenge; +use tokio::net::TcpListener; +use tokio::sync::Mutex; + +#[derive(Clone, Default)] +struct RecordedRequest { + pow_params: Option, + tokens_params: Option, +} + +#[derive(Clone)] +struct AppState { + pow_response: GetPowResponse, + note_id_hex: String, + tx_id: String, + recorded: Arc>, + challenge_hex: String, +} + +#[tokio::test] +async fn mint_command_requests_public_note() { + let account_hex = "0xca8203e8e58cf72049b061afca78ce"; + let account_id = AccountId::from_hex(account_hex).unwrap(); + let expected_amount = 123_000; + + // Create a valid Challenge with target = u64::MAX so any nonce will solve it + let challenge = Challenge::from_parts( + u64::MAX, // target - any nonce will pass + 0, // timestamp + 1, // request_complexity + [0u8; 32], // requestor + [0u8; 32], // domain + [0u8; 32], // signature (doesn't matter for client-side validation) + ); + let challenge_hex = challenge.to_bytes().to_hex(); + + let pow_response = GetPowResponse { + challenge: challenge_hex.clone(), + target: u64::MAX, + timestamp: 0, + }; + let note_id_hex = format!("0x{}", "00".repeat(32)); + let _note_id = NoteId::try_from_hex(¬e_id_hex).expect("hex string should produce a note id"); + // TransactionId requires a valid 32-byte Word (64 hex chars) + let tx_id_hex = format!("0x{}", "ab".repeat(32)); + let app_state = AppState { + pow_response, + note_id_hex, + tx_id: tx_id_hex, + recorded: Arc::new(Mutex::new(RecordedRequest::default())), + challenge_hex, + }; + + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let addr = listener.local_addr().unwrap(); + let app = Router::new() + .route("/pow", get(pow_handler)) + .route("/get_tokens", get(tokens_handler)) + .with_state(app_state.clone()); + tokio::spawn(async move { + axum::serve(listener, app).await.unwrap(); + }); + + let cli = MintCmd::parse_from([ + "mint", + "--url", + format!("http://{addr}").as_str(), + "--target-account", + account_id.to_hex().as_str(), + "--amount", + &expected_amount.to_string(), + "--api-key", + "test-key", + ]); + + cli.execute().await.unwrap(); + + let recorded = app_state.recorded.lock().await.clone(); + + // Verify PoW request params + let pow_params = recorded.pow_params.expect("pow_params should be recorded"); + assert_eq!(pow_params.account_id, account_id.to_hex()); + assert_eq!(pow_params.amount, expected_amount); + assert_eq!(pow_params.api_key.as_deref(), Some("test-key")); + + // Verify get_tokens request params + let tokens_params = recorded.tokens_params.expect("tokens_params should be recorded"); + assert_eq!(tokens_params.account_id, account_id.to_hex()); + assert_eq!(tokens_params.asset_amount, expected_amount); + assert!(!tokens_params.is_private_note); + assert_eq!(tokens_params.api_key.as_deref(), Some("test-key")); + assert_eq!(tokens_params.challenge, app_state.challenge_hex); +} + +async fn pow_handler( + State(state): State, + Query(params): Query, +) -> Json { + { + let mut recorded = state.recorded.lock().await; + recorded.pow_params = Some(params); + } + Json(state.pow_response.clone()) +} + +async fn tokens_handler( + State(state): State, + Query(params): Query, +) -> Json { + { + let mut recorded = state.recorded.lock().await; + recorded.tokens_params = Some(params); + } + Json(GetTokensResponse { + note_id: state.note_id_hex.clone(), + tx_id: state.tx_id.clone(), + }) +} diff --git a/bin/faucet/src/api/get_pow.rs b/bin/faucet/src/api/get_pow.rs index 73cd3cb1..cf555b32 100644 --- a/bin/faucet/src/api/get_pow.rs +++ b/bin/faucet/src/api/get_pow.rs @@ -5,7 +5,7 @@ use http::StatusCode; use miden_client::account::{AccountId, Address}; use miden_client::address::AddressId; use miden_client::utils::ToHex; -use serde::{Deserialize, Serialize}; +use miden_faucet_lib::requests::{GetPowResponse, PowQueryParams}; use tracing::{info_span, instrument}; use crate::COMPONENT; @@ -21,9 +21,9 @@ use crate::api_key::ApiKey; )] pub async fn get_pow( State(server): State, - Query(params): Query, + Query(params): Query, ) -> Result, PowRequestError> { - let request = params.validate()?; + let request = validate_pow_params(params)?; let account_id_bytes: [u8; AccountId::SERIALIZED_SIZE] = request.account_id.into(); let mut requestor = [0u8; 32]; requestor[..AccountId::SERIALIZED_SIZE].copy_from_slice(&account_id_bytes); @@ -48,13 +48,6 @@ pub async fn get_pow( })) } -#[derive(Serialize, Debug)] -pub struct GetPowResponse { - challenge: String, - target: u64, - timestamp: u64, -} - // REQUEST VALIDATION // ================================================================================================ @@ -65,38 +58,32 @@ pub struct PowRequest { pub api_key: ApiKey, } -/// Used to receive the initial `get_pow` request from the user. -#[derive(Deserialize)] -pub struct RawPowRequest { - amount: u64, - account_id: String, - api_key: Option, -} - -impl RawPowRequest { - pub fn validate(self) -> Result { - let account_id = if self.account_id.starts_with("0x") { - AccountId::from_hex(&self.account_id).map_err(AccountError::ParseId) - } else { - Address::decode(&self.account_id).map_err(AccountError::ParseAddress).and_then( - |(_, address)| match address.id() { - AddressId::AccountId(account_id) => Ok(account_id), - _ => Err(AccountError::AddressNotIdBased), - }, - ) - } - .map_err(PowRequestError::AccountError)?; +fn validate_pow_params(params: PowQueryParams) -> Result { + let account_id = if params.account_id.starts_with("0x") { + AccountId::from_hex(¶ms.account_id).map_err(AccountError::ParseId) + } else { + Address::decode(¶ms.account_id) + .map_err(AccountError::ParseAddress) + .and_then(|(_, address)| match address.id() { + AddressId::AccountId(account_id) => Ok(account_id), + _ => Err(AccountError::AddressNotIdBased), + }) + } + .map_err(PowRequestError::AccountError)?; - let api_key = self - .api_key - .as_deref() - .map(ApiKey::decode) - .transpose() - .map_err(|_| PowRequestError::InvalidApiKey(self.api_key.unwrap_or_default()))? - .unwrap_or_default(); + let api_key = params + .api_key + .as_deref() + .map(ApiKey::decode) + .transpose() + .map_err(|_| PowRequestError::InvalidApiKey(params.api_key.unwrap_or_default()))? + .unwrap_or_default(); - Ok(PowRequest { amount: self.amount, account_id, api_key }) - } + Ok(PowRequest { + amount: params.amount, + account_id, + api_key, + }) } #[derive(Debug, thiserror::Error)] diff --git a/bin/faucet/src/api/get_tokens.rs b/bin/faucet/src/api/get_tokens.rs index 9e6fb71b..4009dbeb 100644 --- a/bin/faucet/src/api/get_tokens.rs +++ b/bin/faucet/src/api/get_tokens.rs @@ -4,10 +4,15 @@ use axum::http::{HeaderMap, HeaderValue, StatusCode}; use axum::response::{IntoResponse, Response}; use miden_client::account::{AccountId, Address}; use miden_client::address::AddressId; -use miden_faucet_lib::requests::{MintError, MintRequest, MintRequestSender}; +use miden_faucet_lib::requests::{ + GetTokensQueryParams, + GetTokensResponse, + MintError, + MintRequest, + MintRequestSender, +}; use miden_faucet_lib::types::{AssetAmount, AssetAmountError, NoteType}; use miden_pow_rate_limiter::ChallengeError; -use serde::{Deserialize, Serialize}; use tokio::sync::mpsc::error::TrySendError; use tokio::sync::oneshot; use tracing::{Instrument, info_span, instrument}; @@ -29,11 +34,12 @@ use crate::api_key::ApiKey; )] pub async fn get_tokens( State(server): State, - Query(request): Query, + Query(request): Query, ) -> Result, GetTokenError> { let (mint_response_sender, mint_response_receiver) = oneshot::channel(); - let validated_request = request.validate(&server).map_err(GetTokenError::InvalidRequest)?; + let validated_request = + validate_get_tokens_params(&request, &server).map_err(GetTokenError::InvalidRequest)?; let enqueue_span = info_span!(target: COMPONENT, "server.get_tokens.enqueue"); { @@ -60,12 +66,6 @@ pub async fn get_tokens( })) } -#[derive(Serialize, Debug)] -pub struct GetTokensResponse { - tx_id: String, - note_id: String, -} - // STATE // ================================================================================================ @@ -84,19 +84,6 @@ impl GetTokensState { // REQUEST VALIDATION // ================================================================================================ -/// Used to receive the initial request from the user. -/// -/// Further parsing is done to get the expected [`MintRequest`] expected by the faucet client. -#[derive(Deserialize)] -pub struct RawMintRequest { - pub account_id: String, - pub is_private_note: bool, - pub asset_amount: u64, - pub challenge: Option, - pub nonce: Option, - pub api_key: Option, -} - #[derive(Debug, thiserror::Error)] pub enum MintRequestError { #[error(transparent)] @@ -109,8 +96,6 @@ pub enum MintRequestError { PowError(#[from] ChallengeError), #[error("API key {0} is invalid")] InvalidApiKey(String), - #[error("PoW parameters are missing")] - MissingPowParameters, } #[derive(Debug, thiserror::Error)] @@ -189,69 +174,68 @@ impl IntoResponse for GetTokenError { } } -impl RawMintRequest { - /// Further validates a raw request, turning it into a valid [`MintRequest`] which can be - /// submitted to the faucet client. - /// - /// # Errors - /// - /// Returns an error if: - /// - the account ID is not a valid hex string - /// - the asset amount is not one of the provided options - /// - the API key is invalid - /// - the challenge is missing or invalid - /// - the nonce is missing or doesn't solve the challenge - /// - the challenge timestamp is expired - /// - the challenge has already been used - fn validate(self, server: &ApiServer) -> Result { - let note_type = if self.is_private_note { - NoteType::Private - } else { - NoteType::Public - }; - - let account_id = if self.account_id.starts_with("0x") { - AccountId::from_hex(&self.account_id).map_err(AccountError::ParseId) - } else { - Address::decode(&self.account_id).map_err(AccountError::ParseAddress).and_then( - |(_, address)| match address.id() { - AddressId::AccountId(account_id) => Ok(account_id), - _ => Err(AccountError::AddressNotIdBased), - }, - ) - } - .map_err(MintRequestError::AccountError)?; - - let asset_amount = - AssetAmount::new(self.asset_amount).map_err(MintRequestError::InvalidAssetAmount)?; - if asset_amount > server.mint_state.max_claimable_amount { - return Err(MintRequestError::AssetAmountTooBig( - asset_amount, - server.mint_state.max_claimable_amount, - )); - } +/// Further validates a raw request, turning it into a valid [`MintRequest`] which can be +/// submitted to the faucet client. +/// +/// # Errors +/// +/// Returns an error if: +/// - the account ID is not a valid hex string +/// - the asset amount is not one of the provided options +/// - the API key is invalid +/// - the challenge is invalid +/// - the nonce doesn't solve the challenge +/// - the challenge timestamp is expired +/// - the challenge has already been used +fn validate_get_tokens_params( + params: &GetTokensQueryParams, + server: &ApiServer, +) -> Result { + let note_type = if params.is_private_note { + NoteType::Private + } else { + NoteType::Public + }; + + let account_id = if params.account_id.starts_with("0x") { + AccountId::from_hex(¶ms.account_id).map_err(AccountError::ParseId) + } else { + Address::decode(¶ms.account_id) + .map_err(AccountError::ParseAddress) + .and_then(|(_, address)| match address.id() { + AddressId::AccountId(account_id) => Ok(account_id), + _ => Err(AccountError::AddressNotIdBased), + }) + } + .map_err(MintRequestError::AccountError)?; + + let asset_amount = + AssetAmount::new(params.asset_amount).map_err(MintRequestError::InvalidAssetAmount)?; + if asset_amount > server.mint_state.max_claimable_amount { + return Err(MintRequestError::AssetAmountTooBig( + asset_amount, + server.mint_state.max_claimable_amount, + )); + } - // Check the API key, if provided - let api_key = self.api_key.as_deref().map(ApiKey::decode).transpose()?; - if let Some(api_key) = &api_key - && !server.api_keys.contains(api_key) - { - return Err(MintRequestError::InvalidApiKey(api_key.encode())); - } + // Check the API key, if provided + let api_key = params.api_key.as_deref().map(ApiKey::decode).transpose()?; + if let Some(api_key) = &api_key + && !server.api_keys.contains(api_key) + { + return Err(MintRequestError::InvalidApiKey(api_key.encode())); + } - // Validate Challenge and nonce - let challenge_str = self.challenge.ok_or(MintRequestError::MissingPowParameters)?; - let nonce = self.nonce.ok_or(MintRequestError::MissingPowParameters)?; - let request_complexity = server.compute_request_complexity(asset_amount.base_units()); + // Validate Challenge and nonce + let request_complexity = server.compute_request_complexity(asset_amount.base_units()); - server.submit_challenge( - &challenge_str, - nonce, - account_id, - api_key.unwrap_or_default(), - request_complexity, - )?; + server.submit_challenge( + ¶ms.challenge, + params.nonce, + account_id, + api_key.unwrap_or_default(), + request_complexity, + )?; - Ok(MintRequest { account_id, note_type, asset_amount }) - } + Ok(MintRequest { account_id, note_type, asset_amount }) } diff --git a/crates/faucet/Cargo.toml b/crates/faucet/Cargo.toml index 5192481a..2ca38840 100644 --- a/crates/faucet/Cargo.toml +++ b/crates/faucet/Cargo.toml @@ -22,6 +22,7 @@ miden-client-sqlite-store = { workspace = true } # External dependencies. anyhow = { workspace = true } rand = { features = ["thread_rng"], workspace = true } +serde = { workspace = true } thiserror = { workspace = true } tokio = { features = ["fs"], workspace = true } tracing = { workspace = true } diff --git a/crates/faucet/src/requests.rs b/crates/faucet/src/requests.rs index 4a7a9ada..7ec0b59f 100644 --- a/crates/faucet/src/requests.rs +++ b/crates/faucet/src/requests.rs @@ -1,6 +1,7 @@ use miden_client::account::AccountId; use miden_client::note::NoteId; use miden_client::transaction::TransactionId; +use serde::{Deserialize, Serialize}; use tokio::sync::{mpsc, oneshot}; use crate::types::{AssetAmount, NoteType}; @@ -8,6 +9,52 @@ use crate::types::{AssetAmount, NoteType}; pub type MintResponseSender = oneshot::Sender>; pub type MintRequestSender = mpsc::Sender<(MintRequest, MintResponseSender)>; +// QUERY PARAMETERS +// ================================================================================================ + +/// Query parameters for the `/pow` endpoint. +/// +/// Used by both the client (to serialize) and the server (to deserialize). +#[derive(Debug, Deserialize, Serialize, Clone)] +pub struct PowQueryParams { + pub account_id: String, + pub amount: u64, + #[serde(skip_serializing_if = "Option::is_none")] + pub api_key: Option, +} + +/// Query parameters for the `/get_tokens` endpoint. +/// +/// Used by both the client (to serialize) and the server (to deserialize). +#[derive(Debug, Deserialize, Serialize, Clone)] +pub struct GetTokensQueryParams { + pub account_id: String, + pub asset_amount: u64, + pub is_private_note: bool, + pub challenge: String, + pub nonce: u64, + #[serde(skip_serializing_if = "Option::is_none")] + pub api_key: Option, +} + +// RESPONSES +// ================================================================================================ + +/// Response from the `/pow` endpoint. +#[derive(Debug, Deserialize, Serialize, Clone)] +pub struct GetPowResponse { + pub challenge: String, + pub target: u64, + pub timestamp: u64, +} + +/// Response from the `/get_tokens` endpoint. +#[derive(Debug, Deserialize, Serialize, Clone)] +pub struct GetTokensResponse { + pub tx_id: String, + pub note_id: String, +} + /// A request for minting to the Faucet. pub struct MintRequest { /// Destination account. diff --git a/docs/src/getting-started/cli.md b/docs/src/getting-started/cli.md index 939920de..ac60a036 100644 --- a/docs/src/getting-started/cli.md +++ b/docs/src/getting-started/cli.md @@ -2,6 +2,11 @@ This guide shows the available commands and their configuration options to run with the Miden Faucet CLI. +The faucet comes with two CLI tools: + +- **miden-faucet**: Runs the faucet, used for initializing and starting the faucet. +- **miden-faucet-client**: Used for interacting with a live faucet, i.e. for requesting tokens from a running faucet. + ## Available Commands | Command | Description | @@ -225,4 +230,18 @@ miden-faucet start \ --network localhost ``` -For detailed options, run `miden-faucet [COMMAND] --help`. +For detailed options, run `miden-faucet [COMMAND] --help`. The legacy alias `miden-faucet` is still available for backwards compatibility. + +## Requesting tokens from a live faucet + +You can use the `miden-faucet-client` binary to request tokens from any running faucet instance, whether it's your local faucet or the remote testnet faucet: +```bash +miden-faucet-client mint --url --target-account --amount +``` + +Although the command is named `mint`, in technical terms it makes a request to the faucet to request a public P2ID note. + +To see available options: +```bash +miden-faucet-client mint --help +``` diff --git a/docs/src/getting-started/installation.md b/docs/src/getting-started/installation.md index 473387c6..a4fc802b 100644 --- a/docs/src/getting-started/installation.md +++ b/docs/src/getting-started/installation.md @@ -39,12 +39,14 @@ Install the latest faucet binary: ```sh cargo install miden-faucet --locked +cargo install miden-faucet-client --locked ``` This will install the latest official version of the faucet. You can install a specific version `x.y.z` using ```sh cargo install miden-faucet --locked --version x.y.z +cargo install miden-faucet-client --locked --version x.y.z ``` You can also use `cargo` to compile the node from the source code if for some reason you need a specific git revision. @@ -54,12 +56,17 @@ this for advanced use only. The incantation is a little different as you'll be t ```sh # Install from a specific branch cargo install --locked --git https://github.com/0xMiden/miden-faucet miden-faucet --branch +cargo install --locked --git https://github.com/0xMiden/miden-faucet miden-faucet-client --branch # Install a specific tag cargo install --locked --git https://github.com/0xMiden/miden-faucet miden-faucet --tag +cargo install --locked --git https://github.com/0xMiden/miden-faucet miden-faucet-client --tag # Install a specific git revision cargo install --locked --git https://github.com/0xMiden/miden-faucet miden-faucet --rev +cargo install --locked --git https://github.com/0xMiden/miden-faucet miden-faucet-client --rev + +> Use `miden-faucet` to initialize/start the faucet service, and `miden-faucet-client` to mint from a running faucet. ``` More information on the various `cargo install` options can be found diff --git a/docs/src/getting-started/quick-start.md b/docs/src/getting-started/quick-start.md index 4e13465b..07f081f0 100644 --- a/docs/src/getting-started/quick-start.md +++ b/docs/src/getting-started/quick-start.md @@ -31,7 +31,20 @@ miden-faucet start \ ## Step 3: Request Test Tokens -Once the faucet is running, you can request test tokens through either the web interface or the REST API. +Once the faucet is running, you can request test tokens through either the web interface, the client CLI, or the REST API. + +### Via Client CLI + +Use the dedicated mint command: + +```bash +miden-faucet-client mint \ + --url http://localhost:8000 \ + --target-account \ + --amount 1000 +``` + +Although the command is named `mint`, in technical terms it makes a request to the faucet, solves the PoW challenge and creates a public P2ID note. ### Via Web Interface (if frontend is enabled) @@ -45,6 +58,7 @@ Open `http://localhost:8080` in your browser to access the web interface for gen ### Via API You can also programmatically interact with the REST API to mint tokens. Check out the complete working examples below. Make sure the faucet REST API is running at `http://localhost:8000` before using them. + - [Rust](../examples/rust/request_tokens.rs) - [TypeScript](../examples/typescript/request_tokens.ts) @@ -92,7 +106,7 @@ miden-faucet init \ miden-faucet start \ --explorer-url https://testnet.midenscan.com \ --network testnet -``` +``` ### Faucet API Only (No Frontend)