From abdcb117b512e35910fa8e30241a7a354e5cacf0 Mon Sep 17 00:00:00 2001 From: xjd Date: Wed, 1 Mar 2023 09:26:17 +0800 Subject: [PATCH] Enhance xUDT owner mode (#67) * Enhanced owner mode * add xudt enhance owner mode tests (#69) * add test for xudt owner mode for output type (#73) --------- Co-authored-by: contrun --- Cargo.lock | 988 +++++++++++------- Makefile | 6 +- build.rs | 8 +- c/xudt_rce.c | 181 +++- c/xudt_rce.mol | 2 + c/xudt_rce_mol.h | 76 +- c/xudt_rce_mol2.h | 36 +- tests/xudt_rce/dump.h | 80 ++ tests/xudt_rce/extension_scripts.Makefile | 7 +- tests/xudt_rce/owner_script.c | 171 +++ tests/xudt_rce_rust/Cargo.lock | 593 +++++++---- tests/xudt_rce_rust/Cargo.toml | 12 +- tests/xudt_rce_rust/src/xudt_rce_mol.rs | 91 +- tests/xudt_rce_rust/tests/misc.rs | 24 + tests/xudt_rce_rust/tests/test_xudt_rce.rs | 422 +++++++- .../tests/test_xudt_rce_validator.rs | 18 +- 16 files changed, 1968 insertions(+), 747 deletions(-) create mode 100644 tests/xudt_rce/dump.h create mode 100644 tests/xudt_rce/owner_script.c diff --git a/Cargo.lock b/Cargo.lock index 9059b2f..e7c8b4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,27 +1,47 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +dependencies = [ + "gimli", +] + [[package]] -name = "adler32" -version = "1.0.4" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.10" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -30,45 +50,40 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "autocfg" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "autocfg" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.45" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8" +checksum = "78ed203b9ba68b242c62b3fb7480f589dd49829be1edb3fe8fc8b4ffda2dcb8d" dependencies = [ - "backtrace-sys", - "cfg-if", + "addr2line", + "cfg-if 1.0.0", "libc", + "miniz_oxide 0.4.4", + "object", "rustc-demangle", ] -[[package]] -name = "backtrace-sys" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca797db0057bae1a7aa2eef3283a874695455cecf08a43bfb8507ee0ebc1ed69" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "base64" version = "0.10.1" @@ -86,9 +101,9 @@ checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake2b-rs" @@ -120,6 +135,12 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + [[package]] name = "byte-tools" version = "0.3.1" @@ -128,9 +149,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -156,16 +177,26 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chrono" -version = "0.4.11" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time", + "wasm-bindgen", + "winapi 0.3.9", ] [[package]] @@ -504,9 +535,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.7.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -514,17 +545,17 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -538,9 +569,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" dependencies = [ "crossbeam-epoch", "crossbeam-utils 0.7.2", @@ -553,8 +584,8 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.1.0", + "cfg-if 0.1.10", "crossbeam-utils 0.7.2", "lazy_static", "maybe-uninit", @@ -564,12 +595,13 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] @@ -578,7 +610,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "lazy_static", ] @@ -588,8 +620,8 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.1.0", + "cfg-if 0.1.10", "lazy_static", ] @@ -630,9 +662,9 @@ dependencies = [ [[package]] name = "dtoa" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" [[package]] name = "eaglesong" @@ -642,27 +674,28 @@ checksum = "8d978bd5d343e8ab9b5c0fc8d93ff9c602fdc96616ffff9c05ac7a155419b824" [[package]] name = "either" -version = "1.5.3" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encoding_rs" -version = "0.8.22" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "enum-display-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53f76eb63c4bfc6fce5000f106254701b741fc9a65ee08445fde0ff39e583f1c" +checksum = "f16ef37b2a9b242295d61a154ee91ae884afff6b8b933b486b12481cc58310ca" dependencies = [ - "quote 0.3.15", - "syn 0.11.11", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", ] [[package]] @@ -678,20 +711,11 @@ dependencies = [ "termcolor", ] -[[package]] -name = "error-chain" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" -dependencies = [ - "version_check", -] - [[package]] name = "failure" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" dependencies = [ "backtrace", "failure_derive", @@ -699,13 +723,13 @@ dependencies = [ [[package]] name = "failure_derive" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.9", - "quote 1.0.3", - "syn 1.0.16", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", "synstructure", ] @@ -727,23 +751,30 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "348138dd23e03bb0018caef99647fb1a5befec5ff4b501991de88f09854d4c28" +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "flate2" -version = "1.0.14" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ - "cfg-if", "crc32fast", - "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] name = "fnv" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" @@ -760,6 +791,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding 2.2.0", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -784,9 +824,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.29" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures-cpupool" @@ -800,24 +840,30 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" + [[package]] name = "goblin" version = "0.0.24" @@ -847,20 +893,35 @@ dependencies = [ "tokio-io", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "heapsize" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "hermit-abi" -version = "0.1.8" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" dependencies = [ "libc", ] @@ -883,7 +944,7 @@ checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" dependencies = [ "bytes", "fnv", - "itoa", + "itoa 0.4.8", ] [[package]] @@ -900,9 +961,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -921,9 +982,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.35" +version = "0.12.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" dependencies = [ "bytes", "futures", @@ -933,7 +994,7 @@ dependencies = [ "http-body", "httparse", "iovec", - "itoa", + "itoa 0.4.8", "log", "net2", "rustc_version", @@ -962,6 +1023,19 @@ dependencies = [ "tokio-io", ] +[[package]] +name = "iana-time-zone" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + [[package]] name = "idna" version = "0.1.5" @@ -975,15 +1049,25 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "im" version = "12.3.4" @@ -1018,11 +1102,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.3.2" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] @@ -1036,9 +1130,24 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] [[package]] name = "jsonrpc-core" @@ -1071,9 +1180,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.68" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "lock_api" @@ -1087,27 +1196,27 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" dependencies = [ "scopeguard 1.1.0", ] [[package]] name = "log" -version = "0.4.8" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "matches" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "maybe-uninit" @@ -1117,9 +1226,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap" @@ -1128,23 +1237,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" dependencies = [ "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "memoffset" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", ] [[package]] name = "merkle-cbt" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d589b5a7ca642540e7ccfbca3bcd0aa18693eb9287e2a6b17c79b1d062d52863" +checksum = "0c95c71a8dc57c7ad9b7623cf05711bb4e3daef44f1931c91e7d49c60de693ca" +dependencies = [ + "cfg-if 0.1.10", +] [[package]] name = "mime" @@ -1154,9 +1266,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -1164,20 +1276,30 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.3.6" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ - "adler32", + "adler", + "autocfg 1.1.0", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", ] [[package]] name = "mio" -version = "0.6.21" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -1192,9 +1314,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" dependencies = [ "kernel32-sys", "net2", @@ -1214,9 +1336,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.4" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -1232,92 +1354,102 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.33" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "num-integer" -version = "0.1.42" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", ] [[package]] name = "num_cpus" -version = "1.12.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "numext-constructor" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983983b13ec50f55d5b9536faa553d7fadaa12fae9e0dfda76ba74aebfcc7522" +checksum = "621fe0f044729f810c6815cdd77e8f5e0cd803ce4f6a38380ebfc1322af98661" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", ] [[package]] name = "numext-fixed-uint" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f38aa6a49599f6cf38edbf3af3da0eda190ed3f3889afa5f4cb13be5673259" +checksum = "6c68c76f96d589d1009a666c5072f37f3114d682696505f2cf445f27766c7d70" dependencies = [ "numext-fixed-uint-core", "numext-fixed-uint-hack", - "proc-macro-hack", ] [[package]] name = "numext-fixed-uint-core" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbae90b098c4ac5d5fd2fb48430c9141b7fac42e5fee31ee008c7880ec83adac" +checksum = "6aab1d6457b97b49482f22a92f0f58a2f39bdd7f3b2f977eae67e8bc206aa980" dependencies = [ - "failure", "heapsize", "numext-constructor", - "rand 0.5.6", + "rand 0.7.3", "serde", + "thiserror", ] [[package]] name = "numext-fixed-uint-hack" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba196a4ea541560fb7e44d328c87f25f024c727eeb09df4bb53610a575cfed7" +checksum = "0200f8d55c36ec1b6a8cf810115be85d4814f045e0097dfd50033ba25adb4c9e" dependencies = [ "numext-fixed-uint-core", - "proc-macro-hack", - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", ] +[[package]] +name = "object" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + [[package]] name = "opaque-debug" version = "0.2.3" @@ -1326,31 +1458,43 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "openssl" -version = "0.10.28" +version = "0.10.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ "bitflags", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", - "lazy_static", "libc", + "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", +] + [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.54" +version = "0.9.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", "cc", "libc", "pkg-config", @@ -1382,8 +1526,8 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" dependencies = [ - "lock_api 0.3.3", - "parking_lot_core 0.6.2", + "lock_api 0.3.4", + "parking_lot_core 0.6.3", "rustc_version", ] @@ -1396,23 +1540,23 @@ dependencies = [ "libc", "rand 0.6.5", "rustc_version", - "smallvec 0.6.13", - "winapi 0.3.8", + "smallvec", + "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "rustc_version", - "smallvec 0.6.13", - "winapi 0.3.8", + "smallvec", + "winapi 0.3.9", ] [[package]] @@ -1423,9 +1567,9 @@ checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "phf" @@ -1467,9 +1611,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plain" @@ -1479,20 +1623,15 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "ppv-lite86" -version = "0.2.6" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-hack" -version = "0.5.12" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f918f2b601f93baa836c1c2945faef682ba5b6d4828ecb45eeb7cc3c71b811b4" -dependencies = [ - "proc-macro2 1.0.9", - "quote 1.0.3", - "syn 1.0.16", -] +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" @@ -1505,24 +1644,21 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.9" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ - "unicode-xid 0.2.0", + "unicode-ident", ] [[package]] name = "publicsuffix" -version = "1.5.4" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" +checksum = "95b4ce31ff0a27d93c8de1849cf58162283752f065a90d508f1105fa6c9a213f" dependencies = [ - "error-chain", - "idna 0.2.0", - "lazy_static", - "regex", - "url 2.1.1", + "idna 0.2.3", + "url 2.3.1", ] [[package]] @@ -1531,12 +1667,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" - [[package]] name = "quote" version = "0.6.13" @@ -1548,24 +1678,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" -dependencies = [ - "proc-macro2 1.0.9", -] - -[[package]] -name = "rand" -version = "0.5.6" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "winapi 0.3.8", + "proc-macro2 1.0.51", ] [[package]] @@ -1574,7 +1691,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "libc", "rand_chacha 0.1.1", "rand_core 0.4.2", @@ -1584,7 +1701,7 @@ dependencies = [ "rand_os", "rand_pcg", "rand_xorshift", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1606,7 +1723,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.3.1", ] @@ -1679,7 +1796,7 @@ checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ "libc", "rand_core 0.4.2", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1693,7 +1810,7 @@ dependencies = [ "libc", "rand_core 0.4.2", "rdrand", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1702,7 +1819,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.4.2", ] @@ -1726,35 +1843,43 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] [[package]] name = "regex" -version = "1.3.5" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8900ebc1363efa7ea1c399ccc32daed870b4002651e0bed86e72d501ebbe0048" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.17" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1804,9 +1929,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_version" @@ -1819,9 +1944,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.3" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "same-file" @@ -1834,12 +1959,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "lazy_static", - "winapi 0.3.8", + "windows-sys", ] [[package]] @@ -1887,21 +2011,22 @@ dependencies = [ [[package]] name = "security-framework" -version = "0.4.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", "core-foundation-sys", + "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" -version = "0.4.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -1964,31 +2089,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.105" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.105" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.9", - "quote 1.0.3", - "syn 1.0.16", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", ] [[package]] name = "serde_json" -version = "1.0.48" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ - "itoa", + "itoa 1.0.5", "ryu", "serde", ] @@ -2000,16 +2125,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" dependencies = [ "dtoa", - "itoa", + "itoa 0.4.8", "serde", "url 1.7.2", ] [[package]] name = "sha2" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" dependencies = [ "block-buffer", "digest", @@ -2034,30 +2159,27 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.2" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "smallvec" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ "maybe-uninit", ] -[[package]] -name = "smallvec" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" - [[package]] name = "stable_deref_trait" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "string" @@ -2068,17 +2190,6 @@ dependencies = [ "bytes", ] -[[package]] -name = "syn" -version = "0.11.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -dependencies = [ - "quote 0.3.15", - "synom", - "unicode-xid 0.0.4", -] - [[package]] name = "syn" version = "0.15.44" @@ -2092,79 +2203,96 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.16" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" +checksum = "d56e159d99e6c2b93995d171050271edb50ecc5288fbc7cc17de8fdce4e58c14" dependencies = [ - "proc-macro2 1.0.9", - "quote 1.0.3", - "unicode-xid 0.2.0", -] - -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -dependencies = [ - "unicode-xid 0.0.4", + "proc-macro2 1.0.51", + "quote 1.0.23", + "unicode-ident", ] [[package]] name = "synstructure" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.9", - "quote 1.0.3", - "syn 1.0.16", - "unicode-xid 0.2.0", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", + "unicode-xid 0.2.4", ] [[package]] name = "tempfile" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.7.3", - "redox_syscall", + "redox_syscall 0.2.16", "remove_dir_all", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "termcolor" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] -name = "thread_local" -version = "1.0.1" +name = "thiserror" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ - "lazy_static", + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", ] [[package]] name = "time" -version = "0.1.42" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", - "redox_syscall", - "winapi 0.3.8", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "0.1.22" @@ -2300,18 +2428,18 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.6" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] name = "try-lock" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try_from" @@ -2319,14 +2447,14 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] name = "typenum" -version = "1.11.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "uname" @@ -2348,27 +2476,24 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] -name = "unicode-normalization" -version = "0.1.12" +name = "unicode-ident" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" -dependencies = [ - "smallvec 1.2.0", -] +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] -name = "unicode-xid" -version = "0.0.4" +name = "unicode-normalization" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] [[package]] name = "unicode-xid" @@ -2378,9 +2503,9 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" @@ -2395,13 +2520,13 @@ dependencies = [ [[package]] name = "url" -version = "2.1.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ - "idna 0.2.0", - "matches", - "percent-encoding 2.1.0", + "form_urlencoded", + "idna 0.3.0", + "percent-encoding 2.2.0", ] [[package]] @@ -2426,24 +2551,24 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", - "winapi 0.3.8", + "winapi 0.3.9", "winapi-util", ] @@ -2464,6 +2589,66 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote 1.0.23", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.108", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + [[package]] name = "winapi" version = "0.2.8" @@ -2472,9 +2657,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -2494,11 +2679,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -2507,13 +2692,70 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + [[package]] name = "winreg" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -2522,7 +2764,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7daf138b6b14196e3830a588acf1e86966c694d3e8fb026fb105b8b5dca07e6e" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] diff --git a/Makefile b/Makefile index 93a7960..b25b3f7 100644 --- a/Makefile +++ b/Makefile @@ -125,13 +125,13 @@ fmt: mol: rm -f c/xudt_rce_mol.h rm -f c/xudt_rce_mol2.h - rm -f xudt/src/xudt_rce_mol.rs + rm -f tests/xudt_rce_rust/src/xudt_rce_mol.rs make c/xudt_rce_mol.h make c/xudt_rce_mol2.h - make xudt/src/xudt_rce_mol.rs + make tests/xudt_rce_rust/src/xudt_rce_mol.rs make omni_lock_mol -xudt/src/xudt_rce_mol.rs: c/xudt_rce.mol +tests/xudt_rce_rust/src/xudt_rce_mol.rs: c/xudt_rce.mol ${MOLC} --language rust --schema-file $< | rustfmt > $@ c/xudt_rce_mol.h: c/xudt_rce.mol diff --git a/build.rs b/build.rs index b5b48a9..c86c201 100644 --- a/build.rs +++ b/build.rs @@ -31,16 +31,16 @@ const BINARIES: &[(&str, &str)] = &[ ), ( "xudt_rce", - "022b3f6ad414bb3877d5618a417b06b7e306ce2c4f4bcbf68f617a16fb8ca697", + "50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95", ), ( "rce_validator", - "fe951ccda3ada53ccb65e29fa4577d41030fa2b76cce7f24c5f114743bbcd66a" + "d9476d96e0f5d41eca88bbc5e8c819ac38592a33285a4828a58d17873f278b3c", ), ( "omni_lock", - "635f78eba450cb2f73f113022ff62e4bbfb5a39b7368c375c6a731ba4c85c59e" - ) + "86ea7ee58a0ecacfb1f7f2675a06d96223e0597dfe06a2474f9c06a72a7ccabc", + ), ]; fn main() { diff --git a/c/xudt_rce.c b/c/xudt_rce.c index 1718669..b1c0110 100644 --- a/c/xudt_rce.c +++ b/c/xudt_rce.c @@ -34,15 +34,18 @@ int ckb_exit(signed char); #define SCRIPT_SIZE 32768 #define RAW_EXTENSION_SIZE 65536 #define EXPORTED_FUNC_NAME "validate" -#define MAX_CODE_SIZE (1024 * 1024) +// here we reserve a lot of memory for dynamic libraries. The enhanced owner +// mode may also checked via dynamic library. It might consume much memory, e.g. +// precomputed table (about 1 M) in secp256k1 +#define MAX_CODE_SIZE (1024 * 1800) #define FLAGS_SIZE 4 #define MAX_LOCK_SCRIPT_HASH_COUNT 2048 #define OWNER_MODE_INPUT_TYPE_MASK 0x80000000 #define OWNER_MODE_OUTPUT_TYPE_MASK 0x40000000 #define OWNER_MODE_INPUT_LOCK_NOT_MASK 0x20000000 -#define OWNER_MODE_MASK \ - (OWNER_MODE_INPUT_TYPE_MASK | OWNER_MODE_OUTPUT_TYPE_MASK | \ +#define OWNER_MODE_MASK \ + (OWNER_MODE_INPUT_TYPE_MASK | OWNER_MODE_OUTPUT_TYPE_MASK | \ OWNER_MODE_INPUT_LOCK_NOT_MASK) #include "rce.h" @@ -56,6 +59,9 @@ uint8_t g_script[SCRIPT_SIZE] = {0}; uint8_t g_raw_extension_data[RAW_EXTENSION_SIZE] = {0}; WitnessArgsType g_witness_args; +uint8_t g_code_buff[MAX_CODE_SIZE] __attribute__((aligned(RISCV_PGSIZE))); +uint32_t g_code_used = 0; + /* is_owner_mode indicates if current xUDT is unlocked via owner mode(as described by sUDT), extension_index refers to the index of current extension in @@ -66,7 +72,7 @@ If this function returns 0, the validation for current extension script is consider successful. */ typedef int (*ValidateFuncType)(int is_owner_mode, size_t extension_index, - const uint8_t* args, size_t args_len); + const uint8_t *args, size_t args_len); typedef enum XUDTFlags { XUDTFlagsPlain = 0, @@ -75,18 +81,18 @@ typedef enum XUDTFlags { } XUDTFlags; typedef enum XUDTValidateFuncCategory { - CateNormal = 0, // normal extension script - CateRce = 1, // Regulation Compliance Extension + CateNormal = 0, // normal extension script + CateRce = 1, // Regulation Compliance Extension } XUDTValidateFuncCategory; uint8_t RCE_HASH[32] = {1}; // functions -int load_validate_func(uint8_t* code_buff, uint32_t* code_used, - const uint8_t* hash, uint8_t hash_type, - ValidateFuncType* func, XUDTValidateFuncCategory* cat) { +int load_validate_func(uint8_t *g_code_buff, uint32_t *g_code_used, + const uint8_t *hash, uint8_t hash_type, + ValidateFuncType *func, XUDTValidateFuncCategory *cat) { int err = 0; - void* handle = NULL; + void *handle = NULL; size_t consumed_size = 0; if (memcmp(RCE_HASH, hash, 32) == 0 && hash_type == 1) { @@ -95,13 +101,13 @@ int load_validate_func(uint8_t* code_buff, uint32_t* code_used, return 0; } - CHECK2(MAX_CODE_SIZE > *code_used, ERROR_NOT_ENOUGH_BUFF); - err = ckb_dlopen2(hash, hash_type, &code_buff[*code_used], - MAX_CODE_SIZE - *code_used, &handle, &consumed_size); + CHECK2(MAX_CODE_SIZE > *g_code_used, ERROR_NOT_ENOUGH_BUFF); + err = ckb_dlopen2(hash, hash_type, &g_code_buff[*g_code_used], + MAX_CODE_SIZE - *g_code_used, &handle, &consumed_size); CHECK(err); CHECK2(handle != NULL, ERROR_CANT_LOAD_LIB); ASSERT(consumed_size % RISCV_PGSIZE == 0); - *code_used += consumed_size; + *g_code_used += consumed_size; *func = (ValidateFuncType)ckb_dlsym(handle, EXPORTED_FUNC_NAME); CHECK2(*func != NULL, ERROR_CANT_FIND_SYMBOL); @@ -112,7 +118,7 @@ int load_validate_func(uint8_t* code_buff, uint32_t* code_used, return err; } -int verify_script_vec(uint8_t* ptr, uint32_t size, uint32_t* real_size) { +int verify_script_vec(uint8_t *ptr, uint32_t size, uint32_t *real_size) { int err = 0; CHECK2(size >= MOL_NUM_T_SIZE, ERROR_INVALID_MOL_FORMAT); @@ -124,7 +130,7 @@ int verify_script_vec(uint8_t* ptr, uint32_t size, uint32_t* real_size) { return err; } -static uint32_t read_from_witness(uintptr_t arg[], uint8_t* ptr, uint32_t len, +static uint32_t read_from_witness(uintptr_t arg[], uint8_t *ptr, uint32_t len, uint32_t offset) { int err; uint64_t output_len = len; @@ -143,7 +149,7 @@ uint8_t g_witness_data_source[DEFAULT_DATA_SOURCE_LENGTH]; // due to the "static" data (s_witness_data_source), the "WitnessArgsType" is a // singleton. note: mol2_data_source_t consumes a lot of memory due to the // "cache" field (default 2K) -int make_cursor_from_witness(WitnessArgsType* witness, bool* use_input_type) { +int make_cursor_from_witness(WitnessArgsType *witness, bool *use_input_type) { int err = 0; uint64_t witness_len = 0; // at the beginning of the transactions including RCE, @@ -167,7 +173,7 @@ int make_cursor_from_witness(WitnessArgsType* witness, bool* use_input_type) { cur.offset = 0; cur.size = witness_len; - mol2_data_source_t* ptr = (mol2_data_source_t*)g_witness_data_source; + mol2_data_source_t *ptr = (mol2_data_source_t *)g_witness_data_source; ptr->read = read_from_witness; ptr->total_size = witness_len; @@ -187,8 +193,8 @@ int make_cursor_from_witness(WitnessArgsType* witness, bool* use_input_type) { return err; } -int get_extension_data(uint32_t index, uint8_t* buff, uint32_t buff_len, - uint32_t* out_len) { +int get_extension_data(uint32_t index, uint8_t *buff, uint32_t buff_len, + uint32_t *out_len) { int err = 0; bool use_input_type = true; err = make_cursor_from_witness(&g_witness_args, &use_input_type); @@ -222,8 +228,32 @@ int get_extension_data(uint32_t index, uint8_t* buff, uint32_t buff_len, return err; } +int get_owner_script(uint8_t *buff, uint32_t buff_len, uint32_t *out_len) { + int err = 0; + bool use_input_type = true; + err = make_cursor_from_witness(&g_witness_args, &use_input_type); + CHECK(err); + BytesOptType input = use_input_type + ? g_witness_args.t->input_type(&g_witness_args) + : g_witness_args.t->output_type(&g_witness_args); + CHECK2(!input.t->is_none(&input), ERROR_INVALID_MOL_FORMAT); + + mol2_cursor_t bytes = input.t->unwrap(&input); + // convert Bytes to XudtWitnessInputType + XudtWitnessInputType witness_input = make_XudtWitnessInput(&bytes); + ScriptOptType owner_script = witness_input.t->owner_script(&witness_input); + CHECK2(!owner_script.t->is_none(&owner_script), ERROR_INVALID_MOL_FORMAT); + ScriptType owner_script2 = owner_script.t->unwrap(&owner_script); + *out_len = mol2_read_at(&owner_script2.cur, buff, buff_len); + CHECK2(*out_len == owner_script2.cur.size, ERROR_INVALID_MOL_FORMAT); + + err = 0; +exit: + return err; +} + // the *var_len may be bigger than real length of raw extension data -int load_raw_extension_data(uint8_t** var_data, uint32_t* var_len) { +int load_raw_extension_data(uint8_t **var_data, uint32_t *var_len) { int err = 0; bool use_input_type = true; err = make_cursor_from_witness(&g_witness_args, &use_input_type); @@ -257,7 +287,7 @@ int load_raw_extension_data(uint8_t** var_data, uint32_t* var_len) { } int check_owner_mode(size_t source, size_t field, mol_seg_t args_bytes_seg, - int* owner_mode) { + int *owner_mode) { int err = 0; size_t i = 0; uint8_t buffer[BLAKE2B_BLOCK_SIZE]; @@ -287,10 +317,71 @@ int check_owner_mode(size_t source, size_t field, mol_seg_t args_bytes_seg, return err; } +int check_enhanced_owner_mode(int *owner_mode) { + int err = 0; + uint8_t owner_script[SCRIPT_SIZE]; + uint32_t owner_script_len = 0; + uint8_t owner_script_hash[BLAKE2B_BLOCK_SIZE] = {0}; + + err = get_owner_script(owner_script, SCRIPT_SIZE, &owner_script_len); + CHECK(err); + + err = blake2b(owner_script_hash, BLAKE2B_BLOCK_SIZE, owner_script, + owner_script_len, NULL, 0); + CHECK2(err == 0, ERROR_BLAKE2B_ERROR); + + // get 32 bytes hash from args and compare it to owner script hash + { + uint64_t len = SCRIPT_SIZE; + int ret = ckb_checked_load_script(g_script, &len, 0); + CHECK(ret); + CHECK2(len <= SCRIPT_SIZE, ERROR_SCRIPT_TOO_LONG); + + mol_seg_t script_seg; + script_seg.ptr = g_script; + script_seg.size = len; + + mol_errno mol_err = MolReader_Script_verify(&script_seg, false); + CHECK2(mol_err == MOL_OK, ERROR_ENCODING); + + mol_seg_t args_seg = MolReader_Script_get_args(&script_seg); + mol_seg_t args_bytes_seg = MolReader_Bytes_raw_bytes(&args_seg); + CHECK2(args_bytes_seg.size >= BLAKE2B_BLOCK_SIZE, ERROR_ARGUMENTS_LEN); + + if (memcmp(owner_script_hash, args_bytes_seg.ptr, BLAKE2B_BLOCK_SIZE) != + 0) { + CHECK2(false, ERROR_HASH_MISMATCHED); + } + } + + // execute owner script + mol_seg_t owner_script_seg = {.ptr = owner_script, .size = owner_script_len}; + mol_errno mol_err = MolReader_Script_verify(&owner_script_seg, false); + CHECK2(mol_err == MOL_OK, ERROR_ENCODING); + mol_seg_t code_hash = MolReader_Script_get_code_hash(&owner_script_seg); + mol_seg_t hash_type = MolReader_Script_get_hash_type(&owner_script_seg); + + mol_seg_t owner_args_seg = MolReader_Script_get_args(&owner_script_seg); + mol_seg_t owner_args_bytes_seg = MolReader_Bytes_raw_bytes(&owner_args_seg); + + ValidateFuncType func = NULL; + XUDTValidateFuncCategory cat = CateNormal; + err = load_validate_func(g_code_buff, &g_code_used, code_hash.ptr, + *(uint8_t *)hash_type.ptr, &func, &cat); + CHECK(err); + + err = func(0, 0, owner_args_bytes_seg.ptr, owner_args_bytes_seg.size); + CHECK(err); + *owner_mode = 1; + +exit: + return err; +} + // *var_data will point to "Raw Extension Data", which can be in args or witness // *var_data will refer to a memory location of g_script or g_raw_extension_data -int parse_args(int* owner_mode, XUDTFlags* flags, uint8_t** var_data, - uint32_t* var_len, uint8_t* hashes, uint32_t* hashes_count) { +int parse_args(int *owner_mode, XUDTFlags *flags, uint8_t **var_data, + uint32_t *var_len, uint8_t *hashes, uint32_t *hashes_count) { int err = 0; bool owner_mode_for_input_type = false; bool owner_mode_for_output_type = false; @@ -314,7 +405,7 @@ int parse_args(int* owner_mode, XUDTFlags* flags, uint8_t** var_data, CHECK2(args_bytes_seg.size >= BLAKE2B_BLOCK_SIZE, ERROR_ARGUMENTS_LEN); if (args_bytes_seg.size >= (FLAGS_SIZE + BLAKE2B_BLOCK_SIZE)) { - uint32_t val = *(uint32_t*)(args_bytes_seg.ptr + BLAKE2B_BLOCK_SIZE); + uint32_t val = *(uint32_t *)(args_bytes_seg.ptr + BLAKE2B_BLOCK_SIZE); if (val & OWNER_MODE_INPUT_TYPE_MASK) { owner_mode_for_input_type = true; } @@ -373,7 +464,7 @@ int parse_args(int* owner_mode, XUDTFlags* flags, uint8_t** var_data, *flags = XUDTFlagsPlain; } else { uint32_t temp_flags = - (*(uint32_t*)(args_bytes_seg.ptr + BLAKE2B_BLOCK_SIZE)) & + (*(uint32_t *)(args_bytes_seg.ptr + BLAKE2B_BLOCK_SIZE)) & ~OWNER_MODE_MASK; if (temp_flags == XUDTFlagsPlain) { *flags = XUDTFlagsPlain; @@ -398,7 +489,7 @@ int parse_args(int* owner_mode, XUDTFlags* flags, uint8_t** var_data, CHECK2(var_len > 0, ERROR_INVALID_MOL_FORMAT); // verify the hash uint8_t hash[BLAKE2B_BLOCK_SIZE] = {0}; - uint8_t* blake160_hash = + uint8_t *blake160_hash = args_bytes_seg.ptr + BLAKE2B_BLOCK_SIZE + FLAGS_SIZE; err = blake2b(hash, BLAKE2B_BLOCK_SIZE, *var_data, *var_len, NULL, 0); CHECK2(err == 0, ERROR_BLAKE2B_ERROR); @@ -415,7 +506,8 @@ int parse_args(int* owner_mode, XUDTFlags* flags, uint8_t** var_data, // copied from simple_udt.c int simple_udt(int owner_mode) { - if (owner_mode) return CKB_SUCCESS; + if (owner_mode) + return CKB_SUCCESS; int ret = 0; // When the owner mode is not enabled, however, we will then need to ensure @@ -451,8 +543,8 @@ int simple_udt(int owner_mode) { // endian format, we can just read the first 16 bytes of cell data into // `current_amount`, which is just an unsigned 128-bit integer in C. The // memory layout of a C program will ensure that the value is set correctly. - ret = ckb_checked_load_cell_data((uint8_t*)¤t_amount, &len, 0, i, - CKB_SOURCE_GROUP_INPUT); + ret = ckb_load_cell_data((uint8_t *)¤t_amount, &len, 0, i, + CKB_SOURCE_GROUP_INPUT); // When `CKB_INDEX_OUT_OF_BOUND` is reached, we know we have iterated // through all cells of current type. if (ret == CKB_INDEX_OUT_OF_BOUND) { @@ -483,8 +575,8 @@ int simple_udt(int owner_mode) { // Similar to the above code piece, we are also looping through output cells // with the same script as current running script here by using // `CKB_SOURCE_GROUP_OUTPUT`. - ret = ckb_checked_load_cell_data((uint8_t*)¤t_amount, &len, 0, i, - CKB_SOURCE_GROUP_OUTPUT); + ret = ckb_load_cell_data((uint8_t *)¤t_amount, &len, 0, i, + CKB_SOURCE_GROUP_OUTPUT); if (ret == CKB_INDEX_OUT_OF_BOUND) { break; } @@ -504,7 +596,7 @@ int simple_udt(int owner_mode) { } // When both value are gathered, we can perform the final check here to - // prevent non-authorized token issurance. + // prevent non-authorized token issuance. if (input_amount < output_amount) { return ERROR_AMOUNT; } @@ -515,7 +607,7 @@ int simple_udt(int owner_mode) { // current transaction, we consider the extension script to be already // validated, no additional check is needed for current extension int is_extension_script_validated(mol_seg_t extension_script, - uint8_t* input_lock_script_hash, + uint8_t *input_lock_script_hash, uint32_t input_lock_script_hash_count) { int err = 0; uint8_t hash[BLAKE2B_BLOCK_SIZE]; @@ -539,16 +631,9 @@ int simulator_main() { #else int main() { #endif - // don't move code_buff into global variable. It doesn't work. - // it's a ckb-vm bug: the global variable will be freezed: - // https://github.com/nervosnetwork/ckb-vm/blob/d43f58d6bf8cc6210721fdcdb6e5ecba513ade0c/src/machine/elf_adaptor.rs#L28-L32 - // The code can't be loaded into freezed memory. - uint8_t code_buff[MAX_CODE_SIZE] __attribute__((aligned(RISCV_PGSIZE))); - uint32_t code_used = 0; - int err = 0; int owner_mode = 0; - uint8_t* raw_extension_data = NULL; + uint8_t *raw_extension_data = NULL; uint32_t raw_extension_len = 0; XUDTFlags flags = XUDTFlagsPlain; uint8_t @@ -558,6 +643,12 @@ int main() { input_lock_script_hashes, &input_lock_script_hash_count); CHECK(err); CHECK2(owner_mode == 1 || owner_mode == 0, ERROR_INVALID_ARGS_FORMAT); + // check enhanced mode here + if (!owner_mode) { + check_enhanced_owner_mode(&owner_mode); + // don't need to check the return result from this function + // if failed, owner mode is still false + } if (flags != XUDTFlagsPlain) { CHECK2(raw_extension_data != NULL, ERROR_INVALID_ARGS_FORMAT); @@ -590,10 +681,10 @@ int main() { mol_seg_t hash_type = MolReader_Script_get_hash_type(&res.seg); mol_seg_t args = MolReader_Script_get_args(&res.seg); - uint8_t hash_type2 = *((uint8_t*)hash_type.ptr); + uint8_t hash_type2 = *((uint8_t *)hash_type.ptr); XUDTValidateFuncCategory cat = CateNormal; - err = load_validate_func(code_buff, &code_used, code_hash.ptr, hash_type2, - &func, &cat); + err = load_validate_func(g_code_buff, &g_code_used, code_hash.ptr, + hash_type2, &func, &cat); CHECK(err); // RCE is with high priority, must be checked if (cat != CateRce) { diff --git a/c/xudt_rce.mol b/c/xudt_rce.mol index de7def6..9182272 100644 --- a/c/xudt_rce.mol +++ b/c/xudt_rce.mol @@ -4,6 +4,8 @@ vector ScriptVec