diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f806017..bb0323a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: include: - build: linux os: ubuntu-latest - rust: 1.59.0 + rust: 1.69.0 steps: - uses: actions/checkout@v3 @@ -28,7 +28,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2022-01-19 + toolchain: nightly-2023-04-20 override: true - name: Check Rust format diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d140768..0ac69ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,10 +20,10 @@ jobs: include: - build: linux os: ubuntu-20.04 - rust: 1.59.0 + rust: 1.69.0 - build: macos os: macos-12 - rust: 1.59.0 + rust: 1.69.0 steps: - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index 75ceaab..c82dfb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,17 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.6", - "once_cell", - "version_check", -] - [[package]] name = "aho-corasick" version = "0.7.18" @@ -43,17 +32,6 @@ version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -94,21 +72,25 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", "lazycell", + "log", "peeking_take_while", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", + "syn 2.0.48", + "which", ] [[package]] @@ -124,25 +106,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "blake2b-ref" -version = "0.2.1" +name = "bitflags" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95916998c798756098a4eb1b3f2cd510659705a9817bf203d61abd30fbec3e7b" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "blake2b-ref" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88756126a7634ad9c13ed0a6da9aa3376a6b7000eb5fcdbb89d153196326bbcd" - -[[package]] -name = "blake2b-rs" -version = "0.1.5" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e35e362830ef90ecea16f09b21b75d22d33a8562a679c74ab4f4fa49b4fcb87" -dependencies = [ - "cc", -] +checksum = "294d17c72e0ba59fad763caa112368d0672083779cdebbb97164f4bb4c1e339a" [[package]] name = "blake2b-rs" @@ -229,139 +202,96 @@ dependencies = [ [[package]] name = "ckb-channel" -version = "0.101.8" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e1a2db7097ef2cd6e7868c4adc45c7863c5abee83fba9ecd428b83cd77f536" +checksum = "50d21e6d4ad47858609ced9d887e63e821ba6770f28e7be58e8d56213a0d0924" dependencies = [ "crossbeam-channel", ] [[package]] -name = "ckb-channel" -version = "0.104.0" +name = "ckb-constant" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe17832858b599109ac9cee6d9dcde419dad958a1982d6e37eb97fedb0ef5e6" -dependencies = [ - "crossbeam-channel", -] - -[[package]] -name = "ckb-error" -version = "0.101.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f068a6fd2bc852172c6bc33465e757953299dfed0aa66a3d52d5a2c7e5272a" -dependencies = [ - "anyhow", - "ckb-occupied-capacity 0.101.8", - "derive_more", - "thiserror", -] +checksum = "b42093e370876b71569292fc0aa9ae1078114ee678c4e4b4ae77a81b590fdba7" [[package]] name = "ckb-error" -version = "0.104.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73dc4bb1f4c889f42edc9509005aa593ca1b88b6f43f9cfbd59c6d4897994783" +checksum = "9948a60c3fa47131ec9907cfb64c94e4fd9199ef9329ba0ba4d53b8e03adfbbe" dependencies = [ "anyhow", - "ckb-occupied-capacity 0.104.0", + "ckb-occupied-capacity", "derive_more", "thiserror", ] [[package]] name = "ckb-fixed-hash" -version = "0.101.8" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1764c5697371b60dba3af51880dda454508fa4a74be5c27f8c32f00fda0e356f" +checksum = "0629983e05127c5bbf025cefdac36a91c3a0720acf1b2e2637ff1f0ac673a78c" dependencies = [ - "ckb-fixed-hash-core 0.101.8", - "ckb-fixed-hash-macros 0.101.8", -] - -[[package]] -name = "ckb-fixed-hash" -version = "0.104.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8183ed12fd0fff3abfb142d3dde7b501f211519e2b77972c64815e00d38c8ed3" -dependencies = [ - "ckb-fixed-hash-core 0.104.0", - "ckb-fixed-hash-macros 0.104.0", + "ckb-fixed-hash-core", + "ckb-fixed-hash-macros", ] [[package]] name = "ckb-fixed-hash-core" -version = "0.101.8" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616d99b6dff9b5c76b241fe894c9d0899d2bc8c9971c131e1a93cec4035fa032" +checksum = "c582d7d52e96ce65c2995a7f399c6dc3f314fec64dd15d47ec903896ac24a428" dependencies = [ "faster-hex", "serde", "thiserror", ] -[[package]] -name = "ckb-fixed-hash-core" -version = "0.104.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e9a8f69f7174ce9f9b6045a82aafb2ceafc2aa6eedffa0562e0d6defaa4732" -dependencies = [ - "faster-hex", - "serde", - "thiserror", -] - -[[package]] -name = "ckb-fixed-hash-macros" -version = "0.101.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47435298b4a697851c58c2d4347cf50d1d9b5893f3534acce4cdc2aae6a8b37e" -dependencies = [ - "ckb-fixed-hash-core 0.101.8", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ckb-fixed-hash-macros" -version = "0.104.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f73281677e79cd8cbd873b86701209d560038549823e915cb3505d1b348f0a6" +checksum = "3bae4184f70cbd2e36839d902f403f06ea6a009df67ac2f7d37942890459618c" dependencies = [ - "ckb-fixed-hash-core 0.104.0", + "ckb-fixed-hash-core", "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] -name = "ckb-hash" -version = "0.101.8" +name = "ckb-gen-types" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d67c434be841be84498d2cc2d4a17bec9f10e5705d75e017e4afc62a1ceef58" +checksum = "c709b63557041d03db0bc09b56ddc95de455ea555d537d5599117163f095973c" dependencies = [ - "blake2b-ref 0.2.1", - "blake2b-rs 0.2.0", + "cfg-if 1.0.0", + "ckb-error", + "ckb-fixed-hash", + "ckb-hash", + "ckb-occupied-capacity", + "molecule", + "numext-fixed-uint", ] [[package]] name = "ckb-hash" -version = "0.104.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac70ef20b9dac406f06bead70c0a2e4742205234f58051885e6ae1f50786e6be" +checksum = "b78504239eedf043013a4c1d5a3cf38a2917ef37643c3608ff4183aa2888f48f" dependencies = [ - "blake2b-ref 0.2.1", - "blake2b-rs 0.2.0", + "blake2b-ref", + "blake2b-rs", ] [[package]] name = "ckb-jsonrpc-types" -version = "0.104.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520d1cc13b7d5ea93a2b9a28362555410e6621e8141eb1289a0547e0c5ef6e46" +checksum = "97cf7e01a18fb980f3d993fafdf06999379b71ebca098196ed42824bab0b3d9d" dependencies = [ - "ckb-types 0.104.0", + "ckb-types", "faster-hex", "serde", "serde_json", @@ -369,9 +299,9 @@ dependencies = [ [[package]] name = "ckb-librocksdb-sys" -version = "7.3.3" +version = "8.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d106bb32241da368e67ce9a36545e1cc3c31b7faa9321817199b69bf1e085b4a" +checksum = "2e68e0993f54ba0d21152419a0668caa92adc928b5a9b01e45871ec055a31ce2" dependencies = [ "bindgen", "cc", @@ -382,80 +312,49 @@ dependencies = [ ] [[package]] -name = "ckb-occupied-capacity" -version = "0.101.8" +name = "ckb-merkle-mountain-range" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80dfbabc77dc083604adea5587ffa3e8a6ce0afcb92f75928575c6728981edfc" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" dependencies = [ - "ckb-occupied-capacity-core 0.101.8", - "ckb-occupied-capacity-macros 0.101.8", + "cfg-if 1.0.0", ] [[package]] name = "ckb-occupied-capacity" -version = "0.104.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0e4ccbc2b6af791b589a09db77518fb2b0fa79a72ba568e6a7dade7e935721" -dependencies = [ - "ckb-occupied-capacity-core 0.104.0", - "ckb-occupied-capacity-macros 0.104.0", -] - -[[package]] -name = "ckb-occupied-capacity-core" -version = "0.101.8" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "737d292e26c436dc78b8a84cf9a402bf263170ff7fe3e4ff2312fc8d03083915" +checksum = "bfe678c0047869c71ae01369ada83ebb43567504c3c5e338a64dcd679b98ecad" dependencies = [ - "serde", + "ckb-occupied-capacity-core", + "ckb-occupied-capacity-macros", ] [[package]] name = "ckb-occupied-capacity-core" -version = "0.104.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773a03d5c3cf71d5f9b0e620b193fdd82a3e1f3434022792a32a8b4037550fa1" +checksum = "35dba70fddc9eda1906875b4c99b14d64910a429a58972658e8f65930f77f27b" dependencies = [ "serde", ] [[package]] name = "ckb-occupied-capacity-macros" -version = "0.101.8" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7614dc55f767154813cf60373ff64260e106de6b83461e0470fd51e95ffa671f" +checksum = "1a37efa3314fc8d1b6ead861743e7012126204449a7c6579f0e571a3456d0d34" dependencies = [ - "ckb-occupied-capacity-core 0.101.8", + "ckb-occupied-capacity-core", "quote", - "syn", -] - -[[package]] -name = "ckb-occupied-capacity-macros" -version = "0.104.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfcfb1f9f3812fd5e306d88f0a3683cdf9e8350f5a79c3288e835b8355425635" -dependencies = [ - "ckb-occupied-capacity-core 0.104.0", - "quote", - "syn", -] - -[[package]] -name = "ckb-rational" -version = "0.101.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d518df53c3fb2ff02e9824ad0ee0e4eb965038311f09bc88b7e3eb4c68237e4e" -dependencies = [ - "numext-fixed-uint", - "serde", + "syn 1.0.82", ] [[package]] name = "ckb-rational" -version = "0.104.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70041296dc87341c1993ff3c12268937bb998145b49afc5c299a764dc9ed12a" +checksum = "a0d64ef7e9b0785e1b2acdc1a96072bbdefa6ac72bca36de91d9d9e65cd39bbd" dependencies = [ "numext-fixed-uint", "serde", @@ -463,9 +362,9 @@ dependencies = [ [[package]] name = "ckb-rocksdb" -version = "0.18.3" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b89828fd7e60e4d857f6f1a2f40343114eece1ca20859d4ca8371d4e00ce28" +checksum = "050f7c70a451b9606a5d4e1cf696fec2517e65c3bfcbefadb6b114cc0fa7673b" dependencies = [ "ckb-librocksdb-sys", "libc", @@ -474,45 +373,28 @@ dependencies = [ [[package]] name = "ckb-types" -version = "0.101.8" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c833f4a2c4635da013d7445e016b6edcaf10ba35cdba0c633f37faef8b9b0a" +checksum = "eb8a1e28eeb4bc18dfc0e97306147d1c9399ffab6292185346a2af2983ed80f3" dependencies = [ "bit-vec", - "bitflags", "bytes", - "ckb-channel 0.101.8", - "ckb-error 0.101.8", - "ckb-fixed-hash 0.101.8", - "ckb-hash 0.101.8", - "ckb-occupied-capacity 0.101.8", - "ckb-rational 0.101.8", - "derive_more", - "merkle-cbt", - "molecule", - "numext-fixed-uint", - "once_cell", -] - -[[package]] -name = "ckb-types" -version = "0.104.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ba3e13c93900267bc9670b3ea4379eab1a234c7cb470fcd6856640f165e2af" -dependencies = [ - "bit-vec", - "bytes", - "ckb-channel 0.104.0", - "ckb-error 0.104.0", - "ckb-fixed-hash 0.104.0", - "ckb-hash 0.104.0", - "ckb-occupied-capacity 0.104.0", - "ckb-rational 0.104.0", + "ckb-channel", + "ckb-constant", + "ckb-error", + "ckb-fixed-hash", + "ckb-gen-types", + "ckb-hash", + "ckb-merkle-mountain-range", + "ckb-occupied-capacity", + "ckb-rational", "derive_more", + "golomb-coded-set", "merkle-cbt", "molecule", "numext-fixed-uint", "once_cell", + "paste", ] [[package]] @@ -526,6 +408,26 @@ dependencies = [ "libloading", ] +[[package]] +name = "const-random" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.6", + "once_cell", + "tiny-keccak", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -549,7 +451,7 @@ dependencies = [ "chrono", "ckb-jsonrpc-types", "ckb-rocksdb", - "ckb-types 0.104.0", + "ckb-types", "cota-smt", "crc", "diesel", @@ -570,12 +472,12 @@ dependencies = [ [[package]] name = "cota-smt" -version = "0.1.0" -source = "git+https://github.com/nervina-labs/cota-smt?tag=0.1.0#d4491021491c5eabd1c0a4c435f5009c8126254d" +version = "0.12.0" +source = "git+https://github.com/nervina-labs/cota-smt?tag=v0.12.0#ec0c2d02a335a1abbaf92ed0ced992a5b7475a30" dependencies = [ - "blake2b-ref 0.3.0", + "blake2b-ref", "cfg-if 1.0.0", - "ckb-types 0.101.8", + "ckb-types", "sparse-merkle-tree", ] @@ -614,6 +516,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "cty" version = "0.2.2" @@ -628,7 +536,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -656,14 +564,17 @@ checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] name = "dlv-list" -version = "0.3.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] [[package]] name = "dotenv" @@ -671,6 +582,12 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + [[package]] name = "encoding_rs" version = "0.8.30" @@ -682,17 +599,27 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ - "atty", "humantime", + "is-terminal", "log", "regex", "termcolor", ] +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "failure" version = "0.1.8" @@ -711,7 +638,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", "synstructure", ] @@ -817,7 +744,7 @@ checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -880,9 +807,9 @@ checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" @@ -897,6 +824,15 @@ dependencies = [ "regex", ] +[[package]] +name = "golomb-coded-set" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7076c0cd6257d84b785b0f22c36443dd47a5e86a1256d7ef82c8cb88ea9a7e" +dependencies = [ + "siphasher", +] + [[package]] name = "h2" version = "0.3.12" @@ -924,12 +860,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "hashbrown" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" -dependencies = [ - "ahash", -] +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" [[package]] name = "heapsize" @@ -949,12 +882,27 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.5" @@ -1079,6 +1027,17 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35e70ee094dc02fd9c13fdad4940090f22dbd6ac7c9e7094a46cf0232a50bc7c" +[[package]] +name = "is-terminal" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +dependencies = [ + "hermit-abi 0.3.4", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "itoa" version = "0.4.8" @@ -1172,9 +1131,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -1186,6 +1145,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + [[package]] name = "lock_api" version = "0.4.7" @@ -1272,9 +1237,9 @@ dependencies = [ [[package]] name = "molecule" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc8276c02a006bddad7d1c28c1a88f30421e1b5f0ba0ca96ceb8077c7d20c01" +checksum = "d4fd9767ab5e5f2ea40f71ff4c8bdb633c50509052e093c2fdd0e390a749dfa3" dependencies = [ "bytes", "cfg-if 1.0.0", @@ -1375,7 +1340,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -1387,7 +1352,7 @@ checksum = "621fe0f044729f810c6815cdd77e8f5e0cd803ce4f6a38380ebfc1322af98661" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -1422,7 +1387,7 @@ dependencies = [ "numext-fixed-uint-core", "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -1436,9 +1401,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" @@ -1446,7 +1411,7 @@ version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "foreign-types", "libc", @@ -1475,12 +1440,12 @@ dependencies = [ [[package]] name = "ordered-multimap" -version = "0.4.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" dependencies = [ "dlv-list", - "hashbrown 0.12.1", + "hashbrown 0.13.2", ] [[package]] @@ -1528,9 +1493,15 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.36.1", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -1573,20 +1544,30 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + [[package]] name = "proc-macro2" -version = "1.0.34" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.10" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1649,7 +1630,7 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1716,9 +1697,9 @@ dependencies = [ [[package]] name = "rust-ini" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" dependencies = [ "cfg-if 1.0.0", "ordered-multimap", @@ -1736,6 +1717,19 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "ryu" version = "1.0.9" @@ -1773,7 +1767,7 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -1807,7 +1801,7 @@ checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -1839,6 +1833,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.5" @@ -1863,11 +1863,12 @@ dependencies = [ [[package]] name = "sparse-merkle-tree" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84214ec89cb9d304b5d54c7a266951c25bd396b2df5388420a9497a6896120a" +checksum = "8851f6c92491ebe5528eabc1244292175a739eb0162974f9f9670a7dc748748b" dependencies = [ - "blake2b-rs 0.1.5", + "blake2b-rs", + "cc", "cfg-if 0.1.10", ] @@ -1882,6 +1883,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -1890,7 +1902,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", "unicode-xid", ] @@ -1934,7 +1946,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -1948,6 +1960,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.5.1" @@ -2060,6 +2081,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -2153,7 +2180,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.82", "wasm-bindgen-shared", ] @@ -2187,7 +2214,7 @@ checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2208,6 +2235,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2245,43 +2284,109 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winreg" version = "0.10.1" diff --git a/Cargo.toml b/Cargo.toml index 49f313b..751d568 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "cota-registry-aggregator" version = "0.6.1" -edition = "2018" +edition = "2021" [dependencies] jsonrpc-http-server = "18.0.0" -env_logger = "0.9" +env_logger = "0.10.2" log = {version = "0.4", features = ["release_max_level_debug", "max_level_debug"]} -rocksdb = { package = "ckb-rocksdb", version = "=0.18.3", features = ["snappy"] } +rocksdb = { package = "ckb-rocksdb", version = "=0.21.1", features = ["snappy"] } hex = "0.4" failure = "0.1.8" lazy_static = "1.4" @@ -15,12 +15,12 @@ crc = "3.0.0" chrono = "0.4" diesel = { version = "1.4.8", features = ["mysql", "r2d2", "numeric"] } dotenv = "0.15.0" -molecule = "0.7.2" +molecule = "0.7.5" serde = { version = "1.0", features = [ "derive" ] } -sparse-merkle-tree = "0.5.3" -ckb-types = "=0.104.0" +sparse-merkle-tree = "0.6.1" +ckb-types = "0.113.0" ckb-jsonrpc-types = ">=0.104.0" parking_lot = "0.12.1" reqwest = { version = "0.11", features = ["json"] } serde_json = "1.0" -cota-smt = {package = "cota-smt", git = "https://github.com/nervina-labs/cota-smt", tag = "0.1.0"} \ No newline at end of file +cota-smt = {package = "cota-smt", git = "https://github.com/nervina-labs/cota-smt", tag = "v0.12.0"} \ No newline at end of file diff --git a/rust-toolchain b/rust-toolchain index 19bfbcf..4d7f4ec 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-01-19 \ No newline at end of file +nightly-2023-04-20 \ No newline at end of file diff --git a/src/smt/entry.rs b/src/smt/entry.rs index 06b4b62..04dccae 100644 --- a/src/smt/entry.rs +++ b/src/smt/entry.rs @@ -55,12 +55,11 @@ pub async fn generate_registry_smt(lock_hashes: Vec<[u8; 32]>) -> Result<(String let root_hash = hex::encode(smt.root().as_slice()); info!("registry_smt_root_hash: {:?}", root_hash); + let leaf_keys: Vec = update_leaves.iter().map(|leave| leave.0).collect(); let registry_merkle_proof = smt .merkle_proof(update_leaves.iter().map(|leave| leave.0).collect()) .unwrap(); - let registry_merkle_proof_compiled = registry_merkle_proof - .compile(update_leaves.clone()) - .unwrap(); + let registry_merkle_proof_compiled = registry_merkle_proof.compile(leaf_keys).unwrap(); let merkel_proof_vec: Vec = registry_merkle_proof_compiled.into(); diff --git a/src/smt/smt.rs b/src/smt/smt.rs index 1c12ea8..da30698 100644 --- a/src/smt/smt.rs +++ b/src/smt/smt.rs @@ -8,7 +8,7 @@ use crate::smt::transaction::store_transaction::StoreTransaction; use chrono::prelude::*; use cota_smt::smt::{Blake2bHasher, H256}; use log::debug; -use sparse_merkle_tree::traits::Store; +use sparse_merkle_tree::traits::StoreReadOps; use sparse_merkle_tree::SparseMerkleTree; pub type CotaSMT<'a> = SparseMerkleTree>; diff --git a/src/smt/store/serde.rs b/src/smt/store/serde.rs index 31664a2..642f219 100644 --- a/src/smt/store/serde.rs +++ b/src/smt/store/serde.rs @@ -1,8 +1,4 @@ -use sparse_merkle_tree::{ - merge::MergeValue, - tree::{BranchKey, BranchNode}, - H256, -}; +use sparse_merkle_tree::{merge::MergeValue, BranchKey, BranchNode, H256}; use std::convert::TryInto; pub fn branch_key_to_vec(key: &BranchKey) -> Vec { diff --git a/src/smt/store/smt_store.rs b/src/smt/store/smt_store.rs index 52cc291..bf1e675 100644 --- a/src/smt/store/smt_store.rs +++ b/src/smt/store/smt_store.rs @@ -8,8 +8,8 @@ use cota_smt::smt::H256; use molecule::prelude::{Builder, Entity}; use sparse_merkle_tree::{ error::Error as SMTError, - traits::Store, - tree::{BranchKey, BranchNode}, + traits::{StoreReadOps, StoreWriteOps}, + BranchKey, BranchNode, }; use std::convert::TryInto; @@ -106,7 +106,7 @@ impl<'a> SMTStore<'a> { } } -impl<'a> Store for SMTStore<'a> { +impl<'a> StoreReadOps for SMTStore<'a> { fn get_branch(&self, branch_key: &BranchKey) -> Result, SMTError> { match self .store @@ -128,7 +128,9 @@ impl<'a> Store for SMTStore<'a> { None => Ok(None), } } +} +impl<'a> StoreWriteOps for SMTStore<'a> { fn insert_branch(&mut self, branch_key: BranchKey, branch: BranchNode) -> Result<(), SMTError> { self.store .insert_raw(