From 0f6e0268c5cae2c8efa04e636aee0c101173c7bf Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Mon, 3 Jun 2024 21:18:19 +0800 Subject: [PATCH 1/7] feat: add address for sui --- Cargo.lock | 653 +++++++++++++++++++++++++++++++-- Cargo.toml | 5 + anychain-sui/Cargo.toml | 20 + anychain-sui/src/address.rs | 203 ++++++++++ anychain-sui/src/amount.rs | 3 + anychain-sui/src/format.rs | 15 + anychain-sui/src/lib.rs | 10 + anychain-sui/src/public_key.rs | 163 ++++++++ anychain-sui/src/utils.rs | 44 +++ 9 files changed, 1094 insertions(+), 22 deletions(-) create mode 100644 anychain-sui/Cargo.toml create mode 100644 anychain-sui/src/address.rs create mode 100644 anychain-sui/src/amount.rs create mode 100644 anychain-sui/src/format.rs create mode 100644 anychain-sui/src/lib.rs create mode 100644 anychain-sui/src/public_key.rs create mode 100644 anychain-sui/src/utils.rs diff --git a/Cargo.lock b/Cargo.lock index 5058877..f301374 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,9 +18,24 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli", + "gimli 0.27.3", ] +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.1", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aead" version = "0.5.2" @@ -304,6 +319,20 @@ dependencies = [ "libsecp256k1", ] +[[package]] +name = "anychain-sui" +version = "0.1.0" +dependencies = [ + "anychain-core", + "derive_more", + "fastcrypto", + "hex", + "rand", + "schemars", + "serde", + "serde_with", +] + [[package]] name = "anychain-tron" version = "0.2.3" @@ -423,6 +452,17 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "ark-secp256r1" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + [[package]] name = "ark-serialize" version = "0.4.2" @@ -480,12 +520,33 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "auto_ops" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7460f7dd8e100147b82a63afca1a20eb6c231ee36b90ba7272e14951cb58af59" + [[package]] name = "autocfg" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line 0.21.0", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object 0.32.2", + "rustc-demangle", +] + [[package]] name = "base-x" version = "0.2.11" @@ -543,19 +604,34 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.11.0", "rand", "rand_core 0.6.4", "serde", "unicode-normalization", ] +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +dependencies = [ + "bitcoin-private", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -665,7 +741,7 @@ dependencies = [ "bls12_381", "ff", "group", - "hkdf", + "hkdf 0.11.0", "pairing", "rand_core 0.6.4", "rayon", @@ -688,6 +764,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "blst" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bounded-collections" version = "0.2.0" @@ -773,6 +861,7 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", "windows-targets 0.52.5", ] @@ -886,6 +975,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -1071,6 +1175,54 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.4", + "subtle-ng", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.60", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.60", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -1097,6 +1249,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "pem-rfc7468 0.6.0", + "zeroize", +] + [[package]] name = "der" version = "0.7.9" @@ -1104,10 +1267,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", - "pem-rfc7468", + "pem-rfc7468 0.7.0", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1125,8 +1298,10 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ + "convert_case 0.4.0", "proc-macro2", "quote", + "rustc_version", "syn 1.0.109", ] @@ -1184,12 +1359,12 @@ version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der", + "der 0.7.9", "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", - "spki", + "spki 0.7.3", ] [[package]] @@ -1198,10 +1373,25 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8", + "pkcs8 0.10.2", "signature", ] +[[package]] +name = "ed25519-consensus" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" +dependencies = [ + "curve25519-dalek-ng", + "hex", + "rand_core 0.6.4", + "serde", + "sha2 0.9.9", + "thiserror", + "zeroize", +] + [[package]] name = "ed25519-dalek" version = "2.1.1" @@ -1248,8 +1438,8 @@ dependencies = [ "ff", "generic-array", "group", - "pem-rfc7468", - "pkcs8", + "pem-rfc7468 0.7.0", + "pkcs8 0.10.2", "rand_core 0.6.4", "sec1", "subtle", @@ -1345,12 +1535,86 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fallible-iterator" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fastcrypto" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9ea2139faa96e4d713803b7777b8fd2d5c245858b1644c08d3220f407149c6" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-secp256r1", + "ark-serialize", + "auto_ops", + "base64ct", + "bech32", + "bincode", + "blake2", + "blst", + "bs58 0.4.0", + "curve25519-dalek-ng", + "derive_more", + "digest 0.10.7", + "ecdsa", + "ed25519-consensus", + "elliptic-curve", + "eyre", + "fastcrypto-derive", + "generic-array", + "hex", + "hex-literal", + "hkdf 0.12.4", + "lazy_static", + "num-bigint", + "once_cell", + "p256", + "rand", + "readonly", + "rfc6979", + "rsa", + "schemars", + "secp256k1 0.27.0", + "serde", + "serde_json", + "serde_with", + "sha2 0.10.8", + "sha3", + "signature", + "static_assertions", + "thiserror", + "tokio", + "typenum", + "zeroize", +] + +[[package]] +name = "fastcrypto-derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c0c2af2157f416cb885e11d36cd0de2753f6d5384752d364075c835f5f8f891" +dependencies = [ + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "ff" version = "0.13.0" @@ -1392,6 +1656,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "forest_cid" version = "0.3.0" @@ -1623,6 +1893,7 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ + "serde", "typenum", "version_check", "zeroize", @@ -1660,6 +1931,18 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -1750,6 +2033,15 @@ dependencies = [ "hmac 0.11.0", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac 0.12.1", +] + [[package]] name = "hmac" version = "0.8.1" @@ -1813,6 +2105,12 @@ dependencies = [ "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -1870,6 +2168,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.9.3" @@ -1952,6 +2256,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] [[package]] name = "libc" @@ -1959,6 +2266,12 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "libsecp256k1" version = "0.7.1" @@ -2089,6 +2402,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + [[package]] name = "multibase" version = "0.8.0" @@ -2195,6 +2517,29 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" @@ -2236,6 +2581,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2243,6 +2599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2267,6 +2624,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -2374,6 +2740,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -2401,14 +2776,36 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +dependencies = [ + "der 0.6.1", + "pkcs8 0.9.0", + "spki 0.6.0", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.9", + "spki 0.7.3", ] [[package]] @@ -2454,6 +2851,12 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2666,6 +3069,17 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "readonly" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "redox_syscall" version = "0.5.1" @@ -2780,6 +3194,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rsa" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55a77d189da1fee555ad95b7e50e7457d91c0e089ec68ca69ad2989413bbdab4" +dependencies = [ + "byteorder", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sha2 0.10.8", + "signature", + "subtle", + "zeroize", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2866,6 +3301,31 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "either", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.60", +] + [[package]] name = "schnorrkel" version = "0.11.4" @@ -2898,20 +3358,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", - "der", + "der 0.7.9", "generic-array", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "bitcoin_hashes 0.12.0", + "rand", + "secp256k1-sys 0.8.1", +] + [[package]] name = "secp256k1" version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ - "secp256k1-sys", + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", ] [[package]] @@ -2976,6 +3456,17 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "serde_ipld_dagcbor" version = "0.2.2" @@ -3043,6 +3534,34 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "indexmap 1.9.3", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "sha2" version = "0.9.9" @@ -3140,7 +3659,7 @@ dependencies = [ "rand", "scale-info", "schnorrkel", - "secp256k1", + "secp256k1 0.28.2", "secrecy", "serde", "sp-crypto-hashing", @@ -3275,6 +3794,22 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -3282,7 +3817,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.9", ] [[package]] @@ -3337,6 +3872,12 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + [[package]] name = "syn" version = "1.0.109" @@ -3413,6 +3954,46 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -3437,6 +4018,28 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +dependencies = [ + "backtrace", + "pin-project-lite", + "tokio-macros", +] + +[[package]] +name = "tokio-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "toml" version = "0.5.11" @@ -3600,6 +4203,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -3753,7 +4362,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object", + "object 0.30.4", "once_cell", "paste", "psm", @@ -3783,10 +4392,10 @@ checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli", + "gimli 0.27.3", "indexmap 1.9.3", "log", - "object", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -3800,14 +4409,14 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli", + "gimli 0.27.3", "log", - "object", + "object 0.30.4", "rustc-demangle", "serde", "target-lexicon", diff --git a/Cargo.toml b/Cargo.toml index 13951f3..bc26815 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ members = [ "anychain-ripple", "anychain-neo", "anychain-kms", + "anychain-sui", "examples/*", ] @@ -66,6 +67,10 @@ once_cell = { version = "1.18.0" } subtle = { version = "2", default-features = false } p256 = "0.13.2" bs58 = { version = "0.4", default-features = false, features = ["check", "alloc"] } +schemars = { version = "0.8.10", features = ["either"] } +serde_with = { version = "2.1.0", features = ["hex"] } +derive_more = "0.99.17" +fastcrypto = { version = "0.1.8", features = ["copy_key"]} [profile.release] strip = true # Automatically strip symbols from the binary diff --git a/anychain-sui/Cargo.toml b/anychain-sui/Cargo.toml new file mode 100644 index 0000000..4f00b3d --- /dev/null +++ b/anychain-sui/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "anychain-sui" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +repository.workspace = true + +[dependencies] +anychain-core = { path = "../anychain-core", version = "0.1.4" } +schemars.workspace = true +serde = { workspace = true } +serde_with.workspace = true +derive_more.workspace = true +fastcrypto.workspace = true +hex = { workspace = true } + +[dev-dependencies] +rand = { workspace = true } \ No newline at end of file diff --git a/anychain-sui/src/address.rs b/anychain-sui/src/address.rs new file mode 100644 index 0000000..fc16f43 --- /dev/null +++ b/anychain-sui/src/address.rs @@ -0,0 +1,203 @@ +use crate::format::SuiFormat; +use crate::public_key::SuiPrivateKey; +use crate::{public_key::SuiPublicKey, utils::*}; +use anychain_core::{Address, AddressError, PublicKey}; + +use fastcrypto::encoding::Hex; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use serde_with::serde_as; +use std::{ + fmt::{Debug, Display}, + str::FromStr, +}; + +pub const SUI_ADDRESS_LENGTH: usize = 32; + +#[serde_as] +#[derive( + Eq, Default, PartialEq, Ord, PartialOrd, Copy, Clone, Hash, Serialize, Deserialize, JsonSchema, +)] +#[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))] +pub struct SuiAddress( + #[schemars(with = "Hex")] + #[serde_as(as = "Readable")] + [u8; SUI_ADDRESS_LENGTH], +); + +impl SuiAddress { + pub const ZERO: Self = Self([0u8; SUI_ADDRESS_LENGTH]); + + pub fn new(data: [u8; SUI_ADDRESS_LENGTH]) -> Self { + SuiAddress(data) + } + + /// Parse a SuiAddress from a byte array or buffer. + pub fn from_bytes>(bytes: T) -> Result { + <[u8; SUI_ADDRESS_LENGTH]>::try_from(bytes.as_ref()) + .map_err(|err| AddressError::InvalidAddress(format!("Parse bytes failed: {}", err))) + .map(SuiAddress) + } +} + +impl Address for SuiAddress { + type SecretKey = SuiPrivateKey; + type Format = SuiFormat; + type PublicKey = SuiPublicKey; + + fn from_secret_key( + secret_key: &Self::SecretKey, + format: &Self::Format, + ) -> Result { + Self::from_public_key(&SuiPublicKey::from_secret_key(secret_key), format) + } + + fn from_public_key( + public_key: &Self::PublicKey, + format: &Self::Format, + ) -> Result { + public_key.to_address(format) + } +} + +impl TryFrom<&[u8]> for SuiAddress { + type Error = AddressError; + + /// Tries to convert the provided byte array into a SuiAddress. + fn try_from(bytes: &[u8]) -> Result { + Self::from_bytes(bytes) + } +} + +impl TryFrom> for SuiAddress { + type Error = AddressError; + + /// Tries to convert the provided byte buffer into a SuiAddress. + fn try_from(bytes: Vec) -> Result { + Self::from_bytes(bytes) + } +} + +impl AsRef<[u8]> for SuiAddress { + fn as_ref(&self) -> &[u8] { + &self.0[..] + } +} + +impl FromStr for SuiAddress { + type Err = AddressError; + fn from_str(s: &str) -> Result + where + Self: Sized, + { + let s = s.strip_prefix("0x").unwrap_or(s); + hex::decode(s) + .map_err(|err| { + AddressError::InvalidAddress(format!( + "Sui address should be hex format but decode failed: {}", + err + )) + }) + .and_then(|bytes| SuiAddress::try_from(&bytes[..])) + } +} + +impl Display for SuiAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "0x{}", hex::encode(self.as_ref())) + } +} + +impl Debug for SuiAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "0x{}", hex::encode(self.as_ref())) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use fastcrypto::{ + ed25519::Ed25519KeyPair, + secp256k1::Secp256k1KeyPair, + secp256r1::Secp256r1KeyPair, + traits::{KeyPair, ToFromBytes}, + }; + + const SAMPLE_ADDRESS: &str = "af306e86c74e937552df132b41a6cb3af58559f5342c6e82a98f7d1f7a4a9f30"; + const SAMPLE_ADDRESS_VEC: [u8; 32] = [ + 175, 48, 110, 134, 199, 78, 147, 117, 82, 223, 19, 43, 65, 166, 203, 58, 245, 133, 89, 245, + 52, 44, 110, 130, 169, 143, 125, 31, 122, 74, 159, 48, + ]; + + #[test] + fn test_address_display() { + let hex = SAMPLE_ADDRESS; + let id = SuiAddress::from_str(hex).unwrap(); + + assert_eq!(id.0, SAMPLE_ADDRESS_VEC); + assert_eq!(format!("{:?}", id), format!("0x{hex}")); + } + + enum KeyType { + Ed25519, + Secp256k1, + Secp256r1, + } + + #[inline] + fn test_different_curve_address(expected_address: &str, key_type: KeyType, seed: &[u8]) { + let (sk, pk) = match key_type { + KeyType::Ed25519 => { + let keypair = Ed25519KeyPair::from_bytes(seed).unwrap(); + let sk = SuiPrivateKey::Ed25519(keypair.copy().private()); + let pk = SuiPublicKey::Ed25519(keypair.public().into()); + (sk, pk) + } + KeyType::Secp256k1 => { + let keypair = Secp256k1KeyPair::from_bytes(seed).unwrap(); + let sk = SuiPrivateKey::Secp256k1(keypair.copy().private()); + let pk = SuiPublicKey::Secp256k1(keypair.public().into()); + (sk, pk) + } + KeyType::Secp256r1 => { + let keypair = Secp256r1KeyPair::from_bytes(seed).unwrap(); + let sk = SuiPrivateKey::Secp256r1(keypair.copy().private()); + let pk = SuiPublicKey::Secp256r1(keypair.public().into()); + (sk, pk) + } + }; + + let address_from_secret_key = SuiAddress::from_secret_key(&sk, &SuiFormat::Hex); + assert!(address_from_secret_key.is_ok()); + assert_eq!( + address_from_secret_key.unwrap(), + SuiAddress::from_str(expected_address).unwrap() + ); + + let address_from_public_key = SuiAddress::from_public_key(&pk, &SuiFormat::Hex); + assert!(address_from_public_key.is_ok()); + assert_eq!( + address_from_public_key.unwrap(), + SuiAddress::from_str(expected_address).unwrap() + ); + } + + #[test] + fn test_address_ed25519() { + let expected_address = "0x29dfbf688abce7ab43bb8e70cae158ae961196e721440f515482f8ba1684390f"; + test_different_curve_address(expected_address, KeyType::Ed25519, &[1; 32]); + } + + #[test] + fn test_address_secp256k1() { + let expected_address = "0xf87edcc926ae7dded7f91ffddcb0ba6c9e3373946e89ec47e478c1bca90c750d"; + test_different_curve_address(expected_address, KeyType::Secp256k1, &[1; 32]); + } + + #[test] + fn test_address_secp256r1() { + let expected_address = "0x575dc0072a3309367790cb4415ddc87df5ffa4360ccd2c29f7ec0515026cc0e1"; + test_different_curve_address(expected_address, KeyType::Secp256r1, &[1; 32]); + } +} diff --git a/anychain-sui/src/amount.rs b/anychain-sui/src/amount.rs new file mode 100644 index 0000000..88bb6d0 --- /dev/null +++ b/anychain-sui/src/amount.rs @@ -0,0 +1,3 @@ +use anychain_core::{Amount, AmountError}; + +pub type SuiAmount = u64; diff --git a/anychain-sui/src/format.rs b/anychain-sui/src/format.rs new file mode 100644 index 0000000..a714797 --- /dev/null +++ b/anychain-sui/src/format.rs @@ -0,0 +1,15 @@ +use anychain_core::Format; +use std::fmt::Display; + +#[derive(Hash, Clone, PartialEq, PartialOrd, Eq, Ord, Debug)] +pub enum SuiFormat { + Hex, +} + +impl Format for SuiFormat {} + +impl Display for SuiFormat { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Hex") + } +} diff --git a/anychain-sui/src/lib.rs b/anychain-sui/src/lib.rs new file mode 100644 index 0000000..e8f1e61 --- /dev/null +++ b/anychain-sui/src/lib.rs @@ -0,0 +1,10 @@ +pub mod address; +pub use address::*; + +pub mod amount; + +pub mod public_key; +pub use public_key::*; + +pub mod format; +mod utils; diff --git a/anychain-sui/src/public_key.rs b/anychain-sui/src/public_key.rs new file mode 100644 index 0000000..1cb7b83 --- /dev/null +++ b/anychain-sui/src/public_key.rs @@ -0,0 +1,163 @@ +use crate::address::SuiAddress; +use crate::format::SuiFormat; +use anychain_core::{Address, AddressError, PublicKey, PublicKeyError}; + +use derive_more::{AsMut, AsRef, From}; +use fastcrypto::ed25519::{ + Ed25519KeyPair, Ed25519PrivateKey, Ed25519PublicKey, Ed25519PublicKeyAsBytes, Ed25519Signature, + Ed25519SignatureAsBytes, +}; +use fastcrypto::encoding::{Base64, Bech32, Encoding, Hex}; +use fastcrypto::hash::{Blake2b256, HashFunction}; +use fastcrypto::secp256k1::{ + Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes, Secp256k1Signature, + Secp256k1SignatureAsBytes, SECP256K1, +}; +use fastcrypto::secp256r1::{ + Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes, Secp256r1Signature, + Secp256r1SignatureAsBytes, +}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use std::{fmt::Display, str::FromStr}; + +#[allow(clippy::large_enum_variant)] +#[derive(Debug, From, PartialEq, Eq)] +pub enum SuiPrivateKey { + Ed25519(Ed25519PrivateKey), + Secp256k1(Secp256k1PrivateKey), + Secp256r1(Secp256r1PrivateKey), +} + +#[derive(Clone, Debug)] +pub enum SuiPublicKey { + Ed25519(Ed25519PublicKeyAsBytes), + Secp256k1(Secp256k1PublicKeyAsBytes), + Secp256r1(Secp256r1PublicKeyAsBytes), + // ZkLogin(ZkLoginPublicIdentifier), +} + +#[derive(Clone, Copy)] +pub enum SignatureScheme { + ED25519, + Secp256k1, + Secp256r1, + BLS12381, // This is currently not supported for user Sui Address. + MultiSig, + ZkLoginAuthenticator, +} + +impl SignatureScheme { + pub fn flag(&self) -> u8 { + match self { + SignatureScheme::ED25519 => 0x00, + SignatureScheme::Secp256k1 => 0x01, + SignatureScheme::Secp256r1 => 0x02, + SignatureScheme::MultiSig => 0x03, + SignatureScheme::BLS12381 => 0x04, // This is currently not supported for user Sui Address. + SignatureScheme::ZkLoginAuthenticator => 0x05, + } + } + + pub fn from_flag(flag: &str) -> Result { + let byte_int = flag + .parse::() + .map_err(|_| PublicKeyError::Crate("Invalid key scheme", flag.to_string()))?; + Self::from_flag_byte(&byte_int) + } + + pub fn from_flag_byte(byte_int: &u8) -> Result { + match byte_int { + 0x00 => Ok(SignatureScheme::ED25519), + 0x01 => Ok(SignatureScheme::Secp256k1), + 0x02 => Ok(SignatureScheme::Secp256r1), + 0x03 => Ok(SignatureScheme::MultiSig), + 0x04 => Ok(SignatureScheme::BLS12381), + 0x05 => Ok(SignatureScheme::ZkLoginAuthenticator), + _ => Err(PublicKeyError::Crate( + "Invalid key scheme", + byte_int.to_string(), + )), + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq, JsonSchema, Serialize, Deserialize)] +pub struct ZkLoginPublicIdentifier(#[schemars(with = "Base64")] pub Vec); + +impl PublicKey for SuiPublicKey { + type SecretKey = SuiPrivateKey; + type Address = SuiAddress; + type Format = SuiFormat; + + /// Returns the sui public key corresponding to the given secret key. + fn from_secret_key(secret_key: &Self::SecretKey) -> Self { + match secret_key { + Self::SecretKey::Ed25519(sk) => { + let pk = &Ed25519PublicKey::from(sk); + Self::Ed25519(pk.into()) + } + Self::SecretKey::Secp256k1(sk) => { + let pk = &Secp256k1PublicKey::from(sk); + Self::Secp256k1(pk.into()) + } + Self::SecretKey::Secp256r1(sk) => { + let pk = &Secp256r1PublicKey::from(sk); + Self::Secp256r1(pk.into()) + } + } + } + + fn to_address(&self, _format: &Self::Format) -> Result { + let mut hasher = Blake2b256::default(); + hasher.update([self.flag()]); + hasher.update(self); + let g_arr = hasher.finalize(); + Ok(SuiAddress::new(g_arr.digest)) + } +} + +impl AsRef<[u8]> for SuiPublicKey { + fn as_ref(&self) -> &[u8] { + match self { + SuiPublicKey::Ed25519(pk) => &pk.0, + SuiPublicKey::Secp256k1(pk) => &pk.0, + SuiPublicKey::Secp256r1(pk) => &pk.0, + // PublicKey::ZkLogin(z) => &z.0, + } + } +} + +impl SuiPublicKey { + pub fn flag(&self) -> u8 { + // self.scheme().flag() + let signature_scheme = match self { + SuiPublicKey::Ed25519(_) => SignatureScheme::ED25519, + SuiPublicKey::Secp256k1(_) => SignatureScheme::Secp256k1, + SuiPublicKey::Secp256r1(_) => SignatureScheme::Secp256r1, + }; + signature_scheme.flag() + } + + // pub fn scheme(&self) -> SignatureScheme { + // match self { + // SuiPublicKey::Ed25519(_) => Ed25519SuiSignature::SCHEME, + // SuiPublicKey::Secp256k1(_) => Secp256k1SuiSignature::SCHEME, + // SuiPublicKey::Secp256r1(_) => Secp256r1SuiSignature::SCHEME, + // // SuiPublicKey::ZkLogin(_) => SignatureScheme::ZkLoginAuthenticator, + // } + // } +} + +impl FromStr for SuiPublicKey { + type Err = PublicKeyError; + fn from_str(_s: &str) -> Result { + todo!() + } +} + +impl Display for SuiPublicKey { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + todo!() + } +} diff --git a/anychain-sui/src/utils.rs b/anychain-sui/src/utils.rs new file mode 100644 index 0000000..f25eef0 --- /dev/null +++ b/anychain-sui/src/utils.rs @@ -0,0 +1,44 @@ +use serde::de::{Deserializer, Error}; +use serde::ser::{Error as SerError, Serializer}; +use serde_with::{Bytes, DeserializeAs, SerializeAs}; + +use std::marker::PhantomData; + +pub struct Readable { + human_readable: PhantomData, + non_human_readable: PhantomData, +} + +impl SerializeAs for Readable +where + H: SerializeAs, + R: SerializeAs, +{ + fn serialize_as(value: &T, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + H::serialize_as(value, serializer) + } else { + R::serialize_as(value, serializer) + } + } +} + +impl<'de, R, H, T> DeserializeAs<'de, T> for Readable +where + H: DeserializeAs<'de, T>, + R: DeserializeAs<'de, T>, +{ + fn deserialize_as(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + H::deserialize_as(deserializer) + } else { + R::deserialize_as(deserializer) + } + } +} From 51c1714638963499aa60b6dc680e2de91e98d995 Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Tue, 4 Jun 2024 11:39:57 +0800 Subject: [PATCH 2/7] feat: add public key for sui --- anychain-sui/src/address.rs | 63 ++++++----- anychain-sui/src/amount.rs | 2 - anychain-sui/src/format.rs | 1 + anychain-sui/src/public_key.rs | 198 ++++++++++++++++++++++++++++----- anychain-sui/src/utils.rs | 6 +- 5 files changed, 207 insertions(+), 63 deletions(-) diff --git a/anychain-sui/src/address.rs b/anychain-sui/src/address.rs index fc16f43..eee8142 100644 --- a/anychain-sui/src/address.rs +++ b/anychain-sui/src/address.rs @@ -117,6 +117,7 @@ impl Debug for SuiAddress { #[cfg(test)] mod tests { use super::*; + use crate::public_key::SignatureScheme; use fastcrypto::{ ed25519::Ed25519KeyPair, secp256k1::Secp256k1KeyPair, @@ -124,80 +125,82 @@ mod tests { traits::{KeyPair, ToFromBytes}, }; - const SAMPLE_ADDRESS: &str = "af306e86c74e937552df132b41a6cb3af58559f5342c6e82a98f7d1f7a4a9f30"; - const SAMPLE_ADDRESS_VEC: [u8; 32] = [ - 175, 48, 110, 134, 199, 78, 147, 117, 82, 223, 19, 43, 65, 166, 203, 58, 245, 133, 89, 245, - 52, 44, 110, 130, 169, 143, 125, 31, 122, 74, 159, 48, + const SAMPLE_SEED: [u8; 32] = [ + 51, 95, 147, 235, 93, 221, 105, 227, 208, 198, 105, 132, 164, 28, 174, 83, 68, 231, 82, + 133, 50, 67, 181, 184, 126, 93, 85, 244, 135, 108, 205, 101, ]; #[test] fn test_address_display() { - let hex = SAMPLE_ADDRESS; - let id = SuiAddress::from_str(hex).unwrap(); + let sample_address = "af306e86c74e937552df132b41a6cb3af58559f5342c6e82a98f7d1f7a4a9f30"; + let address = SuiAddress::from_str(sample_address).unwrap(); - assert_eq!(id.0, SAMPLE_ADDRESS_VEC); - assert_eq!(format!("{:?}", id), format!("0x{hex}")); - } - - enum KeyType { - Ed25519, - Secp256k1, - Secp256r1, + let sample_address_vec: [u8; 32] = [ + 175, 48, 110, 134, 199, 78, 147, 117, 82, 223, 19, 43, 65, 166, 203, 58, 245, 133, 89, + 245, 52, 44, 110, 130, 169, 143, 125, 31, 122, 74, 159, 48, + ]; + assert_eq!(address.0, sample_address_vec); + assert_eq!(format!("{:?}", address), format!("0x{sample_address}")); } #[inline] - fn test_different_curve_address(expected_address: &str, key_type: KeyType, seed: &[u8]) { + fn check_different_curve_address( + expected_address: &str, + key_type: SignatureScheme, + seed: &[u8], + ) { let (sk, pk) = match key_type { - KeyType::Ed25519 => { + SignatureScheme::ED25519 => { let keypair = Ed25519KeyPair::from_bytes(seed).unwrap(); let sk = SuiPrivateKey::Ed25519(keypair.copy().private()); let pk = SuiPublicKey::Ed25519(keypair.public().into()); (sk, pk) } - KeyType::Secp256k1 => { + SignatureScheme::Secp256k1 => { let keypair = Secp256k1KeyPair::from_bytes(seed).unwrap(); let sk = SuiPrivateKey::Secp256k1(keypair.copy().private()); let pk = SuiPublicKey::Secp256k1(keypair.public().into()); (sk, pk) } - KeyType::Secp256r1 => { + SignatureScheme::Secp256r1 => { let keypair = Secp256r1KeyPair::from_bytes(seed).unwrap(); let sk = SuiPrivateKey::Secp256r1(keypair.copy().private()); let pk = SuiPublicKey::Secp256r1(keypair.public().into()); (sk, pk) } + _ => { + panic!("The public key type is not supported!"); + } }; - let address_from_secret_key = SuiAddress::from_secret_key(&sk, &SuiFormat::Hex); - assert!(address_from_secret_key.is_ok()); + let address_from_secret_key = SuiAddress::from_secret_key(&sk, &SuiFormat::Hex).unwrap(); assert_eq!( - address_from_secret_key.unwrap(), + address_from_secret_key, SuiAddress::from_str(expected_address).unwrap() ); - let address_from_public_key = SuiAddress::from_public_key(&pk, &SuiFormat::Hex); - assert!(address_from_public_key.is_ok()); + let address_from_public_key = SuiAddress::from_public_key(&pk, &SuiFormat::Hex).unwrap(); assert_eq!( - address_from_public_key.unwrap(), + address_from_public_key, SuiAddress::from_str(expected_address).unwrap() ); } #[test] fn test_address_ed25519() { - let expected_address = "0x29dfbf688abce7ab43bb8e70cae158ae961196e721440f515482f8ba1684390f"; - test_different_curve_address(expected_address, KeyType::Ed25519, &[1; 32]); + let expected_address = "0xb6e7529acddc998333f553c385d400c8be99746e2cd6cd9818e9a4475862df65"; + check_different_curve_address(expected_address, SignatureScheme::ED25519, &SAMPLE_SEED); } #[test] fn test_address_secp256k1() { - let expected_address = "0xf87edcc926ae7dded7f91ffddcb0ba6c9e3373946e89ec47e478c1bca90c750d"; - test_different_curve_address(expected_address, KeyType::Secp256k1, &[1; 32]); + let expected_address = "0x7607cd694df3a99be051c2400123fee106135086a192e1df7a2f344ea15bcd83"; + check_different_curve_address(expected_address, SignatureScheme::Secp256k1, &SAMPLE_SEED); } #[test] fn test_address_secp256r1() { - let expected_address = "0x575dc0072a3309367790cb4415ddc87df5ffa4360ccd2c29f7ec0515026cc0e1"; - test_different_curve_address(expected_address, KeyType::Secp256r1, &[1; 32]); + let expected_address = "0x73b4e70d671ba8171a1792d7d6116df4bd9870c6550ca4c6422f5e00396f82aa"; + check_different_curve_address(expected_address, SignatureScheme::Secp256r1, &SAMPLE_SEED); } } diff --git a/anychain-sui/src/amount.rs b/anychain-sui/src/amount.rs index 88bb6d0..b417efd 100644 --- a/anychain-sui/src/amount.rs +++ b/anychain-sui/src/amount.rs @@ -1,3 +1 @@ -use anychain_core::{Amount, AmountError}; - pub type SuiAmount = u64; diff --git a/anychain-sui/src/format.rs b/anychain-sui/src/format.rs index a714797..52f04a2 100644 --- a/anychain-sui/src/format.rs +++ b/anychain-sui/src/format.rs @@ -4,6 +4,7 @@ use std::fmt::Display; #[derive(Hash, Clone, PartialEq, PartialOrd, Eq, Ord, Debug)] pub enum SuiFormat { Hex, + Base64, } impl Format for SuiFormat {} diff --git a/anychain-sui/src/public_key.rs b/anychain-sui/src/public_key.rs index 1cb7b83..3e81550 100644 --- a/anychain-sui/src/public_key.rs +++ b/anychain-sui/src/public_key.rs @@ -1,22 +1,16 @@ use crate::address::SuiAddress; use crate::format::SuiFormat; -use anychain_core::{Address, AddressError, PublicKey, PublicKeyError}; +use anychain_core::{AddressError, PublicKey, PublicKeyError}; -use derive_more::{AsMut, AsRef, From}; +use derive_more::From; use fastcrypto::ed25519::{ - Ed25519KeyPair, Ed25519PrivateKey, Ed25519PublicKey, Ed25519PublicKeyAsBytes, Ed25519Signature, - Ed25519SignatureAsBytes, + Ed25519PrivateKey, Ed25519PublicKey, Ed25519PublicKeyAsBytes, ED25519_PUBLIC_KEY_LENGTH, }; -use fastcrypto::encoding::{Base64, Bech32, Encoding, Hex}; +use fastcrypto::encoding::{Base64, Encoding}; use fastcrypto::hash::{Blake2b256, HashFunction}; -use fastcrypto::secp256k1::{ - Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes, Secp256k1Signature, - Secp256k1SignatureAsBytes, SECP256K1, -}; -use fastcrypto::secp256r1::{ - Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes, Secp256r1Signature, - Secp256r1SignatureAsBytes, -}; +use fastcrypto::secp256k1::{Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes}; +use fastcrypto::secp256r1::{Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes}; +use fastcrypto::traits::ToFromBytes; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::{fmt::Display, str::FromStr}; @@ -34,7 +28,6 @@ pub enum SuiPublicKey { Ed25519(Ed25519PublicKeyAsBytes), Secp256k1(Secp256k1PublicKeyAsBytes), Secp256r1(Secp256r1PublicKeyAsBytes), - // ZkLogin(ZkLoginPublicIdentifier), } #[derive(Clone, Copy)] @@ -123,14 +116,12 @@ impl AsRef<[u8]> for SuiPublicKey { SuiPublicKey::Ed25519(pk) => &pk.0, SuiPublicKey::Secp256k1(pk) => &pk.0, SuiPublicKey::Secp256r1(pk) => &pk.0, - // PublicKey::ZkLogin(z) => &z.0, } } } impl SuiPublicKey { pub fn flag(&self) -> u8 { - // self.scheme().flag() let signature_scheme = match self { SuiPublicKey::Ed25519(_) => SignatureScheme::ED25519, SuiPublicKey::Secp256k1(_) => SignatureScheme::Secp256k1, @@ -139,25 +130,176 @@ impl SuiPublicKey { signature_scheme.flag() } - // pub fn scheme(&self) -> SignatureScheme { - // match self { - // SuiPublicKey::Ed25519(_) => Ed25519SuiSignature::SCHEME, - // SuiPublicKey::Secp256k1(_) => Secp256k1SuiSignature::SCHEME, - // SuiPublicKey::Secp256r1(_) => Secp256r1SuiSignature::SCHEME, - // // SuiPublicKey::ZkLogin(_) => SignatureScheme::ZkLoginAuthenticator, - // } - // } + fn encode_base64(&self) -> String { + let mut bytes: Vec = Vec::new(); + bytes.extend_from_slice(&[self.flag()]); + bytes.extend_from_slice(self.as_ref()); + Base64::encode(&bytes[..]) + } + + fn decode_base64(value: &str) -> Result { + let bytes = Base64::decode(value).map_err(|err| { + PublicKeyError::Crate( + "Decode Sui public key failed with error", + format!("{}", err), + ) + })?; + match bytes.first() { + Some(x) => { + if x == &SignatureScheme::ED25519.flag() { + let pk: Ed25519PublicKey = Ed25519PublicKey::from_bytes(bytes.get(1..).ok_or( + PublicKeyError::InvalidByteLength(ED25519_PUBLIC_KEY_LENGTH + 1), + )?) + .map_err(|err| { + PublicKeyError::Crate( + "Decode Ed25519 Sui public key failed", + format!("{}", err), + ) + })?; + Ok(SuiPublicKey::Ed25519((&pk).into())) + } else if x == &SignatureScheme::Secp256k1.flag() { + let pk = Secp256k1PublicKey::from_bytes(bytes.get(1..).ok_or( + PublicKeyError::InvalidByteLength(ED25519_PUBLIC_KEY_LENGTH + 1), + )?) + .map_err(|err| { + PublicKeyError::Crate( + "Decode Secp256k1 Sui public key failed", + format!("{}", err), + ) + })?; + Ok(SuiPublicKey::Secp256k1((&pk).into())) + } else if x == &SignatureScheme::Secp256r1.flag() { + let pk = Secp256r1PublicKey::from_bytes(bytes.get(1..).ok_or( + PublicKeyError::InvalidByteLength(ED25519_PUBLIC_KEY_LENGTH + 1), + )?) + .map_err(|err| { + PublicKeyError::Crate( + "Decode Secp256r1 Sui public key failed", + format!("{}", err), + ) + })?; + Ok(SuiPublicKey::Secp256r1((&pk).into())) + } else { + Err(PublicKeyError::Crate( + "Invalid public key input", + "".to_string(), + )) + } + } + _ => Err(PublicKeyError::Crate( + "Invalid public key input", + "".to_string(), + )), + } + } } impl FromStr for SuiPublicKey { type Err = PublicKeyError; - fn from_str(_s: &str) -> Result { - todo!() + fn from_str(s: &str) -> Result { + Self::decode_base64(s) } } impl Display for SuiPublicKey { - fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - todo!() + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.encode_base64()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use fastcrypto::{ + ed25519::Ed25519KeyPair, + secp256k1::Secp256k1KeyPair, + secp256r1::Secp256r1KeyPair, + traits::{KeyPair, ToFromBytes}, + }; + + const SAMPLE_ED25519_PK: &str = "AIhMzab/WG2MwPWJX+ojRNKRgXS7eERBLKh7jVzk2jrS"; + const SAMPLE_ED25519_ADDRESS: &str = + "0xb6e7529acddc998333f553c385d400c8be99746e2cd6cd9818e9a4475862df65"; + + const SAMPLE_SECP256K1_PK: &str = "AQKFqpb4i7Md3H0dWi16Xq3xHnwbCY6hqSiz8WSGd119AQ=="; + const SAMPLE_SECP256K1_ADDRESS: &str = + "0x7607cd694df3a99be051c2400123fee106135086a192e1df7a2f344ea15bcd83"; + + const SAMPLE_SECP256R1_PK: &str = "AgKEWLOwlrPvO8vwrm1RXxGKZeu221OcR7YIUrWGqsD4yw=="; + const SAMPLE_SECP256R1_ADDRESS: &str = + "0x73b4e70d671ba8171a1792d7d6116df4bd9870c6550ca4c6422f5e00396f82aa"; + + const SAMPLE_SEED: [u8; 32] = [ + 51, 95, 147, 235, 93, 221, 105, 227, 208, 198, 105, 132, 164, 28, 174, 83, 68, 231, 82, + 133, 50, 67, 181, 184, 126, 93, 85, 244, 135, 108, 205, 101, + ]; + + #[inline] + fn check_different_curve_pk(expected_pk: &str, key_type: SignatureScheme, seed: &[u8]) { + let sk = match key_type { + SignatureScheme::ED25519 => { + let keypair = Ed25519KeyPair::from_bytes(seed).unwrap(); + SuiPrivateKey::Ed25519(keypair.copy().private()) + } + SignatureScheme::Secp256k1 => { + let keypair = Secp256k1KeyPair::from_bytes(seed).unwrap(); + SuiPrivateKey::Secp256k1(keypair.copy().private()) + } + SignatureScheme::Secp256r1 => { + let keypair = Secp256r1KeyPair::from_bytes(seed).unwrap(); + SuiPrivateKey::Secp256r1(keypair.copy().private()) + } + _ => { + panic!("The public key type is not supported!"); + } + }; + + let pk_from_secret_key = SuiPublicKey::from_secret_key(&sk); + assert_eq!(expected_pk.to_string(), format!("{}", pk_from_secret_key)); + } + + #[inline] + fn check_pk_to_address(expected_addr: &str, pk: &str) { + let pk = SuiPublicKey::from_str(pk).unwrap(); + let addr = pk.to_address(&SuiFormat::Hex).unwrap(); + assert_eq!(expected_addr.to_string(), format!("{}", addr)); + } + + #[test] + fn test_ed25519_pk_from_secret_key() { + check_different_curve_pk(SAMPLE_ED25519_PK, SignatureScheme::ED25519, &SAMPLE_SEED); + } + + #[test] + fn test_ed25519_pk_address() { + check_pk_to_address(SAMPLE_ED25519_ADDRESS, SAMPLE_ED25519_PK); + } + + #[test] + fn test_secp256k1_pk_from_secret_key() { + check_different_curve_pk( + SAMPLE_SECP256K1_PK, + SignatureScheme::Secp256k1, + &SAMPLE_SEED, + ); + } + + #[test] + fn test_secp256k1_pk_address() { + check_pk_to_address(SAMPLE_SECP256K1_ADDRESS, SAMPLE_SECP256K1_PK); + } + + #[test] + fn test_secp256r1_pk_from_secret_key() { + check_different_curve_pk( + SAMPLE_SECP256R1_PK, + SignatureScheme::Secp256r1, + &SAMPLE_SEED, + ); + } + + #[test] + fn test_secp256r1_pk_address() { + check_pk_to_address(SAMPLE_SECP256R1_ADDRESS, SAMPLE_SECP256R1_PK); } } diff --git a/anychain-sui/src/utils.rs b/anychain-sui/src/utils.rs index f25eef0..ddc23c8 100644 --- a/anychain-sui/src/utils.rs +++ b/anychain-sui/src/utils.rs @@ -1,6 +1,6 @@ -use serde::de::{Deserializer, Error}; -use serde::ser::{Error as SerError, Serializer}; -use serde_with::{Bytes, DeserializeAs, SerializeAs}; +use serde::de::Deserializer; +use serde::ser::Serializer; +use serde_with::{DeserializeAs, SerializeAs}; use std::marker::PhantomData; From e309901a8927a742197d3d49685008daa498b8b6 Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Thu, 6 Jun 2024 10:48:09 +0800 Subject: [PATCH 3/7] feat: add amount for sui --- anychain-sui/src/amount.rs | 64 ++++++++++++++++++++++++++++++++- anychain-sui/src/lib.rs | 2 ++ anychain-sui/src/transaction.rs | 49 +++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 anychain-sui/src/transaction.rs diff --git a/anychain-sui/src/amount.rs b/anychain-sui/src/amount.rs index b417efd..a92c155 100644 --- a/anychain-sui/src/amount.rs +++ b/anychain-sui/src/amount.rs @@ -1 +1,63 @@ -pub type SuiAmount = u64; +use anychain_core::Amount; +use std::fmt; + +/// 1 SUI = 10^9 MIST +pub enum Denomination { + MIST, + SUI, +} + +impl Denomination { + fn precision(self) -> u32 { + match self { + Denomination::MIST => 0, + Denomination::SUI => 9, + } + } +} + +impl fmt::Display for Denomination { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "{}", + match self { + Denomination::MIST => "MIST", + Denomination::SUI => "SUI", + } + ) + } +} + +/// Sui balance representation +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] +pub struct SuiAmount(pub u64); + +impl Amount for SuiAmount {} + +impl fmt::Display for SuiAmount { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let denomination = Denomination::SUI; + let precision = 10_u64.pow(denomination.precision()); + let value = self.0 as f64 / precision as f64; + write!(f, "{} SUI", value) + } +} + +impl AsRef for SuiAmount { + fn as_ref(&self) -> &u64 { + &self.0 + } +} + +#[test] +fn amount_display() { + let sui = SuiAmount(12000); + println!("amount = {}", sui); + + let sui = SuiAmount(9_000_000_004); + println!("amount = {}", sui); + + let sui = SuiAmount(1); + println!("amount = {}", sui); +} diff --git a/anychain-sui/src/lib.rs b/anychain-sui/src/lib.rs index e8f1e61..b8af78c 100644 --- a/anychain-sui/src/lib.rs +++ b/anychain-sui/src/lib.rs @@ -8,3 +8,5 @@ pub use public_key::*; pub mod format; mod utils; + +pub mod transaction; diff --git a/anychain-sui/src/transaction.rs b/anychain-sui/src/transaction.rs new file mode 100644 index 0000000..296e56b --- /dev/null +++ b/anychain-sui/src/transaction.rs @@ -0,0 +1,49 @@ +use crate::{address::SuiAddress, format::SuiFormat, SuiPublicKey}; +use anychain_core::{Transaction, TransactionError, TransactionId}; +use std::fmt::Display; + +pub struct SuiTransactionParameters {} + +#[derive(Debug, Clone)] +pub struct SuiTransaction {} +impl Transaction for SuiTransaction { + type Address = SuiAddress; + type Format = SuiFormat; + type PublicKey = SuiPublicKey; + type TransactionId = SuiTransactionId; + type TransactionParameters = SuiTransactionParameters; + + fn new(parameters: &Self::TransactionParameters) -> Result { + todo!() + } + + fn sign( + &mut self, + signature: Vec, + recid: u8, + ) -> Result, anychain_core::TransactionError> { + todo!() + } + + fn from_bytes(transaction: &[u8]) -> Result { + todo!() + } + + fn to_bytes(&self) -> Result, anychain_core::TransactionError> { + todo!() + } + + fn to_transaction_id(&self) -> Result { + todo!() + } +} + +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct SuiTransactionId {} +impl TransactionId for SuiTransactionId {} + +impl Display for SuiTransactionId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + todo!() + } +} From 2055831cb6ede6ed7ab3e6cafca9e7e0bb6b1713 Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Fri, 7 Jun 2024 22:42:41 +0800 Subject: [PATCH 4/7] feat: add transaction for sui --- Cargo.lock | 4813 ++++++++++++++++++++++++++++--- Cargo.toml | 6 +- anychain-sui/Cargo.toml | 4 + anychain-sui/src/lib.rs | 3 + anychain-sui/src/network.rs | 28 + anychain-sui/src/public_key.rs | 19 +- anychain-sui/src/transaction.rs | 150 +- 7 files changed, 4612 insertions(+), 411 deletions(-) create mode 100644 anychain-sui/src/network.rs diff --git a/Cargo.lock b/Cargo.lock index f301374..b80bef5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + [[package]] name = "addr2line" version = "0.19.0" @@ -46,6 +57,31 @@ dependencies = [ "generic-array", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.7.8" @@ -78,6 +114,27 @@ dependencies = [ "memchr", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -93,6 +150,41 @@ dependencies = [ "libc", ] +[[package]] +name = "anemo" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "bytes", + "ed25519 1.5.3", + "futures", + "hex", + "http", + "matchit 0.5.0", + "pin-project-lite", + "pkcs8 0.9.0", + "quinn", + "quinn-proto", + "rand", + "rcgen", + "ring 0.16.20", + "rustls 0.21.12", + "rustls-webpki", + "serde", + "serde_json", + "socket2", + "tap", + "thiserror", + "tokio", + "tokio-util", + "tower", + "tracing", + "x509-parser", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -244,7 +336,7 @@ dependencies = [ "fvm_shared", "lazy_static", "libsecp256k1", - "num-bigint", + "num-bigint 0.4.4", "num-derive 0.3.3", "num-traits", "serde", @@ -305,7 +397,7 @@ dependencies = [ "blake2b_simd 1.0.2", "ed25519-dalek", "libsecp256k1", - "parity-scale-codec", + "parity-scale-codec 3.6.9", "serde_json", "sp-core", ] @@ -324,13 +416,17 @@ name = "anychain-sui" version = "0.1.0" dependencies = [ "anychain-core", + "bcs", "derive_more", "fastcrypto", "hex", "rand", "schemars", "serde", - "serde_with", + "serde_with 2.3.3", + "shared-crypto", + "sui-sdk 1.28.0", + "sui-types", ] [[package]] @@ -344,7 +440,7 @@ dependencies = [ "ethereum-types", "hex", "libsecp256k1", - "protobuf", + "protobuf 3.4.0", "serde", "sha2 0.10.8", "sha3", @@ -355,6 +451,9 @@ name = "anyhow" version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +dependencies = [ + "backtrace", +] [[package]] name = "ark-bls12-377" @@ -379,6 +478,35 @@ dependencies = [ "ark-std", ] +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2", + "derivative", + "digest 0.10.7", + "sha2 0.10.8", +] + [[package]] name = "ark-ec" version = "0.4.2" @@ -391,7 +519,7 @@ dependencies = [ "ark-std", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", "num-traits", "zeroize", ] @@ -408,8 +536,8 @@ dependencies = [ "ark-std", "derivative", "digest 0.10.7", - "itertools", - "num-bigint", + "itertools 0.10.5", + "num-bigint 0.4.4", "num-traits", "paste", "rustc_version", @@ -422,7 +550,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote", + "quote 1.0.36", "syn 1.0.109", ] @@ -432,13 +560,28 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint", + "num-bigint 0.4.4", "num-traits", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-relations", + "ark-serialize", + "ark-std", +] + [[package]] name = "ark-poly" version = "0.4.2" @@ -452,6 +595,17 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", +] + [[package]] name = "ark-secp256r1" version = "0.4.0" @@ -472,7 +626,7 @@ dependencies = [ "ark-serialize-derive", "ark-std", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.4", ] [[package]] @@ -481,11 +635,23 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff", + "ark-relations", + "ark-serialize", + "ark-std", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -520,6 +686,101 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "async-compression" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + [[package]] name = "auto_ops" version = "0.3.0" @@ -532,6 +793,59 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.21.7", + "bitflags 1.3.2", + "bytes", + "futures-util", + "headers", + "http", + "http-body", + "hyper", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.71" @@ -553,6 +867,12 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" @@ -577,12 +897,28 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bcs" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a" +dependencies = [ + "serde", + "thiserror", +] + [[package]] name = "bech32" version = "0.9.1" @@ -590,73 +926,180 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] -name = "bincode" -version = "1.3.3" +name = "beef" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" dependencies = [ "serde", ] [[package]] -name = "bip39" -version = "2.0.0" +name = "bellpepper" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "9ae286c2cb403324ab644c7cc68dceb25fe52ca9429908a726d7ed272c1edf7b" dependencies = [ - "bitcoin_hashes 0.11.0", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", + "bellpepper-core", + "byteorder", + "ff 0.13.0", ] [[package]] -name = "bitcoin-private" -version = "0.1.0" +name = "bellpepper-core" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" +checksum = "1d8abb418570756396d722841b19edfec21d4e89e1cf8990610663040ecb1aea" +dependencies = [ + "blake2s_simd", + "byteorder", + "ff 0.13.0", + "serde", + "thiserror", +] [[package]] -name = "bitcoin_hashes" -version = "0.11.0" +name = "better_any" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "b359aebd937c17c725e19efcb661200883f04c49c53e7132224dac26da39d4a0" +dependencies = [ + "better_typeid_derive", +] [[package]] -name = "bitcoin_hashes" -version = "0.12.0" +name = "better_typeid_derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +checksum = "3deeecb812ca5300b7d3f66f730cc2ebd3511c3d36c691dd79c165d5b19a26e3" dependencies = [ - "bitcoin-private", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "bitflags" -version = "1.3.2" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] [[package]] -name = "bitflags" -version = "2.5.0" +name = "bip32" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b" +dependencies = [ + "bs58 0.4.0", + "hmac 0.12.1", + "k256", + "once_cell", + "pbkdf2 0.11.0", + "rand_core 0.6.4", + "ripemd", + "sha2 0.10.8", + "subtle", + "zeroize", +] + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes 0.11.0", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + +[[package]] +name = "bitcoin_hashes" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +dependencies = [ + "bitcoin-private", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty 1.1.0", + "radium 0.6.2", + "tap", + "wyz 0.2.0", +] + [[package]] name = "bitvec" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "funty", - "radium", + "funty 2.0.0", + "radium 0.7.0", "tap", - "wyz", + "wyz 0.5.1", ] [[package]] @@ -732,6 +1175,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + [[package]] name = "bls-signatures" version = "0.14.0" @@ -739,8 +1191,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edceb821f01a1c93593fbbe47786e01c69c3141baa8e349366f15472b9252bc9" dependencies = [ "bls12_381", - "ff", - "group", + "ff 0.13.0", + "group 0.13.0", "hkdf 0.11.0", "pairing", "rand_core 0.6.4", @@ -757,8 +1209,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" dependencies = [ "digest 0.9.0", - "ff", - "group", + "ff 0.13.0", + "group 0.13.0", "pairing", "rand_core 0.6.4", "subtle", @@ -776,6 +1228,28 @@ dependencies = [ "zeroize", ] +[[package]] +name = "blstrs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a8a8ed6fefbeef4a8c7b460e4110e12c5e22a5b7cf32621aae6ad650c4dcf29" +dependencies = [ + "blst", + "byte-slice-cast", + "ff 0.13.0", + "group 0.13.0", + "pairing", + "rand_core 0.6.4", + "serde", + "subtle", +] + +[[package]] +name = "bnum" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" + [[package]] name = "bounded-collections" version = "0.2.0" @@ -783,11 +1257,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 3.6.9", "scale-info", "serde", ] +[[package]] +name = "brotli" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bs58" version = "0.4.0" @@ -806,6 +1301,16 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -818,6 +1323,18 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +[[package]] +name = "bytecount" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" + +[[package]] +name = "bytemuck" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" + [[package]] name = "byteorder" version = "1.5.0" @@ -829,6 +1346,18 @@ name = "bytes" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +dependencies = [ + "serde", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] [[package]] name = "cbor4ii" @@ -905,6 +1434,16 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clap" version = "4.5.4" @@ -924,7 +1463,8 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", + "terminal_size", ] [[package]] @@ -933,9 +1473,9 @@ version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", - "proc-macro2", - "quote", + "heck 0.5.0", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -945,12 +1485,67 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +[[package]] +name = "codespan" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3362992a0d9f1dd7c3d0e89e0ab2bb540b7a95fea8cd798090e758fda2899b5e" +dependencies = [ + "codespan-reporting", + "serde", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "serde", + "termcolor", + "unicode-width", +] + [[package]] name = "colorchoice" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "consensus-config" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "fastcrypto", + "mysten-network", + "rand", + "serde", + "shared-crypto", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -982,12 +1577,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] -name = "convert_case" -version = "0.6.0" +name = "core-foundation" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "unicode-segmentation", + "core-foundation-sys", + "libc", ] [[package]] @@ -1072,6 +1668,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1134,6 +1742,36 @@ dependencies = [ "serde", ] +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -1170,8 +1808,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -1188,14 +1826,38 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + [[package]] name = "darling" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.9", + "darling_macro 0.20.9", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.81", + "quote 1.0.36", + "strsim 0.10.0", + "syn 1.0.109", ] [[package]] @@ -1206,23 +1868,47 @@ checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", - "proc-macro2", - "quote", - "strsim", + "proc-macro2 1.0.81", + "quote 1.0.36", + "strsim 0.11.1", "syn 2.0.60", ] +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote 1.0.36", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ - "darling_core", - "quote", + "darling_core 0.20.9", + "quote 1.0.36", "syn 2.0.60", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -1271,6 +1957,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint 0.4.4", + "num-traits", + "rusticata-macros", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1287,24 +1987,41 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] [[package]] -name = "derive_more" -version = "0.99.17" +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", + "convert_case", + "proc-macro2 1.0.81", + "quote 1.0.36", "rustc_version", "syn 1.0.109", ] +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + [[package]] name = "digest" version = "0.9.0" @@ -1326,6 +2043,70 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -1342,8 +2123,8 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] @@ -1353,6 +2134,18 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -1361,12 +2154,23 @@ checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der 0.7.9", "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", "spki 0.7.3", ] +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "pkcs8 0.9.0", + "signature 1.6.4", + "zeroize", +] + [[package]] name = "ed25519" version = "2.2.3" @@ -1374,7 +2178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8 0.10.2", - "signature", + "signature 2.2.0", ] [[package]] @@ -1399,7 +2203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek 4.1.2", - "ed25519", + "ed25519 2.2.3", "serde", "sha2 0.10.8", "subtle", @@ -1426,26 +2230,51 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.5", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array", - "group", + "group 0.13.0", "pem-rfc7468 0.7.0", "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.34" @@ -1455,6 +2284,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-compat-util" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "serde_yaml", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + [[package]] name = "environmental" version = "1.1.4" @@ -1521,6 +2370,18 @@ dependencies = [ "uint", ] +[[package]] +name = "ethnum" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "expander" version = "2.1.0" @@ -1530,8 +2391,8 @@ dependencies = [ "blake2", "fs-err", "prettier-please", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -1554,9 +2415,10 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastcrypto" version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9ea2139faa96e4d713803b7777b8fd2d5c245858b1644c08d3220f407149c6" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=c101a5176799db3eb9c801b844e7add92153d291#c101a5176799db3eb9c801b844e7add92153d291" dependencies = [ + "aes", + "aes-gcm", "ark-ec", "ark-ff", "ark-secp256r1", @@ -1568,34 +2430,35 @@ dependencies = [ "blake2", "blst", "bs58 0.4.0", + "cbc", + "ctr", "curve25519-dalek-ng", "derive_more", "digest 0.10.7", - "ecdsa", + "ecdsa 0.16.9", "ed25519-consensus", - "elliptic-curve", - "eyre", + "elliptic-curve 0.13.8", "fastcrypto-derive", "generic-array", "hex", "hex-literal", "hkdf 0.12.4", "lazy_static", - "num-bigint", + "num-bigint 0.4.4", "once_cell", "p256", "rand", "readonly", - "rfc6979", + "rfc6979 0.4.0", "rsa", "schemars", "secp256k1 0.27.0", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "sha2 0.10.8", "sha3", - "signature", + "signature 2.2.0", "static_assertions", "thiserror", "tokio", @@ -1606,26 +2469,107 @@ dependencies = [ [[package]] name = "fastcrypto-derive" version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0c2af2157f416cb885e11d36cd0de2753f6d5384752d364075c835f5f8f891" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=c101a5176799db3eb9c801b844e7add92153d291#c101a5176799db3eb9c801b844e7add92153d291" dependencies = [ - "convert_case 0.6.0", - "proc-macro2", - "quote", + "quote 1.0.36", "syn 1.0.109", ] +[[package]] +name = "fastcrypto-tbls" +version = "0.1.0" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=c101a5176799db3eb9c801b844e7add92153d291#c101a5176799db3eb9c801b844e7add92153d291" +dependencies = [ + "bcs", + "digest 0.10.7", + "fastcrypto", + "hex", + "itertools 0.10.5", + "rand", + "serde", + "sha3", + "tap", + "tracing", + "typenum", +] + +[[package]] +name = "fastcrypto-zkp" +version = "0.1.3" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=c101a5176799db3eb9c801b844e7add92153d291#c101a5176799db3eb9c801b844e7add92153d291" +dependencies = [ + "ark-bls12-381", + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-groth16", + "ark-relations", + "ark-serialize", + "ark-snark", + "blst", + "byte-slice-cast", + "derive_more", + "fastcrypto", + "ff 0.13.0", + "im", + "itertools 0.12.1", + "lazy_static", + "neptune", + "num-bigint 0.4.4", + "once_cell", + "regex", + "reqwest", + "schemars", + "serde", + "serde_json", + "typenum", +] + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "bitvec", + "bitvec 1.0.1", + "byteorder", + "ff_derive", "rand_core 0.6.4", "subtle", ] +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + [[package]] name = "fiat-crypto" version = "0.2.8" @@ -1656,6 +2600,22 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1709,6 +2669,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "funty" version = "2.0.0" @@ -1770,8 +2736,8 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -1787,6 +2753,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + [[package]] name = "futures-util" version = "0.3.30" @@ -1877,7 +2849,7 @@ dependencies = [ "fvm_ipld_encoding 0.4.0", "lazy_static", "multihash 0.18.1", - "num-bigint", + "num-bigint 0.4.4", "num-derive 0.4.2", "num-integer", "num-traits", @@ -1920,6 +2892,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" version = "0.27.3" @@ -1943,17 +2925,62 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", + "rand", "rand_core 0.6.4", + "rand_xorshift", "subtle", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "1.8.3" @@ -1999,6 +3026,46 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hdrhistogram" +version = "7.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" +dependencies = [ + "byteorder", + "num-traits", +] + +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -2016,6 +3083,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -2083,7 +3153,125 @@ dependencies = [ ] [[package]] -name = "iana-time-zone" +name = "hmac-sha512" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e806677ce663d0a199541030c816847b36e8dc095f70dae4a4f4ad63da5383" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "log", + "rustls 0.20.9", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.23.4", + "webpki-roots 0.22.6", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "iana-time-zone" version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" @@ -2121,13 +3309,36 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec 2.3.1", +] + [[package]] name = "impl-codec" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.6.9", ] [[package]] @@ -2163,8 +3374,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] @@ -2193,6 +3404,32 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.5", + "serde", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "insta" +version = "1.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "pest", + "pest_derive", + "serde", + "similar", ] [[package]] @@ -2212,6 +3449,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "iri-string" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0f7638c1e223529f1bfdc48c8b133b9e0b434094d1d28473161ee48b235f78" +dependencies = [ + "nom", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.0" @@ -2227,6 +3479,24 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -2242,6 +3512,164 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json_to_table" +version = "0.6.0" +source = "git+https://github.com/zhiburt/tabled/?rev=e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4#e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4" +dependencies = [ + "serde_json", + "tabled", +] + +[[package]] +name = "jsonrpsee" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "jsonrpsee-ws-client", + "tracing", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.23.4", + "tokio-util", + "tracing", + "webpki-roots 0.22.6", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "anyhow", + "arrayvec 0.7.4", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "globset", + "hyper", + "jsonrpsee-types", + "parking_lot", + "rand", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls 0.23.2", + "jsonrpsee-core", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 1.1.3", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "futures-channel", + "futures-util", + "http", + "hyper", + "jsonrpsee-core", + "jsonrpsee-types", + "serde", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.16.2" +source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" +dependencies = [ + "http", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "keccak" version = "0.1.5" @@ -2257,9 +3685,15 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "libc" version = "0.2.154" @@ -2272,6 +3706,16 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + [[package]] name = "libsecp256k1" version = "0.7.1" @@ -2320,6 +3764,12 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -2347,6 +3797,18 @@ name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +dependencies = [ + "serde", +] + +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +dependencies = [ + "hashbrown 0.13.2", +] [[package]] name = "mach" @@ -2357,6 +3819,12 @@ dependencies = [ "libc", ] +[[package]] +name = "match_opt" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "405ba1524a1e6ae755334d6966380c60ec40157e0155f9032dd3c294b6384da9" + [[package]] name = "matchers" version = "0.0.1" @@ -2366,6 +3834,18 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "memchr" version = "2.7.2" @@ -2402,6 +3882,28 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.3" @@ -2411,6 +3913,357 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "move-abstract-interpreter" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "move-binary-format", + "move-bytecode-verifier-meter", +] + +[[package]] +name = "move-abstract-stack" +version = "0.0.1" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" + +[[package]] +name = "move-binary-format" +version = "0.0.3" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "enum-compat-util", + "move-core-types", + "move-proc-macros", + "ref-cast", + "serde", + "variant_count", +] + +[[package]] +name = "move-borrow-graph" +version = "0.0.1" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" + +[[package]] +name = "move-bytecode-source-map" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "move-binary-format", + "move-command-line-common", + "move-core-types", + "move-ir-types", + "move-symbol-pool", + "serde", +] + +[[package]] +name = "move-bytecode-utils" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "move-binary-format", + "move-core-types", + "petgraph", + "serde-reflection", +] + +[[package]] +name = "move-bytecode-verifier" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "move-abstract-interpreter", + "move-abstract-stack", + "move-binary-format", + "move-borrow-graph", + "move-bytecode-verifier-meter", + "move-core-types", + "move-vm-config", + "petgraph", +] + +[[package]] +name = "move-bytecode-verifier-meter" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "move-binary-format", + "move-core-types", + "move-vm-config", +] + +[[package]] +name = "move-command-line-common" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "difference", + "dirs-next", + "hex", + "move-core-types", + "num-bigint 0.4.4", + "once_cell", + "serde", + "sha2 0.9.9", + "vfs", + "walkdir", +] + +[[package]] +name = "move-compiler" +version = "0.0.1" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "clap", + "codespan-reporting", + "dunce", + "hex", + "move-binary-format", + "move-borrow-graph", + "move-bytecode-source-map", + "move-bytecode-verifier", + "move-command-line-common", + "move-core-types", + "move-ir-to-bytecode", + "move-ir-types", + "move-proc-macros", + "move-symbol-pool", + "once_cell", + "petgraph", + "regex", + "serde", + "serde_json", + "similar", + "stacker", + "tempfile", + "vfs", +] + +[[package]] +name = "move-core-types" +version = "0.0.4" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "enum-compat-util", + "ethnum", + "hex", + "leb128", + "move-proc-macros", + "num", + "once_cell", + "primitive-types 0.10.1", + "rand", + "ref-cast", + "serde", + "serde_bytes", + "thiserror", + "uint", +] + +[[package]] +name = "move-coverage" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "clap", + "codespan", + "colored", + "move-abstract-interpreter", + "move-binary-format", + "move-bytecode-source-map", + "move-command-line-common", + "move-core-types", + "move-ir-types", + "petgraph", + "serde", +] + +[[package]] +name = "move-disassembler" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "clap", + "colored", + "hex", + "move-abstract-interpreter", + "move-binary-format", + "move-bytecode-source-map", + "move-command-line-common", + "move-compiler", + "move-core-types", + "move-coverage", + "move-ir-types", +] + +[[package]] +name = "move-ir-to-bytecode" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "codespan-reporting", + "log", + "move-binary-format", + "move-bytecode-source-map", + "move-command-line-common", + "move-core-types", + "move-ir-to-bytecode-syntax", + "move-ir-types", + "move-symbol-pool", + "ouroboros", +] + +[[package]] +name = "move-ir-to-bytecode-syntax" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "hex", + "move-command-line-common", + "move-core-types", + "move-ir-types", + "move-symbol-pool", +] + +[[package]] +name = "move-ir-types" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "hex", + "move-command-line-common", + "move-core-types", + "move-symbol-pool", + "once_cell", + "serde", +] + +[[package]] +name = "move-proc-macros" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "enum-compat-util", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "move-symbol-pool" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "once_cell", + "phf", + "serde", +] + +[[package]] +name = "move-vm-config" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "move-binary-format", + "once_cell", +] + +[[package]] +name = "move-vm-profiler" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "move-vm-config", + "once_cell", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "move-vm-test-utils" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "move-binary-format", + "move-core-types", + "move-vm-profiler", + "move-vm-types", + "once_cell", + "serde", +] + +[[package]] +name = "move-vm-types" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "bcs", + "move-binary-format", + "move-core-types", + "move-vm-profiler", + "serde", + "smallvec", +] + +[[package]] +name = "msim-macros" +version = "0.1.0" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=077b735b484cf33e79f9d621db1d0c3a5827b81e#077b735b484cf33e79f9d621db1d0c3a5827b81e" +dependencies = [ + "darling 0.14.4", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase 0.9.1", + "multihash 0.17.0", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.7.2", + "url", +] + [[package]] name = "multibase" version = "0.8.0" @@ -2464,6 +4317,17 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "multihash-derive 0.8.1", + "unsigned-varint 0.7.2", +] + [[package]] name = "multihash" version = "0.18.1" @@ -2486,8 +4350,8 @@ checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro-error", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", "synstructure", ] @@ -2500,65 +4364,236 @@ checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro-error", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", "synstructure", ] [[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +name = "mysten-metrics" +version = "0.7.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "async-trait", + "axum", + "dashmap", + "futures", + "once_cell", + "parking_lot", + "prometheus", + "prometheus-closure-metric", + "scopeguard", + "tap", + "tokio", + "tracing", + "uuid", ] [[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +name = "mysten-network" +version = "0.2.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", + "anemo", + "bcs", + "bytes", + "eyre", + "futures", + "http", + "multiaddr", + "pin-project-lite", + "serde", + "snap", + "tokio", + "tokio-stream", + "tonic", + "tonic-health", + "tower", + "tower-http", + "tracing", ] [[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +name = "mysten-util-mem" +version = "0.11.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "cfg-if", + "ed25519-consensus", + "fastcrypto", + "fastcrypto-tbls", + "hashbrown 0.12.3", + "impl-trait-for-tuples", + "indexmap 2.2.6", + "mysten-util-mem-derive", + "once_cell", + "parking_lot", + "roaring", + "smallvec", +] [[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +name = "mysten-util-mem-derive" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", "syn 1.0.109", + "synstructure", ] [[package]] -name = "num-derive" +name = "narwhal-config" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "fastcrypto", + "match_opt", + "mysten-network", + "mysten-util-mem", + "narwhal-crypto", + "rand", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "narwhal-crypto" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "bcs", + "fastcrypto", + "serde", + "shared-crypto", +] + +[[package]] +name = "neptune" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06626c9ac04c894e9a23d061ba1309f28506cdc5fe64156d28a15fb57fc8e438" +dependencies = [ + "bellpepper", + "bellpepper-core", + "blake2s_simd", + "blstrs", + "byteorder", + "ff 0.13.0", + "generic-array", + "log", + "pasta_curves", + "serde", + "trait-set", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nonempty" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995defdca0a589acfdd1bd2e8e3b896b4d4f7675a31fd14c32611440c7f608e6" + +[[package]] +name = "num" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" +dependencies = [ + "num-bigint 0.4.4", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", + "rand", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "num-derive" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -2592,6 +4627,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint 0.4.4", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2612,6 +4658,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + [[package]] name = "object" version = "0.30.4" @@ -2633,6 +4700,45 @@ dependencies = [ "memchr", ] +[[package]] +name = "object_store" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f930c88a43b1c3f6e776dfe495b4afab89882dbc81530c632db2ed65451ebcb4" +dependencies = [ + "async-trait", + "base64 0.21.7", + "bytes", + "chrono", + "futures", + "humantime", + "hyper", + "itertools 0.11.0", + "parking_lot", + "percent-encoding", + "quick-xml", + "rand", + "reqwest", + "ring 0.16.20", + "rustls-pemfile", + "serde", + "serde_json", + "snafu", + "tokio", + "tracing", + "url", + "walkdir", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -2645,14 +4751,44 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "ouroboros" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" +dependencies = [ + "aliasable", + "ouroboros_macro", + "static_assertions", +] + +[[package]] +name = "ouroboros_macro" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + [[package]] name = "p256" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "primeorder", "sha2 0.10.8", ] @@ -2663,7 +4799,32 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" dependencies = [ - "group", + "group 0.13.0", +] + +[[package]] +name = "papergrid" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae7891b22598926e4398790c8fe6447930c72a67d36d983a49d6ce682ce83290" +dependencies = [ + "bytecount", + "fnv", + "unicode-width", +] + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.4", + "bitvec 0.20.4", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 2.3.1", + "serde", ] [[package]] @@ -2673,14 +4834,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec 0.7.4", - "bitvec", + "bitvec 1.0.1", "byte-slice-cast", "bytes", "impl-trait-for-tuples", - "parity-scale-codec-derive", + "parity-scale-codec-derive 3.6.9", "serde", ] +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + [[package]] name = "parity-scale-codec-derive" version = "3.6.9" @@ -2688,8 +4861,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ "proc-macro-crate 2.0.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] @@ -2716,6 +4889,23 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd 1.0.2", + "ff 0.13.0", + "group 0.13.0", + "hex", + "lazy_static", + "rand", + "serde", + "static_assertions", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -2731,6 +4921,15 @@ dependencies = [ "crypto-mac 0.11.0", ] +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "pbkdf2" version = "0.12.2" @@ -2740,6 +4939,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + [[package]] name = "pem-rfc7468" version = "0.6.0" @@ -2765,42 +4973,159 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "pin-project-lite" -version = "0.2.14" +name = "pest" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "pest_derive" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +dependencies = [ + "pest", + "pest_generator", +] [[package]] -name = "pkcs1" -version = "0.4.1" +name = "pest_generator" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ - "der 0.6.1", - "pkcs8 0.9.0", - "spki 0.6.0", - "zeroize", + "pest", + "pest_meta", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", ] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "pest_meta" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ - "der 0.6.1", - "spki 0.6.0", + "once_cell", + "pest", + "sha2 0.10.8", ] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "petgraph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +dependencies = [ + "fixedbitset", + "indexmap 1.9.3", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +dependencies = [ + "der 0.6.1", + "pkcs8 0.9.0", + "spki 0.6.0", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ @@ -2836,8 +5161,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" dependencies = [ "polkavm-common", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -2851,6 +5176,18 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2869,7 +5206,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.81", "syn 2.0.60", ] @@ -2879,7 +5216,19 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve", + "elliptic-curve 0.13.8", +] + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash 0.7.0", + "impl-codec 0.5.1", + "impl-serde 0.3.2", + "uint", ] [[package]] @@ -2889,7 +5238,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ "fixed-hash 0.7.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", "impl-serde 0.3.2", "uint", @@ -2902,7 +5251,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-serde 0.4.0", "scale-info", "uint", @@ -2943,8 +5292,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", "version_check", ] @@ -2955,11 +5304,20 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "version_check", ] +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.81" @@ -2969,6 +5327,94 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf 2.28.0", + "thiserror", +] + +[[package]] +name = "prometheus-closure-metric" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "prometheus", + "protobuf 2.28.0", +] + +[[package]] +name = "proptest" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.5.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.3", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "proptest-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +dependencies = [ + "bytes", +] + [[package]] name = "protobuf" version = "3.4.0" @@ -2998,15 +5444,94 @@ dependencies = [ "cc", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.21.12", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand", + "ring 0.16.20", + "rustc-hash", + "rustls 0.21.12", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.81", ] +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + [[package]] name = "radium" version = "0.7.0" @@ -3049,6 +5574,24 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + [[package]] name = "rayon" version = "1.10.0" @@ -3069,14 +5612,26 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + [[package]] name = "readonly" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3089,6 +5644,17 @@ dependencies = [ "bitflags 2.5.0", ] +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + [[package]] name = "ref-cast" version = "1.0.22" @@ -3104,8 +5670,8 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3154,25 +5720,109 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac 0.12.1", - "subtle", -] - -[[package]] -name = "ripemd" -version = "0.1.3" +name = "reqwest" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "digest 0.10.7", -] - -[[package]] + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls 0.24.2", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls 0.24.1", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] name = "rlp" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3189,11 +5839,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] +[[package]] +name = "roaring" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1c77081a55300e016cb86f2864415b7518741879db925b8d488a0ee0d2da6bf" +dependencies = [ + "bytemuck", + "byteorder", +] + [[package]] name = "rsa" version = "0.8.2" @@ -3210,7 +5870,7 @@ dependencies = [ "pkcs8 0.9.0", "rand_core 0.6.4", "sha2 0.10.8", - "signature", + "signature 2.2.0", "subtle", "zeroize", ] @@ -3242,6 +5902,15 @@ dependencies = [ "semver", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "0.36.17" @@ -3269,22 +5938,104 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct", + "webpki", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scale-info" version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" dependencies = [ - "bitvec", + "bitvec 1.0.1", "cfg-if", "derive_more", - "parity-scale-codec", + "parity-scale-codec 3.6.9", "scale-info-derive", "serde", ] @@ -3296,11 +6047,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" dependencies = [ "proc-macro-crate 1.1.3", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "schemars" version = "0.8.21" @@ -3320,8 +6080,8 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "serde_derive_internals", "syn 2.0.60", ] @@ -3351,13 +6111,36 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct", + "base16ct 0.2.0", "der 0.7.9", "generic-array", "pkcs8 0.10.2", @@ -3412,6 +6195,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.22" @@ -3436,6 +6242,27 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-name" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b5b14ebbcc4e4f2b3642fa99c388649da58d1dc3308c7d109f39f565d1710f0" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "serde-reflection" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05a5f801ac62a51a49d378fdb3884480041b99aced450b28990673e8ff99895" +dependencies = [ + "once_cell", + "serde", + "thiserror", +] + [[package]] name = "serde_bytes" version = "0.11.14" @@ -3451,8 +6278,8 @@ version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3462,8 +6289,8 @@ version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3497,19 +6324,30 @@ version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ + "indexmap 2.2.6", "itoa", "ryu", "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3529,11 +6367,23 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 1.0.109", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_with" version = "2.3.3" @@ -3550,18 +6400,69 @@ dependencies = [ "time", ] +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "serde", + "serde_derive", + "serde_json", + "time", +] + [[package]] name = "serde_with_macros" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling", - "proc-macro2", - "quote", + "darling 0.20.9", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] +[[package]] +name = "serde_yaml" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +dependencies = [ + "indexmap 1.9.3", + "ryu", + "serde", + "yaml-rust", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.9.9" @@ -3605,31 +6506,138 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-crypto" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "bcs", + "eyre", + "fastcrypto", + "serde", + "serde_repr", +] + [[package]] name = "signature" -version = "2.2.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", ] [[package]] -name = "slab" -version = "0.4.9" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "autocfg", + "digest 0.10.7", + "rand_core 0.6.4", ] [[package]] -name = "smallvec" +name = "similar" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slip10_ed25519" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be0ff28bf14f9610a342169084e87a4f435ad798ec528dc7579a3678fa9dc9a" +dependencies = [ + "hmac-sha512", +] + +[[package]] +name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "snafu" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" +dependencies = [ + "doc-comment", + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" +dependencies = [ + "heck 0.4.1", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "futures", + "http", + "httparse", + "log", + "rand", + "sha-1", +] + [[package]] name = "sp-core" version = "30.0.0" @@ -3648,11 +6656,11 @@ dependencies = [ "hash-db", "hash256-std-hasher", "impl-serde 0.4.0", - "itertools", + "itertools 0.10.5", "libsecp256k1", "log", "merlin", - "parity-scale-codec", + "parity-scale-codec 3.6.9", "parking_lot", "paste", "primitive-types 0.12.2", @@ -3696,8 +6704,8 @@ version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3708,7 +6716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" dependencies = [ "environmental", - "parity-scale-codec", + "parity-scale-codec 3.6.9", "sp-std", "sp-storage", ] @@ -3721,7 +6729,7 @@ checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ "bytes", "impl-trait-for-tuples", - "parity-scale-codec", + "parity-scale-codec 3.6.9", "polkavm-derive", "primitive-types 0.12.2", "sp-externalities", @@ -3742,8 +6750,8 @@ dependencies = [ "Inflector", "expander", "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3754,176 +6762,691 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] -name = "sp-storage" -version = "20.0.0" +name = "sp-storage" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +dependencies = [ + "impl-serde 0.4.0", + "parity-scale-codec 3.6.9", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-tracing" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +dependencies = [ + "parity-scale-codec 3.6.9", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-wasm-interface" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.6.9", + "sp-std", + "wasmtime", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der 0.7.9", +] + +[[package]] +name = "ss58-registry" +version = "1.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2 1.0.81", + "quote 1.0.36", + "serde", + "serde_json", + "unicode-xid 0.2.4", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stacker" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2 1.0.81", + "quote 1.0.36", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + +[[package]] +name = "sui-config" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anemo", + "anyhow", + "bcs", + "clap", + "csv", + "dirs", + "fastcrypto", + "narwhal-config", + "object_store", + "once_cell", + "prometheus", + "rand", + "reqwest", + "serde", + "serde_with 2.3.3", + "serde_yaml", + "sui-keys", + "sui-protocol-config", + "sui-types", + "tracing", +] + +[[package]] +name = "sui-enum-compat-util" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "serde_yaml", +] + +[[package]] +name = "sui-json" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "fastcrypto", + "move-binary-format", + "move-bytecode-utils", + "move-core-types", + "schemars", + "serde", + "serde_json", + "sui-types", +] + +[[package]] +name = "sui-json-rpc-api" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "fastcrypto", + "jsonrpsee", + "mysten-metrics", + "once_cell", + "prometheus", + "sui-json", + "sui-json-rpc-types", + "sui-open-rpc", + "sui-open-rpc-macros", + "sui-types", + "tap", + "tracing", +] + +[[package]] +name = "sui-json-rpc-types" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bcs", + "colored", + "enum_dispatch", + "fastcrypto", + "itertools 0.10.5", + "json_to_table", + "move-binary-format", + "move-bytecode-utils", + "move-core-types", + "mysten-metrics", + "schemars", + "serde", + "serde_json", + "serde_with 2.3.3", + "sui-enum-compat-util", + "sui-json", + "sui-macros", + "sui-package-resolver", + "sui-protocol-config", + "sui-types", + "tabled", + "tracing", +] + +[[package]] +name = "sui-keys" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "bip32", + "fastcrypto", + "rand", + "regex", + "serde", + "serde_json", + "shared-crypto", + "signature 1.6.4", + "slip10_ed25519", + "sui-types", + "tiny-bip39", +] + +[[package]] +name = "sui-macros" +version = "0.7.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "futures", + "once_cell", + "sui-proc-macros", + "tracing", +] + +[[package]] +name = "sui-open-rpc" +version = "1.28.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "bcs", + "schemars", + "serde", + "serde_json", + "versions", +] + +[[package]] +name = "sui-open-rpc-macros" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "derive-syn-parse", + "itertools 0.10.5", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "sui-package-resolver" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "async-trait", + "bcs", + "eyre", + "lru", + "move-binary-format", + "move-command-line-common", + "move-core-types", + "serde", + "sui-rest-api", + "sui-types", + "thiserror", + "tokio", +] + +[[package]] +name = "sui-proc-macros" +version = "0.7.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "msim-macros", + "proc-macro2 1.0.81", + "quote 1.0.36", + "sui-enum-compat-util", + "syn 2.0.60", +] + +[[package]] +name = "sui-protocol-config" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "clap", + "insta", + "move-vm-config", + "schemars", + "serde", + "serde_with 2.3.3", + "sui-protocol-config-macros", + "tracing", +] + +[[package]] +name = "sui-protocol-config-macros" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "sui-rest-api" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "async-trait", + "axum", + "bcs", + "fastcrypto", + "itertools 0.10.5", + "mime", + "mysten-network", + "prometheus", + "rand", + "reqwest", + "serde", + "serde_json", + "serde_with 2.3.3", + "sui-sdk 0.0.0", + "sui-types", + "tap", + "thiserror", +] + +[[package]] +name = "sui-sdk" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui-rust-sdk.git?rev=ec4236befe57c15fba0dae9e6881c18231882151#ec4236befe57c15fba0dae9e6881c18231882151" +dependencies = [ + "base64ct", + "bcs", + "bnum", + "bs58 0.5.1", + "hex", + "roaring", + "serde", + "serde_derive", + "serde_with 3.8.1", + "winnow 0.6.13", +] + +[[package]] +name = "sui-sdk" +version = "1.28.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.7", + "bcs", + "clap", + "colored", + "fastcrypto", + "futures", + "futures-core", + "jsonrpsee", + "move-core-types", + "reqwest", + "serde", + "serde_json", + "serde_with 2.3.3", + "shared-crypto", + "sui-config", + "sui-json", + "sui-json-rpc-api", + "sui-json-rpc-types", + "sui-keys", + "sui-transaction-builder", + "sui-types", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "sui-transaction-builder" +version = "0.0.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anyhow", + "async-trait", + "bcs", + "futures", + "move-binary-format", + "move-core-types", + "sui-json", + "sui-json-rpc-types", + "sui-protocol-config", + "sui-types", +] + +[[package]] +name = "sui-types" +version = "0.1.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "anemo", + "anyhow", + "bcs", + "better_any", + "bincode", + "byteorder", + "chrono", + "consensus-config", + "derivative", + "derive_more", + "enum_dispatch", + "eyre", + "fastcrypto", + "fastcrypto-tbls", + "fastcrypto-zkp", + "im", + "indexmap 2.2.6", + "itertools 0.10.5", + "jsonrpsee", + "lru", + "move-binary-format", + "move-bytecode-utils", + "move-command-line-common", + "move-core-types", + "move-disassembler", + "move-ir-types", + "move-vm-profiler", + "move-vm-test-utils", + "move-vm-types", + "mysten-metrics", + "mysten-network", + "narwhal-config", + "narwhal-crypto", + "nonempty", + "num-bigint 0.4.4", + "num-traits", + "num_enum", + "once_cell", + "parking_lot", + "prometheus", + "proptest", + "proptest-derive", + "rand", + "roaring", + "schemars", + "serde", + "serde-name", + "serde_json", + "serde_with 2.3.3", + "shared-crypto", + "signature 1.6.4", + "static_assertions", + "strum", + "strum_macros", + "sui-enum-compat-util", + "sui-macros", + "sui-protocol-config", + "sui-sdk 0.0.0", + "tap", + "thiserror", + "tonic", + "tracing", + "typed-store-error", +] + +[[package]] +name = "syn" +version = "0.15.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" dependencies = [ - "impl-serde 0.4.0", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", ] [[package]] -name = "sp-tracing" -version = "16.0.0" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "parity-scale-codec", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber", + "proc-macro2 1.0.81", + "quote 1.0.36", + "unicode-ident", ] [[package]] -name = "sp-wasm-interface" -version = "20.0.0" +name = "syn" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std", - "wasmtime", + "proc-macro2 1.0.81", + "quote 1.0.36", + "unicode-ident", ] [[package]] -name = "spin" -version = "0.5.2" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "spki" -version = "0.6.0" +name = "synstructure" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "base64ct", - "der 0.6.1", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", + "unicode-xid 0.2.4", ] [[package]] -name = "spki" -version = "0.7.3" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "base64ct", - "der 0.7.9", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "ss58-registry" -version = "1.47.0" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", + "core-foundation-sys", + "libc", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.11.1" +name = "tabled" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "0ce69a5028cd9576063ec1f48edb2c75339fd835e6094ef3e05b3a079bf594a6" +dependencies = [ + "papergrid", + "tabled_derive", + "unicode-width", +] [[package]] -name = "substrate-bip39" -version = "0.4.6" +name = "tabled_derive" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", - "sha2 0.9.9", - "zeroize", + "heck 0.4.1", + "proc-macro-error", + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "subtle" -version = "2.5.0" +name = "tap" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] -name = "subtle-ng" -version = "2.5.0" +name = "target-lexicon" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] -name = "syn" -version = "1.0.109" +name = "tempfile" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "cfg-if", + "fastrand", + "rustix 0.38.34", + "windows-sys 0.52.0", ] [[package]] -name = "syn" -version = "2.0.60" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "winapi-util", ] [[package]] -name = "synstructure" -version = "0.12.6" +name = "terminal_size" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", + "rustix 0.38.34", + "windows-sys 0.48.0", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - [[package]] name = "thiserror" version = "1.0.59" @@ -3939,8 +7462,8 @@ version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -3994,6 +7517,25 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand", + "rustc-hash", + "sha2 0.10.8", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -4025,57 +7567,235 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", "pin-project-lite", + "socket2", "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 2.0.60", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "tonic" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "tokio-macros" -version = "2.3.0" +name = "tonic-health" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "2cef6e24bc96871001a7e48e820ab240b3de2201e59b517cf52835df2f1d2350" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", + "async-stream", + "prost", + "tokio", + "tokio-stream", + "tonic", ] [[package]] -name = "toml" -version = "0.5.11" +name = "tower" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "serde", + "futures-core", + "futures-util", + "hdrhistogram", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "toml_datetime" -version = "0.6.5" +name = "tower-http" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +dependencies = [ + "async-compression", + "base64 0.13.1", + "bitflags 1.3.2", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "httpdate", + "iri-string", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower", + "tower-layer", + "tower-service", + "tracing", + "uuid", +] [[package]] -name = "toml_edit" -version = "0.20.7" +name = "tower-layer" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] -name = "toml_edit" -version = "0.21.1" +name = "tower-service" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" @@ -4083,6 +7803,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4094,8 +7815,8 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -4152,6 +7873,42 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "trait-set" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79e2e9c9ab44c6d7c20d5976961b47e8f49ac199154daa514b77cd1ab536625" +dependencies = [ + "proc-macro2 1.0.81", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -4164,12 +7921,27 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "typed-store-error" +version = "0.4.0" +source = "git+https://github.com/mystenlabs/sui?rev=f1a2d61bebdf83f01b58830e4768631bd28ce48a#f1a2d61bebdf83f01b58830e4768631bd28ce48a" +dependencies = [ + "serde", + "thiserror", +] + [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "uint" version = "0.9.5" @@ -4182,6 +7954,27 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4204,10 +7997,16 @@ dependencies = [ ] [[package]] -name = "unicode-segmentation" -version = "1.11.0" +name = "unicode-width" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" @@ -4215,6 +8014,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsigned-varint" version = "0.5.1" @@ -4227,6 +8036,18 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.0" @@ -4238,24 +8059,66 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +dependencies = [ + "getrandom", + "rand", +] + [[package]] name = "valuable" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "variant_count" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae2faf80ac463422992abf4de234731279c058aaf33171ca70277c98406b124" +dependencies = [ + "quote 1.0.36", + "syn 1.0.109", +] + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "versions" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee97e1d97bd593fb513912a07691b742361b3dd64ad56f2c694ea2dbfe0665d3" +dependencies = [ + "itertools 0.10.5", + "nom", +] + +[[package]] +name = "vfs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e4fe92cfc1bad19c19925d5eee4b30584dbbdee4ff10183b261acccbef74e2d" + [[package]] name = "w3f-bls" version = "0.1.3" @@ -4280,6 +8143,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4305,19 +8196,31 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ - "quote", + "quote 1.0.36", "wasm-bindgen-macro-support", ] @@ -4327,8 +8230,8 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -4340,6 +8243,19 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasmparser" version = "0.102.0" @@ -4482,6 +8398,41 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "winapi" version = "0.3.9" @@ -4498,6 +8449,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -4727,6 +8687,31 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "wyz" version = "0.5.1" @@ -4736,6 +8721,42 @@ dependencies = [ "tap", ] +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + [[package]] name = "zerocopy" version = "0.7.33" @@ -4751,8 +8772,8 @@ version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f4b6c273f496d8fd4eaf18853e6b448760225dc030ff2c485a786859aea6393" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] @@ -4771,7 +8792,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.81", + "quote 1.0.36", "syn 2.0.60", ] diff --git a/Cargo.toml b/Cargo.toml index bc26815..b62fd4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,11 @@ bs58 = { version = "0.4", default-features = false, features = ["check", "alloc" schemars = { version = "0.8.10", features = ["either"] } serde_with = { version = "2.1.0", features = ["hex"] } derive_more = "0.99.17" -fastcrypto = { version = "0.1.8", features = ["copy_key"]} +bcs = "0.1.6" +fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", features = ["copy_key"], rev = "c101a5176799db3eb9c801b844e7add92153d291" } +sui_sdk = { git = "https://github.com/mystenlabs/sui", package = "sui-sdk", rev = "f1a2d61bebdf83f01b58830e4768631bd28ce48a"} +sui_types = { git = "https://github.com/mystenlabs/sui", package = "sui-types", rev = "f1a2d61bebdf83f01b58830e4768631bd28ce48a"} +shared_crypto = { git = "https://github.com/mystenlabs/sui", package = "shared-crypto", rev = "f1a2d61bebdf83f01b58830e4768631bd28ce48a"} [profile.release] strip = true # Automatically strip symbols from the binary diff --git a/anychain-sui/Cargo.toml b/anychain-sui/Cargo.toml index 4f00b3d..070ee45 100644 --- a/anychain-sui/Cargo.toml +++ b/anychain-sui/Cargo.toml @@ -15,6 +15,10 @@ serde_with.workspace = true derive_more.workspace = true fastcrypto.workspace = true hex = { workspace = true } +sui_sdk = { workspace = true } +sui_types = { workspace = true } +shared_crypto = { workspace = true } +bcs = { workspace = true } [dev-dependencies] rand = { workspace = true } \ No newline at end of file diff --git a/anychain-sui/src/lib.rs b/anychain-sui/src/lib.rs index b8af78c..2bb8be7 100644 --- a/anychain-sui/src/lib.rs +++ b/anychain-sui/src/lib.rs @@ -10,3 +10,6 @@ pub mod format; mod utils; pub mod transaction; +pub use transaction::*; + +pub mod network; diff --git a/anychain-sui/src/network.rs b/anychain-sui/src/network.rs new file mode 100644 index 0000000..a41a7f8 --- /dev/null +++ b/anychain-sui/src/network.rs @@ -0,0 +1,28 @@ +use anychain_core::{ + no_std::{ + fmt::{Debug, Display}, + hash::Hash, + FromStr, + }, + Network, NetworkError, +}; + +#[derive(Hash, PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy)] +pub struct SuiNetwork; + +impl Network for SuiNetwork { + const NAME: &'static str = "sui"; +} + +impl FromStr for SuiNetwork { + type Err = NetworkError; + fn from_str(_s: &str) -> Result { + todo!() + } +} + +impl Display for SuiNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", Self::NAME) + } +} diff --git a/anychain-sui/src/public_key.rs b/anychain-sui/src/public_key.rs index 3e81550..904d99f 100644 --- a/anychain-sui/src/public_key.rs +++ b/anychain-sui/src/public_key.rs @@ -13,7 +13,24 @@ use fastcrypto::secp256r1::{Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1Pu use fastcrypto::traits::ToFromBytes; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use std::{fmt::Display, str::FromStr}; +use std::{clone::Clone, fmt::Display, ops::Deref, str::FromStr}; +use sui_types::crypto::SuiKeyPair as RawSuiKeyPair; + +#[derive(Debug)] +pub struct SuiKeyPair(pub RawSuiKeyPair); + +impl Clone for SuiKeyPair { + fn clone(&self) -> Self { + Self(self.0.copy()) + } +} + +impl Deref for SuiKeyPair { + type Target = RawSuiKeyPair; + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[allow(clippy::large_enum_variant)] #[derive(Debug, From, PartialEq, Eq)] diff --git a/anychain-sui/src/transaction.rs b/anychain-sui/src/transaction.rs index 296e56b..c55a15d 100644 --- a/anychain-sui/src/transaction.rs +++ b/anychain-sui/src/transaction.rs @@ -1,11 +1,51 @@ -use crate::{address::SuiAddress, format::SuiFormat, SuiPublicKey}; -use anychain_core::{Transaction, TransactionError, TransactionId}; +use crate::{address::SuiAddress, format::SuiFormat, public_key::SuiKeyPair, SuiPublicKey}; +use anychain_core::{AddressError, Transaction, TransactionError, TransactionId}; +use fastcrypto::encoding::{Base58, Encoding}; +use shared_crypto::intent::{Intent, IntentMessage}; use std::fmt::Display; +use sui_types::{ + base_types::{ObjectRef, SuiAddress as RawSuiAddress}, + crypto::{default_hash, Signature as RawSignature}, + transaction::TransactionData as RawSuiTransaction, +}; -pub struct SuiTransactionParameters {} +#[derive(Debug)] +pub struct SuiTransactionParameters { + pub keypair: SuiKeyPair, + pub recipient: SuiAddress, + pub mist: u64, + pub gas_budget: u64, + pub gas_price: u64, + pub gas_payment: ObjectRef, +} + +impl SuiTransactionParameters { + pub fn new( + keypair: SuiKeyPair, + recipient: SuiAddress, + mist: u64, + gas_budget: u64, + gas_price: u64, + gas_payment: ObjectRef, + ) -> Self { + Self { + keypair, + recipient, + mist, + gas_budget, + gas_price, + gas_payment, + } + } +} #[derive(Debug, Clone)] -pub struct SuiTransaction {} +pub struct SuiTransaction { + keypair: SuiKeyPair, + tx_data: RawSuiTransaction, + signature: Vec, +} + impl Transaction for SuiTransaction { type Address = SuiAddress; type Format = SuiFormat; @@ -14,36 +54,120 @@ impl Transaction for SuiTransaction { type TransactionParameters = SuiTransactionParameters; fn new(parameters: &Self::TransactionParameters) -> Result { - todo!() + let sender = RawSuiAddress::from(¶meters.keypair.0.public()); + let recipient = + RawSuiAddress::from_bytes(parameters.recipient.as_ref()).map_err(|err| { + TransactionError::AddressError(AddressError::InvalidAddress(format!( + "Parse sui address failed: {}", + err + ))) + })?; + + let tx_data = RawSuiTransaction::new_transfer_sui( + recipient, + sender, + Some(parameters.mist), + parameters.gas_payment, + parameters.gas_budget, + parameters.gas_price, + ); + + Ok(Self { + keypair: parameters.keypair.clone(), + tx_data, + signature: vec![], + }) } fn sign( &mut self, - signature: Vec, - recid: u8, + _signature: Vec, + _recid: u8, ) -> Result, anychain_core::TransactionError> { - todo!() + let signature = RawSignature::new_secure( + &IntentMessage::new(Intent::sui_transaction(), &self.tx_data), + &self.keypair.0, + ) + .as_ref() + .to_vec(); + + self.signature = signature.clone(); + Ok(signature) } - fn from_bytes(transaction: &[u8]) -> Result { + fn from_bytes(_transaction: &[u8]) -> Result { todo!() } fn to_bytes(&self) -> Result, anychain_core::TransactionError> { - todo!() + Ok(bcs::to_bytes(&self.tx_data) + .expect("Message serialization should not fail") + .to_vec()) } fn to_transaction_id(&self) -> Result { - todo!() + Ok(SuiTransactionId(default_hash(&self.tx_data))) } } #[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct SuiTransactionId {} +pub struct SuiTransactionId([u8; 32]); + impl TransactionId for SuiTransactionId {} impl Display for SuiTransactionId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - todo!() + write!(f, "{}", Base58::encode(self.0)) + } +} + +#[cfg(test)] +mod tests { + use crate::transaction::SuiTransactionParameters; + use fastcrypto::ed25519::Ed25519KeyPair; + use fastcrypto::traits::ToFromBytes; + use std::str::FromStr; + use sui_types::object::Object; + use sui_types::{base_types::SuiAddress as RawSuiAddress, crypto::SuiKeyPair as RawSuiKeyPair}; + + use super::*; + use crate::SuiAddress; + + #[test] + fn test_tx_generation_one_sui_transfer() { + let keypair_bytes = [ + 51, 95, 147, 235, 93, 221, 105, 227, 208, 198, 105, 132, 164, 28, 174, 83, 68, 231, 82, + 133, 50, 67, 181, 184, 126, 93, 85, 244, 135, 108, 205, 101, + ]; + let alice_keypair = + RawSuiKeyPair::Ed25519(Ed25519KeyPair::from_bytes(&keypair_bytes).unwrap()); + let alice_keypair = SuiKeyPair(alice_keypair); + let address_alice = RawSuiAddress::from(&alice_keypair.0.public()); + + let address_bob = SuiAddress::from_str( + "af306e86c74e937552df132b41a6cb3af58559f5342c6e82a98f7d1f7a4a9f30", + ) + .unwrap(); + let sui_transfered = 1_000_000_000u64; // 1 SUI + let gas_budget = 3_000_000u64; // 0.003 SUI + let gas_price = 750u64; // 0.00000075 SUI + let gas_object = Object::with_owner_for_testing(address_alice); // 300_000 SUI + + let params = SuiTransactionParameters::new( + alice_keypair, + address_bob, + sui_transfered, + gas_budget, + gas_price, + gas_object.compute_object_reference(), + ); + + let mut transaction = SuiTransaction::new(¶ms).unwrap(); + println!( + "transaction id: {}", + transaction.to_transaction_id().unwrap() + ); + let res = transaction.sign(vec![], 0); + assert!(res.is_ok()); } } From 0ed7ca574c1ac980ba89e9bf56cb88a8fe9602be Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Tue, 11 Jun 2024 15:34:26 +0800 Subject: [PATCH 5/7] chore: add comment for unit test --- anychain-sui/src/address.rs | 5 +++ anychain-sui/src/public_key.rs | 15 ++++++++ anychain-sui/src/transaction.rs | 64 +++++++++++++++++++++++---------- 3 files changed, 65 insertions(+), 19 deletions(-) diff --git a/anychain-sui/src/address.rs b/anychain-sui/src/address.rs index eee8142..8746732 100644 --- a/anychain-sui/src/address.rs +++ b/anychain-sui/src/address.rs @@ -11,6 +11,7 @@ use std::{ fmt::{Debug, Display}, str::FromStr, }; +use sui_types::base_types::SuiAddress as RawSuiAddress; pub const SUI_ADDRESS_LENGTH: usize = 32; @@ -38,6 +39,10 @@ impl SuiAddress { .map_err(|err| AddressError::InvalidAddress(format!("Parse bytes failed: {}", err))) .map(SuiAddress) } + + pub fn to_raw(&self) -> RawSuiAddress { + RawSuiAddress::from_bytes(self.0).expect("Failed to convert sui address to raw type") + } } impl Address for SuiAddress { diff --git a/anychain-sui/src/public_key.rs b/anychain-sui/src/public_key.rs index 904d99f..e2ee597 100644 --- a/anychain-sui/src/public_key.rs +++ b/anychain-sui/src/public_key.rs @@ -10,6 +10,7 @@ use fastcrypto::encoding::{Base64, Encoding}; use fastcrypto::hash::{Blake2b256, HashFunction}; use fastcrypto::secp256k1::{Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes}; use fastcrypto::secp256r1::{Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes}; +use fastcrypto::traits::KeyPair; use fastcrypto::traits::ToFromBytes; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -19,6 +20,20 @@ use sui_types::crypto::SuiKeyPair as RawSuiKeyPair; #[derive(Debug)] pub struct SuiKeyPair(pub RawSuiKeyPair); +impl SuiKeyPair { + pub fn from_raw(keypair: RawSuiKeyPair) -> Self { + Self(keypair) + } + + pub fn pubkey(&self) -> SuiPublicKey { + match &self.0 { + RawSuiKeyPair::Ed25519(kp) => SuiPublicKey::Ed25519(kp.public().into()), + RawSuiKeyPair::Secp256k1(kp) => SuiPublicKey::Secp256k1(kp.public().into()), + RawSuiKeyPair::Secp256r1(kp) => SuiPublicKey::Secp256r1(kp.public().into()), + } + } +} + impl Clone for SuiKeyPair { fn clone(&self) -> Self { Self(self.0.copy()) diff --git a/anychain-sui/src/transaction.rs b/anychain-sui/src/transaction.rs index c55a15d..def541d 100644 --- a/anychain-sui/src/transaction.rs +++ b/anychain-sui/src/transaction.rs @@ -41,7 +41,7 @@ impl SuiTransactionParameters { #[derive(Debug, Clone)] pub struct SuiTransaction { - keypair: SuiKeyPair, + keypair: Option, tx_data: RawSuiTransaction, signature: Vec, } @@ -73,20 +73,20 @@ impl Transaction for SuiTransaction { ); Ok(Self { - keypair: parameters.keypair.clone(), + keypair: Some(parameters.keypair.clone()), tx_data, signature: vec![], }) } - fn sign( - &mut self, - _signature: Vec, - _recid: u8, - ) -> Result, anychain_core::TransactionError> { + fn sign(&mut self, _signature: Vec, _recid: u8) -> Result, TransactionError> { let signature = RawSignature::new_secure( &IntentMessage::new(Intent::sui_transaction(), &self.tx_data), - &self.keypair.0, + &self + .keypair + .as_ref() + .expect("Keypair is missing for signing transaction") + .0, ) .as_ref() .to_vec(); @@ -95,14 +95,20 @@ impl Transaction for SuiTransaction { Ok(signature) } - fn from_bytes(_transaction: &[u8]) -> Result { - todo!() + fn from_bytes(transaction: &[u8]) -> Result { + Ok(Self { + keypair: None, + tx_data: bcs::from_bytes(transaction).map_err(|err| { + TransactionError::Message(format!("Deserialize transaction failed: {}", err)) + })?, + signature: vec![], + }) } - fn to_bytes(&self) -> Result, anychain_core::TransactionError> { - Ok(bcs::to_bytes(&self.tx_data) - .expect("Message serialization should not fail") - .to_vec()) + fn to_bytes(&self) -> Result, TransactionError> { + bcs::to_bytes(&self.tx_data).map_err(|err| { + TransactionError::Message(format!("Serialize transaction failed: {}", err)) + }) } fn to_transaction_id(&self) -> Result { @@ -124,35 +130,44 @@ impl Display for SuiTransactionId { #[cfg(test)] mod tests { use crate::transaction::SuiTransactionParameters; + use anychain_core::Address; use fastcrypto::ed25519::Ed25519KeyPair; use fastcrypto::traits::ToFromBytes; use std::str::FromStr; + use sui_types::crypto::SuiKeyPair as RawSuiKeyPair; use sui_types::object::Object; - use sui_types::{base_types::SuiAddress as RawSuiAddress, crypto::SuiKeyPair as RawSuiKeyPair}; use super::*; use crate::SuiAddress; #[test] fn test_tx_generation_one_sui_transfer() { + // Sender's keypair let keypair_bytes = [ 51, 95, 147, 235, 93, 221, 105, 227, 208, 198, 105, 132, 164, 28, 174, 83, 68, 231, 82, 133, 50, 67, 181, 184, 126, 93, 85, 244, 135, 108, 205, 101, ]; - let alice_keypair = + let raw_alice_keypair = RawSuiKeyPair::Ed25519(Ed25519KeyPair::from_bytes(&keypair_bytes).unwrap()); - let alice_keypair = SuiKeyPair(alice_keypair); - let address_alice = RawSuiAddress::from(&alice_keypair.0.public()); + let alice_keypair = SuiKeyPair::from_raw(raw_alice_keypair); + let address_alice = + SuiAddress::from_public_key(&alice_keypair.pubkey(), &SuiFormat::Hex).unwrap(); + // Recipient's address let address_bob = SuiAddress::from_str( "af306e86c74e937552df132b41a6cb3af58559f5342c6e82a98f7d1f7a4a9f30", ) .unwrap(); + + // Transfer value, gas_budget, gas_price. let sui_transfered = 1_000_000_000u64; // 1 SUI let gas_budget = 3_000_000u64; // 0.003 SUI let gas_price = 750u64; // 0.00000075 SUI - let gas_object = Object::with_owner_for_testing(address_alice); // 300_000 SUI + // Sender's balance object. + let gas_object = Object::with_owner_for_testing(address_alice.to_raw()); // 300_000 SUI + + // Construct transaction parameters let params = SuiTransactionParameters::new( alice_keypair, address_bob, @@ -162,12 +177,23 @@ mod tests { gas_object.compute_object_reference(), ); + // Construct transaction by parameters let mut transaction = SuiTransaction::new(¶ms).unwrap(); println!( "transaction id: {}", transaction.to_transaction_id().unwrap() ); + + // Sign the transaction let res = transaction.sign(vec![], 0); assert!(res.is_ok()); + + // Serialize transaction + let tx_data = transaction.to_bytes().unwrap(); + + // Deserializ transaction + let deserialized_tx = SuiTransaction::from_bytes(&tx_data); + assert!(deserialized_tx.is_ok()); + assert_eq!(transaction.tx_data, deserialized_tx.unwrap().tx_data); } } From 1e7fe2ed89bcc470f2d453af8cce8e972529e123 Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Tue, 11 Jun 2024 15:44:28 +0800 Subject: [PATCH 6/7] chore: refactor code --- anychain-sui/src/address.rs | 6 ++++-- anychain-sui/src/public_key.rs | 21 ++++++++++----------- anychain-sui/src/transaction.rs | 6 ++---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/anychain-sui/src/address.rs b/anychain-sui/src/address.rs index 8746732..c6661a2 100644 --- a/anychain-sui/src/address.rs +++ b/anychain-sui/src/address.rs @@ -1,6 +1,8 @@ use crate::format::SuiFormat; -use crate::public_key::SuiPrivateKey; -use crate::{public_key::SuiPublicKey, utils::*}; +use crate::{ + public_key::{SuiPrivateKey, SuiPublicKey}, + utils::*, +}; use anychain_core::{Address, AddressError, PublicKey}; use fastcrypto::encoding::Hex; diff --git a/anychain-sui/src/public_key.rs b/anychain-sui/src/public_key.rs index e2ee597..4bef853 100644 --- a/anychain-sui/src/public_key.rs +++ b/anychain-sui/src/public_key.rs @@ -1,17 +1,16 @@ -use crate::address::SuiAddress; -use crate::format::SuiFormat; +use crate::{address::SuiAddress, format::SuiFormat}; use anychain_core::{AddressError, PublicKey, PublicKeyError}; - use derive_more::From; -use fastcrypto::ed25519::{ - Ed25519PrivateKey, Ed25519PublicKey, Ed25519PublicKeyAsBytes, ED25519_PUBLIC_KEY_LENGTH, +use fastcrypto::{ + ed25519::{ + Ed25519PrivateKey, Ed25519PublicKey, Ed25519PublicKeyAsBytes, ED25519_PUBLIC_KEY_LENGTH, + }, + encoding::{Base64, Encoding}, + hash::{Blake2b256, HashFunction}, + secp256k1::{Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes}, + secp256r1::{Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes}, + traits::{KeyPair, ToFromBytes}, }; -use fastcrypto::encoding::{Base64, Encoding}; -use fastcrypto::hash::{Blake2b256, HashFunction}; -use fastcrypto::secp256k1::{Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes}; -use fastcrypto::secp256r1::{Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes}; -use fastcrypto::traits::KeyPair; -use fastcrypto::traits::ToFromBytes; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::{clone::Clone, fmt::Display, ops::Deref, str::FromStr}; diff --git a/anychain-sui/src/transaction.rs b/anychain-sui/src/transaction.rs index def541d..6bcf6e2 100644 --- a/anychain-sui/src/transaction.rs +++ b/anychain-sui/src/transaction.rs @@ -131,11 +131,9 @@ impl Display for SuiTransactionId { mod tests { use crate::transaction::SuiTransactionParameters; use anychain_core::Address; - use fastcrypto::ed25519::Ed25519KeyPair; - use fastcrypto::traits::ToFromBytes; + use fastcrypto::{ed25519::Ed25519KeyPair, traits::ToFromBytes}; use std::str::FromStr; - use sui_types::crypto::SuiKeyPair as RawSuiKeyPair; - use sui_types::object::Object; + use sui_types::{crypto::SuiKeyPair as RawSuiKeyPair, object::Object}; use super::*; use crate::SuiAddress; From 803cdc07758ba0922a274f49c406d80fdf2e60b1 Mon Sep 17 00:00:00 2001 From: Bob Niu Date: Tue, 11 Jun 2024 15:59:42 +0800 Subject: [PATCH 7/7] chore: refactor code --- anychain-sui/src/transaction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anychain-sui/src/transaction.rs b/anychain-sui/src/transaction.rs index 6bcf6e2..1303d6c 100644 --- a/anychain-sui/src/transaction.rs +++ b/anychain-sui/src/transaction.rs @@ -91,7 +91,7 @@ impl Transaction for SuiTransaction { .as_ref() .to_vec(); - self.signature = signature.clone(); + self.signature.clone_from(&signature); Ok(signature) }