diff --git a/Cargo.lock b/Cargo.lock index 73a0897d3..1bae6b3a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -57,9 +57,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -72,43 +72,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" dependencies = [ "backtrace", ] @@ -133,9 +134,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.13" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e614738943d3f68c628ae3dbce7c3daffb196665f82f8c8ea6b65de73c79429" +checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" dependencies = [ "flate2", "futures-core", @@ -146,13 +147,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -169,36 +170,34 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-lc-rs" -version = "1.10.0" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdd82dba44d209fddb11c190e0a94b78651f95299598e472215667417a03ff1d" +checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca" dependencies = [ "aws-lc-sys", - "mirai-annotations", "paste", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.22.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7a4168111d7eb622a31b214057b8509c0a7e1794f44c546d742330dc793972" +checksum = "54ac4f13dad353b209b34cbec082338202cbc01c8f00336b55c750c13ac91f8f" dependencies = [ "bindgen", "cc", "cmake", "dunce", "fs_extra", - "libc", "paste", ] [[package]] name = "axum" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", @@ -220,7 +219,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", "tower", "tower-layer", @@ -243,7 +242,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper", "tower-layer", "tower-service", "tracing", @@ -316,7 +315,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.96", + "syn 2.0.98", "which", ] @@ -337,15 +336,16 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "1230237285e3e10cde447185e8975408ae24deaa67205ce684805c25bc0c7937" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", + "memmap2", "rayon-core", ] @@ -360,9 +360,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytecount" @@ -378,27 +378,27 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" dependencies = [ "serde", ] [[package]] name = "bytesize" -version = "1.3.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" dependencies = [ "serde", ] [[package]] name = "bzip2-sys" -version = "0.1.11+1.0.8" +version = "0.1.12+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" dependencies = [ "cc", "libc", @@ -422,9 +422,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.10" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ "jobserver", "libc", @@ -446,6 +446,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "ciborium" version = "0.2.2" @@ -486,9 +492,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", @@ -496,9 +502,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", @@ -509,36 +515,36 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cmake" -version = "0.1.51" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" dependencies = [ "cc", ] [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "const-oid" @@ -554,9 +560,9 @@ checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" dependencies = [ "core-foundation-sys", "libc", @@ -570,9 +576,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -648,18 +654,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -676,15 +682,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-common" @@ -720,7 +726,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -744,7 +750,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -755,7 +761,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -773,9 +779,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" [[package]] name = "der" @@ -828,6 +834,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "dunce" version = "1.0.5" @@ -836,9 +853,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" [[package]] name = "ed25519" @@ -897,7 +914,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -910,14 +927,14 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" @@ -980,7 +997,7 @@ source = "git+https://github.com/broxus/everscale-types.git?rev=adada6e6539abd79 dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -994,9 +1011,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fdlimit" @@ -1005,7 +1022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" dependencies = [ "libc", - "thiserror 1.0.66", + "thiserror 1.0.69", ] [[package]] @@ -1020,11 +1037,17 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1107,7 +1130,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1140,6 +1163,19 @@ dependencies = [ "slab", ] +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.58.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1158,7 +1194,7 @@ checksum = "df28aba11fa2e95570fae3b3ac8883ae8026f0374d043f24117cbb13e1c4c1ff" dependencies = [ "futures-util", "hickory-client", - "thiserror 1.0.66", + "thiserror 1.0.69", "tokio", ] @@ -1169,8 +1205,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", ] [[package]] @@ -1187,9 +1237,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "h2" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ "atomic-waker", "bytes", @@ -1197,7 +1247,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.6.0", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -1231,9 +1281,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -1261,9 +1311,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hickory-client" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab9683b08d8f8957a857b0236455d80e1886eaa8c6178af556aa7871fb61b55" +checksum = "2ea0169f8b21726527197c7190e5a23b7fd514a3e04f99c571e05631e1f8a9c8" dependencies = [ "cfg-if", "data-encoding", @@ -1273,16 +1323,16 @@ dependencies = [ "once_cell", "radix_trie", "rand", - "thiserror 1.0.66", + "thiserror 1.0.69", "tokio", "tracing", ] [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "2ad3d6d98c648ed628df039541a5577bee1a7c83e9e16fe3dbedeea4cdfeb971" dependencies = [ "async-trait", "cfg-if", @@ -1291,11 +1341,11 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.4.0", + "idna", "ipnet", "once_cell", "rand", - "thiserror 1.0.66", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -1313,9 +1363,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1347,9 +1397,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -1365,9 +1415,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.4.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -1386,9 +1436,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http", @@ -1406,9 +1456,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -1423,6 +1473,124 @@ dependencies = [ "tracing", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1431,22 +1599,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "idna" -version = "0.5.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1461,29 +1630,29 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1512,18 +1681,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" @@ -1536,10 +1705,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1568,7 +1738,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1614,6 +1784,12 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -1630,6 +1806,19 @@ version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lz4-sys" version = "1.11.1+lz4-1.10.0" @@ -1661,6 +1850,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "metrics" version = "0.23.0" @@ -1682,12 +1880,12 @@ dependencies = [ "hyper", "hyper-rustls", "hyper-util", - "indexmap 2.6.0", + "indexmap 2.7.1", "ipnet", "metrics", "metrics-util", "quanta", - "thiserror 1.0.66", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -1721,48 +1919,40 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] -[[package]] -name = "mirai-annotations" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" - [[package]] name = "moka" -version = "0.12.7" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "once_cell", + "loom", "parking_lot", - "quanta", + "portable-atomic", "rustc_version", "smallvec", "tagptr", - "thiserror 1.0.66", - "triomphe", + "thiserror 1.0.69", "uuid", ] @@ -1856,18 +2046,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "oorandom" @@ -1877,9 +2067,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "opentelemetry" @@ -1903,7 +2093,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror 1.0.66", + "thiserror 1.0.69", ] [[package]] @@ -1921,7 +2111,7 @@ dependencies = [ "opentelemetry_api", "percent-encoding", "rand", - "thiserror 1.0.66", + "thiserror 1.0.69", ] [[package]] @@ -1966,7 +2156,7 @@ dependencies = [ "backtrace", "cfg-if", "libc", - "petgraph", + "petgraph 0.6.5", "redox_syscall", "smallvec", "thread-id", @@ -1998,9 +2188,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -2008,22 +2198,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "pest_meta" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -2036,28 +2226,38 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset", - "indexmap 2.6.0", + "fixedbitset 0.4.2", + "indexmap 2.7.1", +] + +[[package]] +name = "petgraph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +dependencies = [ + "fixedbitset 0.5.7", + "indexmap 2.7.1", ] [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2144,7 +2344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2158,9 +2358,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", "prost-derive", @@ -2168,67 +2368,66 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "bytes", "heck", - "itertools 0.13.0", + "itertools 0.14.0", "log", "multimap", "once_cell", - "petgraph", + "petgraph 0.7.1", "prettyplease", "prost", "prost-types", "regex", - "syn 2.0.96", + "syn 2.0.98", "tempfile", ] [[package]] name = "prost-derive" -version = "0.13.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "prost-types" -version = "0.13.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ "prost", ] [[package]] name = "quanta" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", "once_cell", "raw-cpuid", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "web-sys", "winapi", ] [[package]] name = "quick_cache" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d7c94f8935a9df96bb6380e8592c70edf497a643f94bd23b2f76b399385dbf4" +checksum = "3f67cfc9c723c39f3615eb0840b00c4cb9e2b068d2fa761a30d845ec91730a59" dependencies = [ "ahash", "equivalent", @@ -2238,45 +2437,49 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "rustls", "socket2", - "thiserror 1.0.66", + "thiserror 2.0.11", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom 0.2.15", "rand", "ring", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "rustls", + "rustls-pki-types", "slab", - "thiserror 1.0.66", + "thiserror 2.0.11", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", @@ -2330,7 +2533,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -2344,9 +2547,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.2.0" +version = "11.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +checksum = "529468c1335c1c03919960dfefdb1b3648858c20d7ec2d0663e728e4a717efbc" dependencies = [ "bitflags", ] @@ -2373,9 +2576,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags", ] @@ -2386,9 +2589,9 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", - "thiserror 1.0.66", + "thiserror 1.0.69", ] [[package]] @@ -2437,9 +2640,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", @@ -2466,9 +2669,10 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", "tokio-rustls", + "tower", "tower-service", "url", "wasm-bindgen", @@ -2480,15 +2684,14 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] @@ -2526,9 +2729,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -2541,9 +2744,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags", "errno", @@ -2554,9 +2757,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "aws-lc-rs", "log", @@ -2570,12 +2773,11 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", @@ -2592,9 +2794,12 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -2610,15 +2815,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "same-file" @@ -2640,13 +2845,19 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -2661,9 +2872,9 @@ checksum = "b07779b9b918cc05650cb30f404d4d7835d26df37c235eded8a6832e2fb82cca" [[package]] name = "security-framework" -version = "2.11.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags", "core-foundation", @@ -2674,9 +2885,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -2684,37 +2895,37 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.1", "itoa", "memchr", "ryu", @@ -2804,26 +3015,20 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.7.3" @@ -2871,9 +3076,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -2882,17 +3087,22 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] [[package]] -name = "sync_wrapper" -version = "1.0.1" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "futures-core", + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -2907,7 +3117,7 @@ dependencies = [ "ntapi", "once_cell", "rayon", - "windows", + "windows 0.52.0", ] [[package]] @@ -2941,7 +3151,7 @@ dependencies = [ "serde", "static_assertions", "tarpc-plugins", - "thiserror 1.0.66", + "thiserror 1.0.69", "tokio", "tokio-serde", "tokio-util", @@ -2962,12 +3172,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.13.0" +version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ "cfg-if", "fastrand", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -2975,9 +3186,9 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", "windows-sys 0.59.0", @@ -2985,11 +3196,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.66", + "thiserror-impl 1.0.69", ] [[package]] @@ -3003,13 +3214,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3020,7 +3231,7 @@ checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3076,9 +3287,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -3097,14 +3308,24 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -3117,9 +3338,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -3152,8 +3373,8 @@ checksum = "4c1a51b272c6c86781e53fb392cc1e09aa857158ff8ef074ae13e926e1f5dd80" dependencies = [ "proc-macro2", "quote", - "rustc-hash 2.1.0", - "syn 2.0.96", + "rustc-hash 2.1.1", + "syn 2.0.98", "tl-scheme", ] @@ -3166,15 +3387,15 @@ dependencies = [ "crc", "pest", "pest_derive", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "thiserror 2.0.11", ] [[package]] name = "tokio" -version = "1.40.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -3190,23 +3411,22 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] @@ -3227,9 +3447,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -3238,9 +3458,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -3266,14 +3486,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -3282,9 +3502,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "async-compression", "bitflags", @@ -3330,7 +3550,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror 1.0.66", + "thiserror 1.0.69", "time", "tracing-subscriber", ] @@ -3343,7 +3563,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3393,9 +3613,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -3410,7 +3630,7 @@ dependencies = [ "Inflector", "serde", "serde_json", - "thiserror 1.0.66", + "thiserror 1.0.69", "time", "tracing-core", "tracing-subscriber", @@ -3418,9 +3638,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -3445,7 +3665,7 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3540,7 +3760,7 @@ dependencies = [ "everscale-types", "futures-util", "humantime", - "indexmap 2.6.0", + "indexmap 2.7.1", "metrics", "parking_lot", "rand", @@ -3708,7 +3928,7 @@ dependencies = [ "exponential-backoff", "futures-util", "hex", - "indexmap 2.6.0", + "indexmap 2.7.1", "metrics", "moka", "parking_lot", @@ -3744,8 +3964,10 @@ dependencies = [ "bytes", "everscale-types", "futures-util", + "hex", "metrics", "moka", + "num-bigint", "parking_lot", "prost", "serde", @@ -3761,6 +3983,7 @@ dependencies = [ "tycho-network", "tycho-storage", "tycho-util", + "tycho-vm", ] [[package]] @@ -3883,7 +4106,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3894,9 +4117,9 @@ checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "ucd-trie" @@ -3904,26 +4127,11 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-width" @@ -3939,15 +4147,27 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -3956,11 +4176,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" dependencies = [ - "getrandom", + "getrandom 0.3.1", ] [[package]] @@ -4006,49 +4226,59 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4056,28 +4286,41 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -4085,9 +4328,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ "rustls-pki-types", ] @@ -4154,7 +4397,17 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core", + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", "windows-targets 0.52.6", ] @@ -4167,6 +4420,41 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -4345,6 +4633,51 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4363,7 +4696,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure", ] [[package]] @@ -4372,6 +4726,28 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "zstd-safe" version = "7.2.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index df09bcd18..48e4dd637 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -17,8 +17,10 @@ base64 = { workspace = true } bytes = { workspace = true } everscale-types = { workspace = true } futures-util = { workspace = true } +hex = { workspace = true } metrics = { workspace = true } moka = { workspace = true } +num-bigint = "0.4" parking_lot = { workspace = true } prost = { workspace = true } serde = { workspace = true } @@ -28,6 +30,7 @@ tokio = { workspace = true, features = ["rt"] } tower = { workspace = true } tower-http = { workspace = true, features = ["cors", "timeout"] } tracing = { workspace = true } +tycho-vm = { workspace = true } # local deps tycho-block-util = { workspace = true } diff --git a/rpc/src/endpoint/error.rs b/rpc/src/endpoint/error.rs new file mode 100644 index 000000000..189543fcc --- /dev/null +++ b/rpc/src/endpoint/error.rs @@ -0,0 +1,73 @@ +use axum::http::StatusCode; +use axum::response::{IntoResponse, Response}; +use axum::Json; + +use crate::state::RpcStateError; + +pub type Result = std::result::Result; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("an internal server error occurred: {0}")] + Anyhow(#[from] anyhow::Error), + + #[error("serde error occurred")] + Serde(#[from] serde_json::Error), + + #[error("ever types error occurred")] + Ever(#[from] everscale_types::error::Error), + + #[error("rpc error occurred")] + Rpc(#[from] RpcStateError), + + #[error("bad request: {0}")] + BadRequest(&'static str), + + #[error("not found: {0}")] + NotFound(&'static str), +} + +impl Error { + fn status_code(&self) -> StatusCode { + match self { + Self::Anyhow(_) | Self::Ever(_) | Self::Rpc(_) => StatusCode::INTERNAL_SERVER_ERROR, + Self::Serde(_) | Self::BadRequest(_) => StatusCode::BAD_REQUEST, + Self::NotFound(_) => StatusCode::NOT_FOUND, + } + } +} +/// Axum allows you to return `Result` from handler functions, but the error type +/// also must be some sort of response type. +/// +/// By default, the generated `Display` impl is used to return a plaintext error message +/// to the client. +impl IntoResponse for Error { + fn into_response(self) -> Response { + match self { + Self::Anyhow(ref e) => { + tracing::error!("Generic error: {:?}", e); + } + Self::Serde(ref e) => { + tracing::error!("Failed to deserialize string {:?}", e); + } + Self::Ever(ref e) => { + tracing::error!("Internal error {:?}", e); + } + Self::Rpc(ref e) => { + tracing::error!("Internal error {:?}", e); + } + Self::BadRequest(ref e) => { + tracing::error!("Bad request: {:?}", e); + } + Self::NotFound(ref e) => { + tracing::error!("Not found: {:?}", e); + } + } + + ( + self.status_code(), + Json(serde_json::json!({"error": self.to_string(), "error_code": 0})), + ) + .into_response() + } +} diff --git a/rpc/src/endpoint/mod.rs b/rpc/src/endpoint/mod.rs index 545d086c9..8c334218c 100644 --- a/rpc/src/endpoint/mod.rs +++ b/rpc/src/endpoint/mod.rs @@ -11,8 +11,12 @@ pub use self::jrpc::JrpcEndpointCache; pub use self::proto::ProtoEndpointCache; use crate::state::RpcState; +mod error; mod jrpc; mod proto; +mod tonapi; +mod toncenter; +mod utils; pub struct RpcEndpoint { listener: TcpListener, @@ -45,6 +49,8 @@ impl RpcEndpoint { .route("/", post(common_route)) .route("/rpc", post(common_route)) .route("/proto", post(common_route)) + .nest("/v2", tonapi::router()) + .nest("/api/v2", toncenter::router()) .layer(service) .with_state(self.state); diff --git a/rpc/src/endpoint/tonapi/accounts.rs b/rpc/src/endpoint/tonapi/accounts.rs new file mode 100644 index 000000000..f56b70be7 --- /dev/null +++ b/rpc/src/endpoint/tonapi/accounts.rs @@ -0,0 +1,57 @@ +use axum::extract::{Path, State}; +use axum::routing::get; +use axum::Json; +use everscale_types::models::StdAddr; + +use super::responses::{status_to_string, GetAccountResponse}; +use crate::endpoint::error::{Error, Result}; +use crate::state::LoadedAccountState; +use crate::RpcState; + +pub fn router() -> axum::Router { + axum::Router::new().route("/accounts/:account", get(get_account)) +} + +async fn get_account( + Path(address): Path, + State(state): State, +) -> Result> { + let item = state.get_account_state(&address)?; + + match &item { + &LoadedAccountState::NotFound { .. } => Err(Error::NotFound("account not found")), + LoadedAccountState::Found { state, .. } => { + let account = state.load_account()?; + match account { + Some(loaded) => { + Ok(Json(GetAccountResponse { + address: address.to_string(), + balance: loaded.balance.tokens.into_inner() as u64, + extra_balance: None, // TODO: fill with correct extra balance + status: status_to_string(loaded.state.status()), + currencies_balance: Some( + loaded + .balance + .other + .as_dict() + .iter() + .filter_map(|res| res.ok()) + .map(|(id, balance)| (id, balance.as_usize() as u64)) + .collect(), + ), + last_activity: loaded.last_trans_lt, + interfaces: None, // TODO: fill with correct interfaces, + name: None, // TODO: fill with correct name, + is_scam: None, // TODO: fill with correct is_scam, + icon: None, // TODO: fill with correct icon, + memo_required: None, // TODO: fill with correct memo_required, + get_methods: vec![], // TODO: fill with correct get_methods, + is_suspended: None, // TODO: fill with correct is_suspended, + is_wallet: true, // TODO: fill with correct is_wallet, + })) + } + None => Err(Error::NotFound("account not found")), + } + } + } +} diff --git a/rpc/src/endpoint/tonapi/blockchain.rs b/rpc/src/endpoint/tonapi/blockchain.rs new file mode 100644 index 000000000..8d951cc0a --- /dev/null +++ b/rpc/src/endpoint/tonapi/blockchain.rs @@ -0,0 +1,359 @@ +use std::str::FromStr; + +use axum::extract::{Path, Query, State}; +use axum::routing::{get, post}; +use axum::Json; +use everscale_types::boc::Boc; +use everscale_types::cell::CellBuilder; +use everscale_types::models::{ + AccountState, ComputePhase, IntAddr, MsgInfo, OwnedMessage, StateInit, StdAddr, Transaction, + TxInfo, +}; +use num_bigint::BigInt; +use tycho_vm::{GasParams, NaN, OwnedCellSlice, RcStackValue, SmcInfoBase, VmState}; + +use super::requests::{ExecMethodArgs, Pagination, SendMessageRequest}; +use super::responses::{ + bounce_phase_to_string, status_to_string, AccountResponse, ExecGetMethodResponse, + LibraryResponse, TransactionAccountResponse, TransactionResponse, TransactionsResponse, + TvmStackRecord, +}; +use super::utils::crc_16; +use crate::endpoint::error::{Error, Result}; +use crate::state::LoadedAccountState; +use crate::RpcState; + +pub fn router() -> axum::Router { + axum::Router::new() + .route("/accounts/:account", get(get_blockchain_raw_account)) + .route( + "/accounts/:account/transactions", + get(get_blockchain_account_transactions), + ) + .route( + "/accounts/:account/methods/:method_name", + get(exec_get_method_for_blockchain_account), + ) + .route("/message", post(send_blockchain_message)) +} + +async fn get_blockchain_raw_account( + Path(address): Path, + State(state): State, +) -> Result> { + let item = state.get_account_state(&address)?; + + match &item { + &LoadedAccountState::NotFound { .. } => Err(Error::NotFound("account not found")), + LoadedAccountState::Found { state, .. } => { + let account = state.load_account()?; + match account { + Some(loaded) => { + let status = loaded.state.status(); + let (code, data, libraries, frozen_hash) = match loaded.state { + AccountState::Active(StateInit { + code, + data, + libraries, + .. + }) => ( + code.map(Boc::encode_hex), + data.map(Boc::encode_hex), + Some( + libraries + .iter() + .filter_map(|res| res.ok()) + .map(|(_, lib)| LibraryResponse { + public: lib.public, + root: Boc::encode_hex(lib.root), + }) + .collect(), + ), + None, + ), + AccountState::Uninit => (None, None, None, None), + AccountState::Frozen(hash_bytes) => { + (None, None, None, Some(hash_bytes.to_string())) + } + }; + + Ok(Json(AccountResponse { + address: address.to_string(), + balance: loaded.balance.tokens.into_inner() as u64, + extra_balance: None, // TODO: fill with correct extra balance + status: status_to_string(status), + code, + data, + last_transaction_lt: loaded.last_trans_lt, + last_transaction_hash: Some(state.last_trans_hash.to_string()), + frozen_hash, + libraries, + storage: loaded.storage_stat.into(), + })) + } + None => Err(Error::NotFound("account not found")), + } + } + } +} + +async fn get_blockchain_account_transactions( + Path(address): Path, + Query(pagination): Query, + State(state): State, +) -> Result> { + let limit = pagination.limit.unwrap_or(TransactionsResponse::MAX_LIMIT); + + if limit == 0 { + return Ok(Json(TransactionsResponse { + transactions: vec![], + })); + } + + if limit > TransactionsResponse::MAX_LIMIT { + return Err(Error::BadRequest("limit is too large")); + } + + let list = state.get_transactions(&address, pagination.after_lt)?; + let transactions = list + .map(|item| { + let root = Boc::decode(item).map_err(|e| anyhow::format_err!(e.to_string()))?; + let hash = *root.repr_hash(); + let t = root.parse::()?; + + let in_msg = if let Some(in_msg) = &t.in_msg { + let hash = *in_msg.repr_hash(); + let in_msg = in_msg.parse::()?; + Some((in_msg.info, Some(in_msg.body.0), hash).into()) + } else { + None + }; + + let mut out_msgs = vec![]; + + for out_msg_cell in t.out_msgs.values() { + let out_msg_cell = out_msg_cell?; + let out_msg_hash = *out_msg_cell.repr_hash(); + let out_msg_info = out_msg_cell.parse::()?; + out_msgs.push((out_msg_info, None, out_msg_hash).into()); + } + + let info = t.load_info()?; + + let transaction_type; + let compute_phase; + let credit_phase; + let storage_phase; + let action_phase; + let aborted; + let bounce_phase; + let destroyed; + let mut success = true; + + match info { + TxInfo::Ordinary(ordinary_tx_info) => { + transaction_type = "TransOrd".to_string(); + + compute_phase = match ordinary_tx_info.compute_phase { + ComputePhase::Skipped(skipped_compute_phase) => { + Some(skipped_compute_phase.into()) + } + ComputePhase::Executed(executed_compute_phase) => { + success = executed_compute_phase.success; + Some(executed_compute_phase.into()) + } + }; + storage_phase = ordinary_tx_info.storage_phase.map(From::from); + credit_phase = ordinary_tx_info.credit_phase.map(From::from); + action_phase = ordinary_tx_info.action_phase.map(From::from); + aborted = ordinary_tx_info.aborted; + bounce_phase = ordinary_tx_info.bounce_phase.map(bounce_phase_to_string); + destroyed = ordinary_tx_info.destroyed; + } + TxInfo::TickTock(tick_tock_tx_info) => { + transaction_type = "TransTickTock".to_string(); + compute_phase = match tick_tock_tx_info.compute_phase { + ComputePhase::Skipped(skipped_compute_phase) => { + Some(skipped_compute_phase.into()) + } + ComputePhase::Executed(executed_compute_phase) => { + success = executed_compute_phase.success; + Some(executed_compute_phase.into()) + } + }; + storage_phase = Some(tick_tock_tx_info.storage_phase.into()); + credit_phase = None; + action_phase = tick_tock_tx_info.action_phase.map(From::from); + aborted = tick_tock_tx_info.aborted; + bounce_phase = None; + destroyed = tick_tock_tx_info.destroyed; + } + } + + let state_update = t.state_update.load()?; + + Ok(TransactionResponse { + hash: hash.to_string(), + lt: t.lt, + account: TransactionAccountResponse { + address: address.to_string(), + name: None, + is_scam: false, // TODO: fill with correct is_scam + icon: None, + is_wallet: true, // TODO: fill with correct is_wallet + }, + success, + utime: t.now, + orig_status: status_to_string(t.orig_status), + end_status: status_to_string(t.end_status), + total_fees: t.total_fees.tokens.into_inner() as u64, + end_balance: 0, // TODO: fill with correct end_balance + transaction_type, + state_update_old: state_update.old.to_string(), + state_update_new: state_update.new.to_string(), + in_msg, + out_msgs, + block: "(-1,4234234,8000000000000000)".to_string(), // TODO: fill with correct block + prev_trans_hash: Some(t.prev_trans_hash.to_string()), + prev_trans_lt: Some(t.prev_trans_lt), + compute_phase, + storage_phase, + credit_phase, + action_phase, + bounce_phase, + aborted, + destroyed, + raw: Boc::encode_hex(root), + }) as Result + }) + .take(limit as _) + .collect::, _>>()?; + + Ok(Json(TransactionsResponse { transactions })) +} + +async fn exec_get_method_for_blockchain_account( + Path((address, method_name)): Path<(StdAddr, String)>, + Query(args): Query, + State(state): State, +) -> Result> { + let item = state.get_account_state(&address)?; + + match &item { + &LoadedAccountState::NotFound { .. } => Err(Error::NotFound("account not found")), + LoadedAccountState::Found { state, .. } => { + let account = state.load_account()?; + match account { + Some(loaded) => { + match loaded.state { + AccountState::Active(StateInit { code, data, .. }) => { + let smc_info = SmcInfoBase::new() + // .with_now(1733142533) // TODO: check if needed? + // .with_block_lt(50899537000013) // TODO: check if needed? + // .with_tx_lt(50899537000013) // TODO: check if needed? + .with_account_balance(loaded.balance) + .with_account_addr(IntAddr::Std(address.clone())) + .require_ton_v4(); + + let crc = crc_16(method_name.as_bytes()); + let method_id = crc as u32 | 0x10000; + + let mut stack = vec![RcStackValue::new_dyn_value( + OwnedCellSlice::from(CellBuilder::build_from(&address)?), + )]; + + let mut stack_response = vec![TvmStackRecord::Slice { + slice: address.to_string(), + }]; + + for arg in args.args { + if arg == "NaN" { + stack.push(RcStackValue::new_dyn_value(NaN)); + stack_response.push(TvmStackRecord::Nan); + continue; + } + + if arg == "Null" { + stack.push(RcStackValue::new_dyn_value(())); + stack_response.push(TvmStackRecord::Null); + continue; + } + + if let Ok(v) = BigInt::from_str(&arg) { + stack.push(RcStackValue::new_dyn_value(v)); + stack_response.push(TvmStackRecord::Num { num: arg }); + continue; + } + + if let Ok(v) = hex::decode(&arg) { + if let Some(v) = BigInt::parse_bytes(&v, 16) { + stack.push(RcStackValue::new_dyn_value(v)); + stack_response.push(TvmStackRecord::Num { num: arg }); + continue; + } + } + + if let Ok(cell) = Boc::decode_base64(&arg) { + stack.push(RcStackValue::new_dyn_value(OwnedCellSlice::from( + cell, + ))); + stack_response.push(TvmStackRecord::Cell { cell: arg }); + continue; + } + if let Ok(cell) = Boc::decode(&arg) { + stack.push(RcStackValue::new_dyn_value(OwnedCellSlice::from( + cell, + ))); + stack_response.push(TvmStackRecord::Slice { slice: arg }); + continue; + } + if let Ok(address) = IntAddr::from_str(&arg) { + stack.push(RcStackValue::new_dyn_value(OwnedCellSlice::from( + CellBuilder::build_from(&address)?, + ))); + stack_response.push(TvmStackRecord::Slice { slice: arg }); + continue; + } + } + + stack.push(RcStackValue::new_dyn_value(BigInt::from(method_id))); + stack_response.push(TvmStackRecord::Num { + num: method_id.to_string(), + }); + + let mut vm_state = VmState::builder() + .with_smc_info(smc_info) + .with_stack(stack) + .with_code(code.unwrap_or_default()) + .with_data(data.unwrap_or_default()) + .with_gas(GasParams::getter()) + .build(); + + let exit_code = vm_state.run(); + let success = exit_code == 0; + + Ok(Json(ExecGetMethodResponse { + success, + exit_code, + stack: stack_response, + decoded: None, + })) + } + _ => Err(Error::BadRequest("account has wrong state")), + } + } + None => Err(Error::NotFound("account not found")), + } + } + } +} + +async fn send_blockchain_message( + State(state): State, + Json(input): Json, +) -> Result> { + let data = + hex::decode(input.boc).map_err(|_e| Error::BadRequest("can not parse boc from hex"))?; + state.broadcast_external_message(&data).await; + Ok(Json(())) +} diff --git a/rpc/src/endpoint/tonapi/mod.rs b/rpc/src/endpoint/tonapi/mod.rs new file mode 100644 index 000000000..6fee722f3 --- /dev/null +++ b/rpc/src/endpoint/tonapi/mod.rs @@ -0,0 +1,12 @@ +use crate::RpcState; + +mod accounts; +mod blockchain; +mod requests; +mod responses; + +pub fn router() -> axum::Router { + axum::Router::new() + .nest("/accounts", accounts::router()) + .nest("/blockchain", blockchain::router()) +} diff --git a/rpc/src/endpoint/tonapi/requests/mod.rs b/rpc/src/endpoint/tonapi/requests/mod.rs new file mode 100644 index 000000000..00a93f6db --- /dev/null +++ b/rpc/src/endpoint/tonapi/requests/mod.rs @@ -0,0 +1,36 @@ +use serde::Deserialize; + +#[derive(Deserialize)] +pub(crate) struct Pagination { + pub(crate) after_lt: Option, + #[allow(unused)] + pub(crate) before_lt: Option, + pub(crate) limit: Option, + #[allow(unused)] + pub(crate) sort_order: Option, +} + +#[derive(Debug, Copy, Clone, Deserialize, Eq, PartialEq, Hash)] +pub(crate) enum Direction { + #[serde(rename = "asc")] + Ascending, + #[serde(rename = "desc")] + Descending, +} + +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +pub struct SendMessageRequest { + pub boc: String, + pub batch: Option>, + pub meta: Option, +} + +#[derive(Deserialize)] +pub(crate) struct ExecMethodArgs { + #[serde(default)] + #[allow(unused)] + pub(crate) args: Vec, + #[serde(default)] + #[allow(unused)] + pub(crate) fix_order: bool, +} diff --git a/rpc/src/endpoint/tonapi/responses/mod.rs b/rpc/src/endpoint/tonapi/responses/mod.rs new file mode 100644 index 000000000..5ceaeac1f --- /dev/null +++ b/rpc/src/endpoint/tonapi/responses/mod.rs @@ -0,0 +1,426 @@ +use std::collections::HashMap; + +use everscale_types::boc::Boc; +use everscale_types::cell::{Cell, HashBytes}; +use everscale_types::models::{ + AccountStatus, AccountStatusChange, ActionPhase, BouncePhase, ComputePhaseSkipReason, + CreditPhase, ExecutedComputePhase, MsgInfo, MsgType, SkippedComputePhase, StorageInfo, + StoragePhase, +}; +use serde::{Deserialize, Serialize}; + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct GetAccountResponse { + pub address: String, + pub balance: u64, + pub extra_balance: Option>, + pub currencies_balance: Option>, + pub last_activity: u64, + pub status: String, + pub interfaces: Option>, + pub name: Option, + pub is_scam: Option, + pub icon: Option, + pub memo_required: Option, + pub get_methods: Vec, + pub is_suspended: Option, + pub is_wallet: bool, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AccountResponse { + pub address: String, + pub balance: u64, + pub extra_balance: Option>, + pub code: Option, + pub data: Option, + pub last_transaction_lt: u64, + pub last_transaction_hash: Option, + pub frozen_hash: Option, + pub status: String, + pub storage: StorageResponse, + pub libraries: Option>, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct StorageResponse { + pub used_cells: u64, + pub used_bits: u64, + pub used_public_cells: u64, + pub last_paid: u32, + pub due_payment: Option, +} + +impl From for StorageResponse { + fn from(info: StorageInfo) -> Self { + Self { + used_cells: info.used.cells.into(), + used_bits: info.used.bits.into(), + used_public_cells: info.used.public_cells.into(), + last_paid: info.last_paid, + due_payment: info.due_payment.map(|v| v.into_inner() as u64), + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LibraryResponse { + pub public: bool, + pub root: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionsResponse { + pub transactions: Vec, +} + +impl TransactionsResponse { + pub const MAX_LIMIT: u8 = 100; +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionResponse { + pub hash: String, + pub lt: u64, + pub account: TransactionAccountResponse, + pub success: bool, + pub utime: u32, + pub orig_status: String, + pub end_status: String, + pub total_fees: u64, + pub end_balance: u64, + pub transaction_type: String, + pub state_update_old: String, + pub state_update_new: String, + pub in_msg: Option, + pub out_msgs: Vec, + pub block: String, + pub prev_trans_hash: Option, + pub prev_trans_lt: Option, + pub compute_phase: Option, + pub storage_phase: Option, + pub credit_phase: Option, + pub action_phase: Option, + pub bounce_phase: Option, + pub aborted: bool, + pub destroyed: bool, + pub raw: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionAccountResponse { + pub address: String, + pub name: Option, + pub is_scam: bool, + pub icon: Option, + pub is_wallet: bool, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MsgResponse { + pub msg_type: String, + pub created_lt: u64, + pub ihr_disabled: bool, + pub bounce: bool, + pub bounced: bool, + pub value: u64, + pub value_extra: Option>, + pub fwd_fee: u64, + pub ihr_fee: u64, + pub destination: Option, + pub source: Option, + pub import_fee: u64, + pub created_at: u32, + pub op_code: Option, + pub init: Option, + pub hash: String, + pub raw_body: Option, + pub decoded_op_name: Option, + pub decoded_body: Option, +} + +impl From<(MsgInfo, Option, HashBytes)> for MsgResponse { + fn from(msg: (MsgInfo, Option, HashBytes)) -> Self { + let (msg, body, hash) = msg; + match msg { + MsgInfo::Int(int_msg_info) => { + MsgResponse { + msg_type: msg_type_to_string(MsgType::Int), + created_lt: int_msg_info.created_lt, + ihr_disabled: int_msg_info.ihr_disabled, + bounce: int_msg_info.bounce, + bounced: int_msg_info.bounced, + value: int_msg_info.value.tokens.into_inner() as u64, + value_extra: None, // TODO: fill with correct value_extra + fwd_fee: int_msg_info.fwd_fee.into_inner() as u64, + ihr_fee: int_msg_info.ihr_fee.into_inner() as u64, + destination: Some(TransactionAccountResponse { + address: int_msg_info.dst.to_string(), + name: None, + is_scam: false, + icon: None, + is_wallet: true, + }), + source: Some(TransactionAccountResponse { + address: int_msg_info.src.to_string(), + name: None, + is_scam: false, + icon: None, + is_wallet: true, + }), + import_fee: 0u64, // TODO: fill with correct fees + created_at: int_msg_info.created_at, + op_code: None, // TODO: fill with correct values + init: None, // TODO: fill with correct values + hash: hash.to_string(), + raw_body: body.map(Boc::encode_hex), + decoded_op_name: None, // TODO: fill with correct values + decoded_body: None, // TODO: fill with correct values + } + } + MsgInfo::ExtIn(ext_in_msg) => { + MsgResponse { + msg_type: msg_type_to_string(MsgType::ExtIn), + created_lt: 0, + ihr_disabled: false, + bounce: false, + bounced: false, + value: 0u64, + value_extra: None, // TODO: fill with correct value_extra + fwd_fee: 0u64, + ihr_fee: 0u64, + destination: Some(TransactionAccountResponse { + address: ext_in_msg.dst.to_string(), + name: None, + is_scam: false, + icon: None, + is_wallet: true, + }), + source: None, + import_fee: ext_in_msg.import_fee.into_inner() as u64, + created_at: 0, + op_code: None, // TODO: fill with correct values + init: None, // TODO: fill with correct values + hash: hash.to_string(), + raw_body: body.map(Boc::encode_hex), + decoded_op_name: None, // TODO: fill with correct values + decoded_body: None, // TODO: fill with correct values + } + } + MsgInfo::ExtOut(ext_out_msg) => MsgResponse { + msg_type: msg_type_to_string(MsgType::ExtOut), + created_lt: ext_out_msg.created_lt, + ihr_disabled: false, + bounce: false, + bounced: false, + value: 0u64, + value_extra: None, // TODO: fill with correct value_extra + fwd_fee: 0u64, + ihr_fee: 0u64, + destination: None, + source: Some(TransactionAccountResponse { + address: ext_out_msg.src.to_string(), + name: None, + is_scam: false, + icon: None, + is_wallet: true, + }), + import_fee: 0, + created_at: ext_out_msg.created_at, + op_code: None, // TODO: fill with correct values + init: None, // TODO: fill with correct values + hash: hash.to_string(), + raw_body: body.map(Boc::encode_hex), + decoded_op_name: None, // TODO: fill with correct values + decoded_body: None, // TODO: fill with correct values + }, + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ValueExtraResponse { + pub amount: String, + pub preview: PreviewResponse, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct PreviewResponse { + pub id: u64, + pub symbol: String, + pub decimals: u64, + pub image: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct InitResponse { + pub boc: String, + pub interfaces: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ComputePhaseResponse { + pub skipped: bool, + pub skip_reason: Option, + pub success: Option, + pub gas_fees: Option, + pub gas_used: Option, + pub vm_steps: Option, + pub exit_code: Option, + pub exit_code_description: Option, +} + +impl From for ComputePhaseResponse { + fn from(value: SkippedComputePhase) -> Self { + ComputePhaseResponse { + skipped: true, + skip_reason: Some(reason_to_string(value.reason)), + success: None, + gas_fees: None, + gas_used: None, + vm_steps: None, + exit_code: None, + exit_code_description: None, + } + } +} + +impl From for ComputePhaseResponse { + fn from(value: ExecutedComputePhase) -> Self { + ComputePhaseResponse { + skipped: false, + skip_reason: None, + success: Some(value.success), + gas_fees: Some(value.gas_fees.into_inner() as u64), + gas_used: Some(value.gas_used.into_inner()), + vm_steps: Some(value.vm_steps), + exit_code: Some(value.exit_code), + exit_code_description: None, + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct StoragePhaseResponse { + pub fees_collected: u64, + pub fees_due: Option, + pub status_change: String, +} + +impl From for StoragePhaseResponse { + fn from(storage_phase: StoragePhase) -> Self { + StoragePhaseResponse { + fees_collected: storage_phase.storage_fees_collected.into_inner() as u64, + fees_due: storage_phase + .storage_fees_due + .map(|fees_due| fees_due.into_inner() as u64), + status_change: status_change_to_string(storage_phase.status_change), + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct CreditPhaseResponse { + pub fees_collected: Option, + pub credit: u64, +} + +impl From for CreditPhaseResponse { + fn from(credit_phase: CreditPhase) -> Self { + CreditPhaseResponse { + fees_collected: credit_phase + .due_fees_collected + .map(|fees_due| fees_due.into_inner() as u64), + credit: credit_phase.credit.tokens.into_inner() as u64, + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ActionPhaseResponse { + pub success: bool, + pub result_code: i32, + pub total_actions: u16, + pub skipped_actions: u16, + pub fwd_fees: u64, + pub total_fees: u64, + pub result_code_description: Option, +} + +impl From for ActionPhaseResponse { + fn from(action_phase: ActionPhase) -> Self { + ActionPhaseResponse { + success: action_phase.success, + result_code: action_phase.result_code, + total_actions: action_phase.total_actions, + skipped_actions: action_phase.skipped_actions, + fwd_fees: action_phase + .total_fwd_fees + .map(|total_fwd_fees| total_fwd_fees.into_inner() as u64) + .unwrap_or_default(), + total_fees: action_phase + .total_action_fees + .map(|total_action_fees| total_action_fees.into_inner() as u64) + .unwrap_or_default(), + result_code_description: None, + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ExecGetMethodResponse { + pub success: bool, + pub exit_code: i32, + pub stack: Vec, + pub decoded: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +#[serde(rename_all = "lowercase")] +pub enum TvmStackRecord { + Cell { cell: String }, + Slice { slice: String }, + Num { num: String }, + Null, + Nan, +} + +pub fn status_to_string(account_status: AccountStatus) -> String { + match account_status { + AccountStatus::Active => "active".to_string(), + AccountStatus::Frozen => "frozen".to_string(), + AccountStatus::Uninit => "uninit".to_string(), + AccountStatus::NotExists => "not_exists".to_string(), + } +} + +pub fn msg_type_to_string(account_status: MsgType) -> String { + match account_status { + MsgType::Int => "int_msg".to_string(), + MsgType::ExtIn => "ext_in_msg".to_string(), + MsgType::ExtOut => "ext_out_msg".to_string(), + } +} +pub fn reason_to_string(reason: ComputePhaseSkipReason) -> String { + match reason { + ComputePhaseSkipReason::NoState => "cskip_no_state".to_string(), + ComputePhaseSkipReason::BadState => "cskip_bad_state".to_string(), + ComputePhaseSkipReason::NoGas => "cskip_no_gas".to_string(), + ComputePhaseSkipReason::Suspended => "cskip_suspended".to_string(), // No Suspended in docs + } +} +pub fn status_change_to_string(status: AccountStatusChange) -> String { + match status { + AccountStatusChange::Unchanged => "acst_unchanged".to_string(), + AccountStatusChange::Frozen => "acst_frozen".to_string(), + AccountStatusChange::Deleted => "acst_deleted".to_string(), + } +} +pub fn bounce_phase_to_string(bounce: BouncePhase) -> String { + match bounce { + BouncePhase::NegativeFunds => "TrPhaseBounceNegfunds".to_string(), + BouncePhase::NoFunds(_) => "TrPhaseBounceNofunds".to_string(), + BouncePhase::Executed(_) => "TrPhaseBounceOk".to_string(), + } +} diff --git a/rpc/src/endpoint/toncenter/mod.rs b/rpc/src/endpoint/toncenter/mod.rs new file mode 100644 index 000000000..0b1d72569 --- /dev/null +++ b/rpc/src/endpoint/toncenter/mod.rs @@ -0,0 +1,325 @@ +use std::str::FromStr; +use std::vec; + +use axum::extract::{Path, Query, State}; +use axum::routing::{get, post}; +use axum::Json; +use everscale_types::boc::Boc; +use everscale_types::cell::CellBuilder; +use everscale_types::models::{ + AccountState, IntAddr, MsgInfo, OwnedMessage, StateInit, StdAddr, Transaction, +}; +use num_bigint::BigInt; +use requests::{AddressInformationQuery, ExecMethodArgs, GetTransactionsQuery, SendMessageRequest}; +use responses::{ + status_to_string, AddressInformation, AddressResponse, BlockId, TonCenterResponse, + TransactionId, TransactionResponse, TransactionsResponse, TvmStackRecord, +}; +use tycho_vm::{GasParams, NaN, OwnedCellSlice, RcStackValue, SmcInfoBase, VmState}; + +use super::utils::crc_16; +use crate::endpoint::error::{Error, Result}; +use crate::state::LoadedAccountState; +use crate::RpcState; + +mod requests; +mod responses; + +pub fn router() -> axum::Router { + axum::Router::new() + .route("/getAddressInformation", get(get_address_information)) + .route("/getTransactions", get(get_blockchain_account_transactions)) + .route("/runGetMethod", get(exec_get_method_for_blockchain_account)) + .route("/sendBoc", post(send_blockchain_message)) +} + +async fn get_address_information( + Query(address): Query, + State(state): State, +) -> Result>> { + let Ok(item) = state.get_account_state(&address.address) else { + return Ok(Json(TonCenterResponse { + ok: false, + result: None, + error: Some("account not found".to_string()), + code: None, + })); + }; + + match &item { + &LoadedAccountState::NotFound { .. } => Err(Error::NotFound("account not found")), + LoadedAccountState::Found { state, .. } => { + let Ok(account) = state.load_account() else { + return Ok(Json(TonCenterResponse { + ok: false, + result: None, + error: Some("account not found".to_string()), + code: None, + })); + }; + match account { + Some(loaded) => { + let status = loaded.state.status(); + let (code, data, frozen_hash) = match loaded.state { + AccountState::Active(StateInit { code, data, .. }) => { + (code.map(Boc::encode_hex), data.map(Boc::encode_hex), None) + } + AccountState::Uninit => (None, None, None), + AccountState::Frozen(hash_bytes) => { + (None, None, Some(hash_bytes.to_string())) + } + }; + + Ok(Json(TonCenterResponse { + ok: true, + result: Some(AddressInformation { + type_field: "raw.fullAccountState".to_string(), + balance: loaded.balance.tokens.into_inner() as u64, + code, + data, + last_transaction_id: TransactionId { + type_field: "internal.transactionId".to_string(), + lt: loaded.last_trans_lt.to_string(), + hash: Some(state.last_trans_hash.to_string()), + }, + block_id: BlockId { + type_field: "ton.blockIdExt".to_string(), + workchain: 0, // TODO: fix workchain + shard: "-9223372036854775808".to_string(), /* TODO: fix block_id shard */ + seqno: 44906584, // TODO: fix block_id seqno + root_hash: "tgbt6ZqC1bYk4m9yMYQDHLUeNrmWRNtb5r/mhHoB9RA=" + .to_string(), // TODO: fix block_id root_hash + file_hash: "4vkWnBWGIHiDy1Z7W2m+zcd/1HvZkGB1lCthVs07woM=" + .to_string(), // TODO: fix block_id file_hash + }, + frozen_hash, + sync_utime: 0, // TODO: fix sync utime + extra: "1739453311.547493:11:0.8618085632029536".to_string(), /* TODO: fix extra */ + state: status_to_string(status), + }), + error: None, + code: None, + })) + } + None => Ok(Json(TonCenterResponse { + ok: false, + result: None, + error: Some("account not found".to_string()), + code: None, + })), + } + } + } +} + +async fn get_blockchain_account_transactions( + Path(address): Path, + Query(pagination): Query, + State(state): State, +) -> Result>>> { + let limit = pagination + .limit + .unwrap_or(TransactionsResponse::DEFAULT_LIMIT); + + if limit == 0 { + return Ok(Json(TonCenterResponse { + ok: true, + result: Some(vec![]), + error: None, + code: None, + })); + } + + if limit > TransactionsResponse::MAX_LIMIT { + return Err(Error::BadRequest("limit is too large")); + } + + let list = state.get_transactions(&address, pagination.lt)?; + let transactions = list + .map(|item| { + let root = Boc::decode(item).map_err(|e| anyhow::format_err!(e.to_string()))?; + let hash = *root.repr_hash(); + let t = root.parse::()?; + + let in_msg = if let Some(in_msg) = &t.in_msg { + let hash = *in_msg.repr_hash(); + let in_msg = in_msg.parse::()?; + Some((in_msg.info, Some(in_msg.body.0), hash).into()) + } else { + None + }; + + let mut out_msgs = vec![]; + + for out_msg_cell in t.out_msgs.values() { + let out_msg_cell = out_msg_cell?; + let out_msg_hash = *out_msg_cell.repr_hash(); + let out_msg_info = out_msg_cell.parse::()?; + out_msgs.push((out_msg_info, None, out_msg_hash).into()); + } + + Ok(TransactionResponse { + type_field: "raw.transaction".to_string(), + address: AddressResponse { + type_field: "accountAddress".to_string(), + account_address: pagination.address.to_string(), + }, + data: Boc::encode_hex(root), + transaction_id: TransactionId { + type_field: "internal.transactionId".to_string(), + lt: t.lt.to_string(), + hash: Some(hash.to_string()), + }, + fee: (t.total_fees.tokens.into_inner() as u64).to_string(), // CHECK + storage_fee: 0.to_string(), // TODO: fill with correct storage_fee + other_fee: 0.to_string(), // TODO: fill with correct other_fee + utime: t.now, + in_msg, + out_msgs, + }) as Result + }) + .take(limit as _) + .collect::, _>>()?; + + Ok(Json(TonCenterResponse { + ok: true, + result: Some(transactions), + error: None, + code: None, + })) +} + +async fn exec_get_method_for_blockchain_account( + Query(args): Query, + State(state): State, +) -> Result>> { + let item = state.get_account_state(&args.address)?; + + match &item { + &LoadedAccountState::NotFound { .. } => Ok(Json(TonCenterResponse { + ok: false, + result: None, + error: Some("account not found".to_string()), + code: None, + })), + LoadedAccountState::Found { state, .. } => { + let account = state.load_account()?; + match account { + Some(loaded) => { + match loaded.state { + AccountState::Active(StateInit { code, data, .. }) => { + let smc_info = SmcInfoBase::new() + // .with_now(1733142533) // TODO: check if needed? + // .with_block_lt(50899537000013) // TODO: check if needed? + // .with_tx_lt(50899537000013) // TODO: check if needed? + .with_account_balance(loaded.balance) + .with_account_addr(IntAddr::Std(args.address.clone())) + .require_ton_v4(); + + let crc = crc_16(args.method.as_bytes()); + let method_id = crc as u32 | 0x10000; + + let mut stack = vec![RcStackValue::new_dyn_value( + OwnedCellSlice::from(CellBuilder::build_from(&args.address)?), + )]; + + let mut stack_response = vec![TvmStackRecord::Slice { + slice: args.address.to_string(), + }]; + + for args_stack in args.stack { + for arg in args_stack { + // TODO: check args + if arg == "NaN" { + stack.push(RcStackValue::new_dyn_value(NaN)); + stack_response.push(TvmStackRecord::Nan); + continue; + } + + if arg == "Null" { + stack.push(RcStackValue::new_dyn_value(())); + stack_response.push(TvmStackRecord::Null); + continue; + } + + if let Ok(v) = BigInt::from_str(&arg) { + stack.push(RcStackValue::new_dyn_value(v)); + stack_response.push(TvmStackRecord::Num { num: arg }); + continue; + } + + if let Ok(v) = hex::decode(&arg) { + if let Some(v) = BigInt::parse_bytes(&v, 16) { + stack.push(RcStackValue::new_dyn_value(v)); + stack_response.push(TvmStackRecord::Num { num: arg }); + continue; + } + } + + if let Ok(cell) = Boc::decode_base64(&arg) { + stack.push(RcStackValue::new_dyn_value( + OwnedCellSlice::from(cell), + )); + stack_response.push(TvmStackRecord::Cell { cell: arg }); + continue; + } + if let Ok(cell) = Boc::decode(&arg) { + stack.push(RcStackValue::new_dyn_value( + OwnedCellSlice::from(cell), + )); + stack_response.push(TvmStackRecord::Slice { slice: arg }); + continue; + } + if let Ok(address) = IntAddr::from_str(&arg) { + stack.push(RcStackValue::new_dyn_value( + OwnedCellSlice::from(CellBuilder::build_from( + &address, + )?), + )); + stack_response.push(TvmStackRecord::Slice { slice: arg }); + continue; + } + } + } + + stack.push(RcStackValue::new_dyn_value(BigInt::from(method_id))); + stack_response.push(TvmStackRecord::Num { + num: method_id.to_string(), + }); + + let mut vm_state = VmState::builder() + .with_smc_info(smc_info) + .with_stack(stack) + .with_code(code.unwrap_or_default()) + .with_data(data.unwrap_or_default()) + .with_gas(GasParams::getter()) + .build(); + + let exit_code = vm_state.run(); + let success = exit_code == 0; + + Ok(Json(TonCenterResponse { + ok: success, + result: None, // TODO: fill with correct result + error: None, + code: None, + })) + } + _ => Err(Error::BadRequest("account has wrong state")), + } + } + None => Err(Error::NotFound("account not found")), + } + } + } +} + +async fn send_blockchain_message( + State(state): State, + Json(input): Json, +) -> Result> { + let data = + hex::decode(input.boc).map_err(|_e| Error::BadRequest("can not parse boc from hex"))?; + state.broadcast_external_message(&data).await; + Ok(Json(())) +} diff --git a/rpc/src/endpoint/toncenter/requests/mod.rs b/rpc/src/endpoint/toncenter/requests/mod.rs new file mode 100644 index 000000000..6e9e332ca --- /dev/null +++ b/rpc/src/endpoint/toncenter/requests/mod.rs @@ -0,0 +1,42 @@ +use everscale_types::models::StdAddr; +use serde::Deserialize; + +#[derive(Deserialize)] +pub(crate) struct GetTransactionsQuery { + pub(crate) address: StdAddr, + pub(crate) limit: Option, + pub(crate) lt: Option, + #[allow(unused)] + pub(crate) to_lt: Option, + #[allow(unused)] + pub(crate) hash: Option, + #[allow(unused)] + pub(crate) archival: Option, +} + +#[derive(Deserialize)] +pub(crate) struct AddressInformationQuery { + pub address: StdAddr, +} + +#[derive(Debug, Copy, Clone, Deserialize, Eq, PartialEq, Hash)] +pub(crate) enum Direction { + #[serde(rename = "asc")] + Ascending, + #[serde(rename = "desc")] + Descending, +} + +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +pub struct SendMessageRequest { + pub boc: String, +} + +#[derive(Deserialize)] +pub(crate) struct ExecMethodArgs { + pub address: StdAddr, + pub method: String, + pub stack: Vec>, + #[allow(dead_code)] + pub seqno: i64, +} diff --git a/rpc/src/endpoint/toncenter/responses/mod.rs b/rpc/src/endpoint/toncenter/responses/mod.rs new file mode 100644 index 000000000..f671481ef --- /dev/null +++ b/rpc/src/endpoint/toncenter/responses/mod.rs @@ -0,0 +1,291 @@ +use std::collections::HashMap; + +use everscale_types::boc::Boc; +use everscale_types::cell::{Cell, HashBytes}; +use everscale_types::models::{AccountStatus, MsgInfo, StorageInfo}; +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TonCenterResponse { + pub ok: bool, + pub result: Option, + pub error: Option, + pub code: Option, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AddressInformation { + #[serde(rename = "@type")] + pub type_field: String, + pub balance: u64, + pub code: Option, + pub data: Option, + pub last_transaction_id: TransactionId, + pub block_id: BlockId, + pub frozen_hash: Option, + pub sync_utime: i64, + #[serde(rename = "@extra")] + pub extra: String, + pub state: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct BlockId { + #[serde(rename = "@type")] + pub type_field: String, + pub workchain: i64, + pub shard: String, + pub seqno: i64, + pub root_hash: String, + pub file_hash: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct GetAccountResponse { + pub address: String, + pub balance: u64, + pub extra_balance: Option>, + pub currencies_balance: Option>, + pub last_activity: u64, + pub status: String, + pub interfaces: Option>, + pub name: Option, + pub is_scam: Option, + pub icon: Option, + pub memo_required: Option, + pub get_methods: Vec, + pub is_suspended: Option, + pub is_wallet: bool, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AccountResponse { + pub address: String, + pub balance: u64, + pub extra_balance: Option>, + pub code: Option, + pub data: Option, + pub last_transaction_lt: u64, + pub last_transaction_hash: Option, + pub frozen_hash: Option, + pub status: String, + pub storage: StorageResponse, + pub libraries: Option>, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct StorageResponse { + pub used_cells: u64, + pub used_bits: u64, + pub used_public_cells: u64, + pub last_paid: u32, + pub due_payment: Option, +} + +impl From for StorageResponse { + fn from(info: StorageInfo) -> Self { + Self { + used_cells: info.used.cells.into(), + used_bits: info.used.bits.into(), + used_public_cells: info.used.public_cells.into(), + last_paid: info.last_paid, + due_payment: info.due_payment.map(|v| v.into_inner() as u64), + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LibraryResponse { + pub public: bool, + pub root: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionsResponse { + pub transactions: Vec, +} + +impl TransactionsResponse { + pub const MAX_LIMIT: u8 = 100; + pub const DEFAULT_LIMIT: u8 = 10; +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionResponse { + #[serde(rename = "@type")] + pub type_field: String, + pub address: AddressResponse, + pub utime: u32, + pub data: String, + pub transaction_id: TransactionId, + pub fee: String, + pub storage_fee: String, + pub other_fee: String, + pub in_msg: Option, + pub out_msgs: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AddressResponse { + #[serde(rename = "@type")] + pub type_field: String, + pub account_address: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionId { + #[serde(rename = "@type")] + pub type_field: String, + pub lt: String, + pub hash: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MsgResponse { + #[serde(rename = "@type")] + pub type_field: String, + pub hash: String, + pub source: Option, + pub destination: Option, + pub value: String, + pub extra_currencies: Vec, + pub fwd_fee: String, + pub ihr_fee: String, + pub created_lt: String, + pub body_hash: String, + pub msg_data: MsgDataResponse, + pub message: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum MsgDataResponse { + #[serde(rename = "msg.dataText")] + Text { text: String }, + #[serde(rename = "msg.dataRaw")] + Body { + body: Option, + init_state: String, + }, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TransactionAccountResponse { + pub address: String, + pub name: Option, + pub is_scam: bool, + pub icon: Option, + pub is_wallet: bool, +} + +impl From<(MsgInfo, Option, HashBytes)> for MsgResponse { + fn from(msg: (MsgInfo, Option, HashBytes)) -> Self { + let (msg, body, hash) = msg; + match msg { + MsgInfo::Int(int_msg_info) => { + MsgResponse { + type_field: "raw.message".to_string(), + hash: hash.to_string(), + source: Some(int_msg_info.src.to_string()), + destination: Some(int_msg_info.dst.to_string()), + created_lt: int_msg_info.created_lt.to_string(), + value: (int_msg_info.value.tokens.into_inner() as u64).to_string(), + fwd_fee: (int_msg_info.fwd_fee.into_inner() as u64).to_string(), + ihr_fee: (int_msg_info.ihr_fee.into_inner() as u64).to_string(), + extra_currencies: vec![], + body_hash: body.clone().unwrap_or_default().repr_hash().to_string(), + msg_data: MsgDataResponse::Body { + body: body.clone().map(Boc::encode_hex), + init_state: "".to_string(), + }, + message: body.map(Boc::encode_hex).unwrap_or_default(), /* TODO: fill with correct values */ + } + } + MsgInfo::ExtIn(ext_in_msg) => { + MsgResponse { + type_field: "raw.message".to_string(), + hash: hash.to_string(), + source: None, + destination: Some(ext_in_msg.dst.to_string()), + created_lt: "0".to_string(), + value: "0".to_string(), + fwd_fee: "0".to_string(), + ihr_fee: "0".to_string(), + extra_currencies: vec![], + body_hash: body.clone().unwrap_or_default().repr_hash().to_string(), + msg_data: MsgDataResponse::Body { + body: body.clone().map(Boc::encode_hex), + init_state: "".to_string(), + }, + message: body.map(Boc::encode_hex).unwrap_or_default(), /* TODO: fill with correct values */ + } + } + MsgInfo::ExtOut(ext_out_msg) => MsgResponse { + type_field: "raw.message".to_string(), + hash: hash.to_string(), + source: Some(ext_out_msg.src.to_string()), + destination: None, + created_lt: "0".to_string(), + value: "0".to_string(), + fwd_fee: "0".to_string(), + ihr_fee: "0".to_string(), + extra_currencies: vec![], + body_hash: body.clone().unwrap_or_default().repr_hash().to_string(), + msg_data: MsgDataResponse::Body { + body: body.clone().map(Boc::encode_hex), + init_state: "".to_string(), + }, + message: body.map(Boc::encode_hex).unwrap_or_default(), /* TODO: fill with correct values */ + }, + } + } +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ValueExtraResponse { + pub amount: String, + pub preview: PreviewResponse, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct PreviewResponse { + pub id: u64, + pub symbol: String, + pub decimals: u64, + pub image: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct InitResponse { + pub boc: String, + pub interfaces: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ExecGetMethodResponse { + pub success: bool, + pub exit_code: i32, + pub stack: Vec, + pub decoded: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +#[serde(rename_all = "lowercase")] +pub enum TvmStackRecord { + Cell { cell: String }, + Slice { slice: String }, + Num { num: String }, + Null, + Nan, +} + +pub fn status_to_string(account_status: AccountStatus) -> String { + match account_status { + AccountStatus::Active => "active".to_string(), + AccountStatus::Frozen => "frozen".to_string(), + AccountStatus::Uninit => "uninitialized".to_string(), + AccountStatus::NotExists => "not_exists".to_string(), + } +} diff --git a/rpc/src/endpoint/utils.rs b/rpc/src/endpoint/utils.rs new file mode 100644 index 000000000..13820afb1 --- /dev/null +++ b/rpc/src/endpoint/utils.rs @@ -0,0 +1,33 @@ +const CRC_TABLE: [u16; 256] = [ + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, + 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, + 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, + 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, + 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, + 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, + 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, + 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, + 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, + 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, + 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, + 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, + 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, + 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, + 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, + 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, + 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, + 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, +]; + +pub fn crc_16(data: &[u8]) -> u16 { + let mut crc: u32 = 0; + for c in data { + let t = c ^ ((crc >> 8) as u8); + crc = (CRC_TABLE[t as usize] ^ ((crc << 8) as u16)) as u32; + } + crc as u16 +}