diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 4bd92bd..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[target.x86_64-unknown-linux-gnu] -rustflags = "-Ctarget-feature=+sse3,+avx,+aes" diff --git a/Cargo.lock b/Cargo.lock index 259596a..2f02455 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "arrayref" @@ -81,7 +81,7 @@ checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -159,7 +159,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -185,11 +185,20 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + [[package]] name = "bitcoin_hashes" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +dependencies = [ + "bitcoin-private", +] [[package]] name = "bitflags" @@ -204,7 +213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd9e32d7420c85055e8107e5b2463c4eeefeaac18b52359fe9f9c08a18f342b2" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -252,12 +261,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf8dba2868114ed769a1f2590fc9ae5eb331175b44313b6c9b922f8f7ca813d0" -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[package]] name = "bytes" version = "1.4.0" @@ -266,9 +269,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "carbonado" -version = "0.3.0-rc.4" +version = "0.3.0-rc.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a51260b1cb9e2b24be5a0f1b9fbba32d90060feac8954436efce8fa72a46354" +checksum = "43029301a09e49dd05256d6a4872577fd8368cc758e28494c3409897203a1bbd" dependencies = [ "anyhow", "bao", @@ -277,8 +280,9 @@ dependencies = [ "ecies", "hex", "log", + "nom", "pretty_env_logger", - "secp256k1 0.25.0", + "secp256k1", "serde", "snap", "zfec-rs", @@ -299,17 +303,14 @@ dependencies = [ "directories", "flexi_logger", "flexi_syslog", - "hex", - "human_bytes", - "infer", + "futures-util", "log", "once_cell", "par-stream", "rand", "rayon", - "secp256k1 0.26.0", + "secp256k1", "serde", - "serial_test", "syslog", "tokio", "toml", @@ -322,17 +323,6 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -[[package]] -name = "cfb" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" -dependencies = [ - "byteorder", - "fnv", - "uuid", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -389,7 +379,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -559,7 +549,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.109", ] [[package]] @@ -576,7 +566,7 @@ checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -600,7 +590,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -625,22 +615,23 @@ dependencies = [ [[package]] name = "directories" -version = "4.0.1" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -765,9 +756,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -780,9 +771,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -790,15 +781,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -807,38 +798,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -1023,12 +1014,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" -[[package]] -name = "human_bytes" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39b528196c838e8b3da8b665e08c30958a6f2ede91d79f2ffcd0d4664b9c64eb" - [[package]] name = "humantime" version = "1.3.0" @@ -1095,15 +1080,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "infer" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc" -dependencies = [ - "cfb", -] - [[package]] name = "inout" version = "0.1.3" @@ -1120,7 +1096,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1132,7 +1108,7 @@ dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1277,6 +1253,12 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "mio" version = "0.8.6" @@ -1286,7 +1268,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1298,6 +1280,16 @@ dependencies = [ "getrandom", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -1358,6 +1350,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_str_bytes" version = "6.4.1" @@ -1409,7 +1407,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1435,7 +1433,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1487,7 +1485,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1504,9 +1502,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -1626,7 +1624,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1655,64 +1653,43 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "secp256k1" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550fc3b723a478be77bf74718947cdcdd75144d508aaa70f0a320036905df2a8" -dependencies = [ - "bitcoin_hashes", - "rand", - "secp256k1-sys 0.7.0", - "serde", -] - -[[package]] -name = "secp256k1" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4124a35fe33ae14259c490fd70fa199a32b9ce9502f2ee6bc4f81ec06fa65894" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ "bitcoin_hashes", "rand", - "secp256k1-sys 0.8.0", + "secp256k1-sys", "serde", ] [[package]] name = "secp256k1-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8058e28ae464daf5ac14c5c0f78110b58616e796c4e4e28cfcca38fdb13d8f22" -dependencies = [ - "cc", -] - -[[package]] -name = "secp256k1-sys" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642a62736682fdd8c71da0eb273e453c8ac74e33b9fb310e22ba5b03ec7651ff" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" dependencies = [ "cc", ] [[package]] name = "serde" -version = "1.0.156" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.156" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -1756,31 +1733,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serial_test" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538c30747ae860d6fb88330addbbd3e0ddbe46d662d032855596d8a8ca260611" -dependencies = [ - "dashmap", - "futures", - "lazy_static", - "log", - "parking_lot", - "serial_test_derive", -] - -[[package]] -name = "serial_test_derive" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079a83df15f85d89a68d64ae1238f142f172b1fa915d0d76b26a7cba1b659a69" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sha2" version = "0.9.9" @@ -1847,9 +1799,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] @@ -1877,6 +1829,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -1922,7 +1885,7 @@ checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1982,7 +1945,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1993,7 +1956,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2131,12 +2094,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "uuid" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" - [[package]] name = "version_check" version = "0.9.4" @@ -2186,7 +2143,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -2208,7 +2165,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2256,7 +2213,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", ] [[package]] @@ -2265,13 +2231,28 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 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", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] @@ -2280,42 +2261,84 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winnow" version = "0.3.6" diff --git a/Cargo.toml b/Cargo.toml index 69f8b80..8bcc0ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,21 +17,22 @@ axum = "0.6.9" axum-macros = "0.3.4" bao = "0.12.1" blake3 = "1.3.3" -carbonado = "0.3.0-rc.4" +carbonado = "0.3.0-rc.7" chrono = "0.4.23" clap = { version = "4.1.8", features = ["derive"] } -directories = "4.0.1" +directories = "5.0.1" flexi_logger = { version = "0.25.2", features = ["colors"] } flexi_syslog = "0.5.2" -hex = "0.4.3" -human_bytes = "0.4.1" -infer = "0.13.0" +futures-util = "0.3.28" +# hex = "0.4.3" +# human_bytes = "0.4.1" +# infer = "0.13.0" log = "0.4.17" once_cell = "1.17.1" par-stream = "0.10.2" rand = "0.8.5" rayon = "1.6.1" -secp256k1 = { version = "0.26.0", features = [ +secp256k1 = { version = "0.27.0", features = [ "global-context", "rand-std", "bitcoin-hashes-std", @@ -43,5 +44,5 @@ tokio = { version = "1.26.0", features = ["full"] } toml = "0.7.2" tower-http = { version = "0.4.0", features = ["cors"] } -[dev-dependencies] -serial_test = "1.0.0" +# [dev-dependencies] +# serial_test = "2.0.0" diff --git a/src/backend/fs.rs b/src/backend/fs.rs index b25bf3a..4704f80 100644 --- a/src/backend/fs.rs +++ b/src/backend/fs.rs @@ -3,106 +3,66 @@ use std::{ fs::{self, OpenOptions}, io::{self, Read, Write}, - //path::Path, path::{Path, PathBuf}, }; -use anyhow::{anyhow, Result}; -use carbonado::{ - constants::{Format, FEC_M}, - fs::Header, - structs::Encoded, -}; +use anyhow::{anyhow, Error, Result}; +use axum::body::Bytes; +use carbonado::{constants::Format, file::Header, structs::Encoded}; +use futures_util::{stream::BoxStream, StreamExt, TryStreamExt}; use log::{debug, trace}; use rayon::prelude::*; use secp256k1::{ecdh::SharedSecret, PublicKey, SecretKey}; use crate::{config::SYS_CFG, prelude::*}; -pub async fn write_file(pk: &Secp256k1PubKey, file_bytes: &[u8]) -> Result { - debug!("Write file, len: {}", file_bytes.len()); +pub type FileStream<'a> = BoxStream<'a, Result>; - trace!("Create a shared secret using ECDH"); +pub async fn write_file<'a>( + pk: &Secp256k1PubKey, + file_stream: FileStream<'a>, +) -> Result { + trace!("write_file, create a shared secret using ECDH"); let sk = SYS_CFG.private_key; - let ss = SharedSecret::new(&pk.into_inner(), &sk); - let write_pk = PublicKey::from_secret_key_global(&SecretKey::from_slice(&ss.secret_bytes())?); + let ss = SharedSecret::new(&pk.into_inner(), &sk).secret_bytes(); + let write_pk = PublicKey::from_secret_key_global(&SecretKey::from_slice(&ss)?); let pk_bytes = write_pk.serialize(); let (x_only_pk, _) = write_pk.x_only_public_key(); - let file_hash = Blake3Hash(blake3::keyed_hash(&x_only_pk.serialize(), file_bytes)); - - trace!("TODO: Check if file catalog already exists"); - // let path = SYS_CFG - // .volumes - // .get(0) - // .expect("First volume present") - // .path - // .join(CATALOG_DIR) - // .join(file_hash.to_string()); + trace!("Initialize Blake3 keyed hasher"); + let mut file_hasher = blake3::Hasher::new_keyed(&x_only_pk.serialize()); - // trace!("Read catalog at {}", &path.to_string_lossy()); + trace!("Iterate through file body stream"); + let segment_hashes = file_stream + .map(|segment: Result| { + let segment = segment?; + file_hasher.update(&segment); + let encoded_segment = carbonado::encode(&pk_bytes, &segment, NODE_FORMAT)?; + let segment_hash = write_segment(&ss, &pk_bytes, &encoded_segment)?; - // let is_catalog = std::path::Path::new(&path).file_name(); - // trace!("Catalog File: file_name: {:?}", is_catalog); - // if is_catalog.is_some() { - // return Err(anyhow!("This file already exists for this user.")); - // } - - trace!("Segment files"); - let segments_iter = file_bytes.par_chunks_exact(SEGMENT_SIZE); + Ok::(segment_hash) + }) + .try_collect::>() + .await?; - trace!("Encode each segment"); - let remainder_bytes = segments_iter.remainder(); - let last_segment = carbonado::encode(&pk_bytes, remainder_bytes, NODE_FORMAT)?; + let file_hash: Blake3Hash = Blake3Hash(file_hasher.finalize()); - let mut encoded_segments = segments_iter - .map(|segment| carbonado::encode(&pk_bytes, segment, NODE_FORMAT)) - .collect::>>()?; + trace!("Check if segment already exists"); + let path = SYS_CFG + .volumes + .get(0) + .expect("First volume present") + .path + .join(CATALOG_DIR) + .join(file_hash.to_string()); - encoded_segments.push(last_segment); + trace!("Read catalog at {path:?}"); - trace!("Get eight storage volumes from config"); - if SYS_CFG.volumes.len() != FEC_M { - return Err(anyhow!("Eight volume paths must be configured")); + if path.exists() { + return Err(anyhow!("This file already exists for this public key.")); } - trace!("Split each segment out into 8 separate chunks and write each chunk to the storage volume by filename"); - let segment_hashes = encoded_segments - .par_iter() - .map(|encoded_segment| { - let Encoded(encoded_bytes, bao_hash, encode_info) = encoded_segment; - trace!("Encoded bytes len: {}", encoded_bytes.len()); - - let encoded_chunk_size = encode_info.bytes_verifiable as usize / FEC_M; - trace!("Encoded chunk size: {}", encoded_chunk_size); - - encoded_bytes - .par_chunks_exact(encoded_chunk_size) - .enumerate() - .map(|(chunk_index, encoded_segment_chunk)| { - let volume = SYS_CFG - .volumes - .get(chunk_index) - .expect("Get one of eight volumes"); - - write_segment( - &ss.secret_bytes(), - volume.path.join(SEGMENT_DIR), - bao_hash.as_bytes(), - NODE_FORMAT, - encoded_segment_chunk, - chunk_index, - encode_info.output_len, - encode_info.padding_len, - ) - }) - .collect::>>()?; - - Ok(BaoHash(bao_hash.to_owned())) - }) - .collect::>>()?; - trace!("Append each hash to its catalog, plus its format"); write_catalog(&file_hash, &segment_hashes)?; @@ -110,41 +70,57 @@ pub async fn write_file(pk: &Secp256k1PubKey, file_bytes: &[u8]) -> Result Result<()> { - let format = Format::try_from(format)?; - let header = Header::new( - sk, - hash, - format, - chunk_index as u8, - encoded_len, - padding_len, - )?; - let header_bytes = header.try_to_vec()?; - let file_name = header.file_name(); - let path = segment_path.join(file_name); - - trace!("Write segment at {}", path.to_string_lossy()); - let mut file = OpenOptions::new() - .create_new(true) - .write(true) - .open(&path)?; - - file.write_all(&header_bytes)?; - file.write_all(segment)?; - file.flush()?; +pub fn write_segment(sk: &[u8], pk: &[u8], encoded: &Encoded) -> Result { + let Encoded(encoded_bytes, bao_hash, encode_info) = encoded; + trace!("Encoded bytes len: {}", encoded_bytes.len()); - Ok(()) + let encoded_chunk_size = encode_info.bytes_verifiable as usize / SYS_CFG.volumes.len(); + trace!("Encoded chunk size: {}", encoded_chunk_size); + + encoded_bytes + .par_chunks_exact(encoded_chunk_size) + .enumerate() + .map(|(chunk_index, encoded_segment_chunk)| { + let volume = SYS_CFG + .volumes + .get(chunk_index) + .expect("Get one of eight volumes"); + + let format = Format::try_from(NODE_FORMAT)?; + let header = Header::new( + sk, + pk, + bao_hash.as_bytes(), + format, + chunk_index as u8, + encode_info.output_len, + encode_info.padding_len, + )?; + let header_bytes = header.try_to_vec()?; + let file_name = header.file_name(); + + let volume = SYS_CFG + .volumes + .get(chunk_index) + .expect("Get one of eight volumes"); + + let path = volume.path.join(SEGMENT_DIR).join(file_name); + + trace!("Write segment at {}", path.to_string_lossy()); + let mut file = OpenOptions::new() + .create_new(true) + .write(true) + .open(&path)?; + + file.write_all(&header_bytes)?; + file.write_all(encoded_segment_chunk)?; + file.flush()?; + + Ok(()) + }) + .collect::>>()?; + + Ok(BaoHash(bao_hash.to_owned())) } pub fn write_catalog(file_hash: &Blake3Hash, segment_hashes: &[BaoHash]) -> Result<()> { @@ -185,11 +161,6 @@ pub async fn read_file(pk: &Secp256k1PubKey, blake3_hash: &Blake3Hash) -> Result trace!("Read catalog file bytes, parse out each hash, plus the segment Carbonado format"); let catalog_file = read_catalog(blake3_hash)?; - trace!("Get eight storage volumes from config"); - if SYS_CFG.volumes.len() != FEC_M { - return Err(anyhow!("Eight volume paths must be configured")); - } - trace!("Create a shared secret using ECDH"); let sk = SYS_CFG.private_key; let ss = SharedSecret::new(&pk.into_inner(), &sk); @@ -225,7 +196,7 @@ pub async fn read_file(pk: &Secp256k1PubKey, blake3_hash: &Blake3Hash) -> Result let mut bytes = vec![]; file.read_to_end(&mut bytes).unwrap(); - let (_header, chunk) = bytes.split_at(Header::len() as usize); + let (_header, chunk) = bytes.split_at(Header::len()); chunk.to_owned() }) diff --git a/src/bin/carbonadod.rs b/src/bin/carbonadod.rs index 6de4f6c..9b9c26d 100644 --- a/src/bin/carbonadod.rs +++ b/src/bin/carbonadod.rs @@ -62,7 +62,7 @@ async fn main() -> Result<()> { .max_log_level(log::LevelFilter::Info) .build(sys_logger); - let logger = Logger::try_with_str("debug, carbonado=debug")? + let logger = Logger::try_with_str("debug, carbonado_node=debug")? .adaptive_format_for_stderr(AdaptiveFormat::Detailed) .adaptive_format_for_stdout(AdaptiveFormat::Detailed) .set_palette("196;208;10;7;8".to_owned()) diff --git a/src/config.rs b/src/config.rs index 5edfb07..5a1cba9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -9,7 +9,7 @@ use anyhow::{anyhow, Result}; use directories::BaseDirs; use log::{info, trace}; use once_cell::sync::Lazy; -use secp256k1::SecretKey; +use secp256k1::{Secp256k1, SecretKey}; use serde::{Deserialize, Serialize}; use crate::prelude::{CATALOG_DIR, SEGMENT_DIR}; @@ -36,21 +36,25 @@ fn init_env_cfg() -> Result { pub static ENV_CFG: Lazy = Lazy::new(|| init_env_cfg().expect("Initialize env config")); -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct Volume { pub path: PathBuf, // Path to mounted volume } #[derive(Deserialize)] struct SysCfgFile { + http_port: Option, private_key: Option, + drive_redundancy: Option, volumes: Option>, capacity: Option, } #[derive(Serialize)] pub struct SysCfg { + pub http_port: u16, pub private_key: SecretKey, + pub drive_redundancy: usize, pub volumes: Vec, /// Total allocated capacity for the node in megabytes pub capacity: u64, @@ -70,55 +74,70 @@ pub fn init_sys_cfg() -> Result { cfg_file.read_to_string(&mut cfg_contents)?; - trace!("Overwrite existing file to preserve consistency"); - cfg_file = OpenOptions::new() - .write(true) - .truncate(true) - .open(&ENV_CFG.data_cfg_file)?; - let sys_cfg: SysCfgFile = toml::from_str(&cfg_contents)?; + let http_port = sys_cfg.http_port.unwrap_or(7000); + let private_key = sys_cfg .private_key .unwrap_or_else(|| SecretKey::new(&mut rand::thread_rng())); - let volumes: Vec = sys_cfg - .volumes - .map(|vols| { - vols.iter() - .map(|vol| Volume { - path: PathBuf::from(&vol.path), - }) - .collect() - }) - .unwrap_or_else(|| { - (0..8) - .map(|i| Volume { - path: PathBuf::from(format!("/tmp/carbonado-{i}")), - }) - .collect() + let secp = Secp256k1::new(); + info!("Node Public Key: {}", private_key.public_key(&secp)); + + let drive_redundancy = sys_cfg.drive_redundancy.unwrap_or(1); + + match drive_redundancy { + 1 | 2 | 4 | 8 => {} + _ => { + return Err(anyhow!("drive_redundancy must be either 1, 2, 4, or 8")); + } + } + + let orig_volumes = sys_cfg.volumes.unwrap_or_default(); + let mut volumes: Vec = vec![]; + let base_dirs = BaseDirs::new(); + let base_dir = match base_dirs { + Some(base_dir) => base_dir.home_dir().to_owned(), + None => PathBuf::from("/tmp"), + }; + + for i in 0..drive_redundancy { + let volume: Volume = orig_volumes.get(i).map(|v| v.to_owned()).unwrap_or(Volume { + path: base_dir.join("Carbonado").join(format!("Volume_{i}")), }); + volumes.push(volume.to_owned()); + } + for vol in volumes.iter() { - create_dir_all(&vol.path.join(SEGMENT_DIR))?; - create_dir_all(&vol.path.join(CATALOG_DIR))?; + create_dir_all(vol.path.join(SEGMENT_DIR))?; + create_dir_all(vol.path.join(CATALOG_DIR))?; } let capacity = sys_cfg.capacity.unwrap_or(1_000); let config = SysCfg { + http_port, private_key, + drive_redundancy, volumes, capacity, }; trace!("Write parsed config back out to config file"); let toml = toml::to_string_pretty(&config)?; - info!("Config: {toml}"); + + trace!("Overwrite existing file to preserve consistency"); + cfg_file = OpenOptions::new() + .write(true) + .truncate(true) + .open(&ENV_CFG.data_cfg_file)?; cfg_file.write_all(toml.as_bytes())?; cfg_file.flush()?; Ok(config) } -pub static SYS_CFG: Lazy = Lazy::new(|| init_sys_cfg().expect("Initialize sys cfg")); +pub static SYS_CFG: Lazy = + Lazy::new(|| init_sys_cfg().expect("Failed to initialize config")); diff --git a/src/frontend/http.rs b/src/frontend/http.rs index cccafc6..309a7bb 100644 --- a/src/frontend/http.rs +++ b/src/frontend/http.rs @@ -2,25 +2,44 @@ use std::{net::SocketAddr, str::FromStr}; use anyhow::Result; use axum::{ - body::Bytes, - extract::Path, + extract::{BodyStream, Path}, http::StatusCode, response::{IntoResponse, Response}, routing::{delete, get, post}, Router, }; +use futures_util::{ + stream::{self}, + StreamExt, +}; use log::info; - use tower_http::cors::CorsLayer; use crate::{ - backend::fs::{delete_file, read_file, write_file}, + backend::fs::{delete_file, read_file, write_file, FileStream}, + config::SYS_CFG, prelude::*, }; -async fn post_file(Path(pk): Path, body: Bytes) -> Result { - let _pk = &Secp256k1PubKey::try_from(pk.as_str())?; - let Blake3Hash(hash) = write_file(_pk, &body).await?; +#[axum_macros::debug_handler] +async fn post_file( + Path(pk): Path, + body: BodyStream, +) -> Result { + let pk = &Secp256k1PubKey::try_from(pk.as_str())?; + + let file_stream: FileStream = stream::try_unfold(body, |mut body_stream| async { + if let Some(chunk) = body_stream.next().await { + let bytes = chunk?; + Ok(Some((bytes, body_stream))) + } else { + Ok(None) + } + }) + .boxed(); + + let Blake3Hash(hash) = write_file(pk, file_stream).await?; + Ok((StatusCode::OK, hash.to_hex().to_string())) } @@ -53,7 +72,7 @@ pub async fn start() -> Result<()> { // .route("/raw/:bao_hash", get(get_raw)) .layer(CorsLayer::permissive()); - let addr = SocketAddr::from(([127, 0, 0, 1], 7000)); + let addr = SocketAddr::from(([127, 0, 0, 1], SYS_CFG.http_port)); info!("carbonado-node HTTP frontend successfully running at {addr}"); diff --git a/src/temp/cat.gif b/src/temp/cat.gif deleted file mode 100755 index cfccca8..0000000 Binary files a/src/temp/cat.gif and /dev/null differ diff --git a/tests/file.rs b/tests/file.rs index 8da1c11..79685ed 100644 --- a/tests/file.rs +++ b/tests/file.rs @@ -1,10 +1,9 @@ use std::fs; use anyhow::Result; -use carbonado_node::{ - backend::fs::{delete_file, write_file}, - structs::Secp256k1PubKey, -}; +use axum::body::Bytes; +use carbonado_node::{backend::fs::write_file, structs::Secp256k1PubKey}; +use futures_util::{stream, StreamExt}; use log::{debug, info}; use rand::thread_rng; use secp256k1::generate_keypair; @@ -21,8 +20,14 @@ async fn write_read() -> Result<()> { let file_bytes = fs::read("tests/samples/cat.gif")?; debug!("{} Write Delete:: bytes read", file_bytes.len()); - // info!("Write Delete:: Writing file if not exists in order to test delete"); - let blake3_hash = write_file(&Secp256k1PubKey(pk), &file_bytes).await.is_ok(); + info!("Write Delete:: Writing file if not exists in order to test delete"); + + let file_stream = stream::iter(file_bytes) + .chunks(1024 * 1024) + .map(|chunk| Ok(Bytes::from(chunk))) + .boxed(); + + let blake3_hash = write_file(&Secp256k1PubKey(pk), file_stream).await.is_ok(); if blake3_hash { info!( @@ -31,8 +36,9 @@ async fn write_read() -> Result<()> { ); } - let new_file_bytes = delete_file(Secp256k1PubKey(pk), &file_bytes).is_err(); - debug!("Write Delete:: deleted file:: {:?}", new_file_bytes); + // TODO: This is not how you delete files + // let new_file_bytes = delete_file(Secp256k1PubKey(pk), &file_bytes).is_err(); + // debug!("Write Delete:: deleted file:: {:?}", new_file_bytes); debug!(" >>>> Public Key Generated :: {:?} :: {}", _sk, pk); info!("Write/Delete test finished successfully!"); @@ -40,24 +46,39 @@ async fn write_read() -> Result<()> { Ok(()) } -// #[tokio::test] -// // #[should_panic] -// async fn check_catalog_exists() -> Result<()> { -// carbonado::utils::init_logging(RUST_LOG); +#[tokio::test] +async fn check_catalog_exists() -> Result<()> { + carbonado::utils::init_logging(RUST_LOG); -// let (_sk, pk) = generate_keypair(&mut thread_rng()); + let (_sk, pk) = generate_keypair(&mut thread_rng()); + + info!("Reading file bytes"); + let file_bytes = fs::read("tests/samples/cat.gif")?; + debug!("{} bytes read", file_bytes.len()); -// info!("Reading file bytes"); -// let file_bytes = fs::read("tests/samples/cat.gif")?; -// debug!("{} bytes read", file_bytes.len()); + let file_stream = stream::iter(file_bytes) + .chunks(1024 * 1024) + .map(|chunk| Ok(Bytes::from(chunk))) + .boxed(); -// info!("Writing file if not exists"); -// let blake3_hash = write_file(&Secp256k1PubKey(pk), &file_bytes).await.is_err(); -// debug!("Skip writing file as File hash exists: {blake3_hash}"); -// assert!(blake3_hash); + info!("Writing file if not exists"); + let is_ok = write_file(&Secp256k1PubKey(pk), file_stream).await.is_ok(); + debug!("Skip writing file as File hash exists: {is_ok}"); + assert!(is_ok); -// Ok(()) -// } + let file_bytes = fs::read("tests/samples/cat.gif")?; + let file_stream = stream::iter(file_bytes) + .chunks(1024 * 1024) + .map(|chunk| Ok(Bytes::from(chunk))) + .boxed(); + + info!("Writing file if not exists"); + let is_err = write_file(&Secp256k1PubKey(pk), file_stream).await.is_err(); + debug!("Skip writing file as File hash exists: {is_err}"); + assert!(is_err); + + Ok(()) +} #[tokio::test] async fn read_write_delete_file() -> Result<()> { @@ -67,11 +88,16 @@ async fn read_write_delete_file() -> Result<()> { let file_bytes = fs::read("tests/samples/cat.gif")?; debug!("{} Write Delete:: bytes read", file_bytes.len()); + let file_stream = stream::iter(file_bytes.clone()) + .chunks(1024 * 1024) + .map(|chunk| Ok(Bytes::from(chunk))) + .boxed(); + // first file to write let (_sk, pk) = generate_keypair(&mut thread_rng()); // info!("Write Delete:: Writing file if not exists in order to test delete"); - let file_did_write = write_file(&Secp256k1PubKey(pk), &file_bytes).await.is_ok(); + let file_did_write = write_file(&Secp256k1PubKey(pk), file_stream).await.is_ok(); if file_did_write { info!( @@ -83,8 +109,13 @@ async fn read_write_delete_file() -> Result<()> { // second file to write let (_sk, pk) = generate_keypair(&mut thread_rng()); - // info!("Write Delete:: Writing file if not exists in order to test delete"); - let blake3_hash = write_file(&Secp256k1PubKey(pk), &file_bytes).await.is_ok(); + let file_stream = stream::iter(file_bytes) + .chunks(1024 * 1024) + .map(|chunk| Ok(Bytes::from(chunk))) + .boxed(); + + info!("Write Delete:: Writing file if not exists in order to test delete"); + let blake3_hash = write_file(&Secp256k1PubKey(pk), file_stream).await.is_ok(); if blake3_hash { info!( @@ -93,8 +124,11 @@ async fn read_write_delete_file() -> Result<()> { ); } - let new_file_bytes = delete_file(Secp256k1PubKey(pk), &file_bytes).is_err(); - debug!("Write Delete:: deleted file:: {:?}", new_file_bytes); + // TODO: This is not how you delete files + // let new_file_bytes = delete_file(Secp256k1PubKey(pk), &file_bytes).is_err(); + // debug!("Write Delete:: deleted file:: {:?}", new_file_bytes); + + // TODO: Check number of files debug!(" >>>> Public Key Generated :: {:?} :: {}", _sk, pk); info!("Write/Delete test finished successfully!");