diff --git a/Cargo.lock b/Cargo.lock index 4a1218f0eb3a..d53d0192bebb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -149,9 +149,9 @@ dependencies = [ [[package]] name = "amplify" -version = "4.7.0" +version = "4.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7147b742325842988dd6c793d55f58df3ae36bccf7d9b6e07db10ab035be343d" +checksum = "448cf0c3afc71439b5f837aac5399a1ef2b223f5f38324dbfb4343deec3b80cc" dependencies = [ "amplify_derive", "amplify_num", @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -238,43 +238,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arg" @@ -376,7 +376,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "synstructure", ] @@ -388,7 +388,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -411,20 +411,20 @@ dependencies = [ "concurrent-queue", "event-listener-strategy", "futures-core", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] name = "async-compression" -version = "0.4.15" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e26a9844c659a2a293d239c7910b752f8487fe122c6c8bd1659bf85a6507c302" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "flate2", "futures-core", "futures-io", "memchr", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "xz2", "zstd", "zstd-safe", @@ -448,8 +448,8 @@ checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.1", - "futures-lite 2.3.0", + "fastrand 2.2.0", + "futures-lite 2.5.0", "slab", ] @@ -461,7 +461,7 @@ checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ "async-lock 3.3.0", "blocking", - "futures-lite 2.3.0", + "futures-lite 2.5.0", ] [[package]] @@ -472,10 +472,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.3.0", "blocking", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "once_cell", ] @@ -518,18 +518,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock 3.3.0", "cfg-if 1.0.0", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "parking", - "polling 3.7.3", - "rustix 0.38.37", + "polling 3.7.4", + "rustix 0.38.40", "slab", "tracing", "windows-sys 0.59.0", @@ -551,7 +551,7 @@ source = "git+https://github.com/smol-rs/async-lock?rev=542831132f2c707aae1c380e dependencies = [ "event-listener 5.3.1", "event-listener-strategy", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -560,9 +560,9 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 2.3.4", + "async-io 2.4.0", "blocking", - "futures-lite 2.3.0", + "futures-lite 2.5.0", ] [[package]] @@ -572,15 +572,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" dependencies = [ "async-channel 2.3.1", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.3.0", "async-signal", "async-task", "blocking", "cfg-if 1.0.0", "event-listener 5.3.1", - "futures-lite 2.3.0", - "rustix 0.38.37", + "futures-lite 2.5.0", + "rustix 0.38.40", "tracing", ] @@ -592,7 +592,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -622,13 +622,13 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.3.0", "atomic-waker", "cfg-if 1.0.0", "futures-core", "futures-io", - "rustix 0.38.37", + "rustix 0.38.40", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -656,20 +656,20 @@ checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" dependencies = [ "async-channel 1.9.0", "async-global-executor", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.3.0", "async-process", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "gloo-timers", "kv-log-macro", "log", "memchr", "once_cell", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "pin-utils", "slab", "wasm-bindgen-futures", @@ -689,7 +689,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -713,11 +713,11 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -853,7 +853,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.87", "which", ] @@ -872,7 +872,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -962,7 +962,7 @@ checksum = "e0b121a9fe0df916e362fb3271088d071159cdf11db0e4182d02152850756eff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -992,7 +992,7 @@ dependencies = [ "async-channel 2.3.1", "async-task", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "piper", ] @@ -1090,9 +1090,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "camino" @@ -1139,9 +1139,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.30" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" dependencies = [ "jobserver", "libc", @@ -1324,7 +1324,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1352,9 +1352,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" @@ -1362,7 +1362,7 @@ version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "memchr", ] @@ -1535,9 +1535,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -1817,9 +1817,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" dependencies = [ "csv-core", "itoa", @@ -1887,9 +1887,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.77+curl-8.10.1" +version = "0.4.78+curl-8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f469e8a5991f277a208224f6c7ad72ecb5f986e36d09ae1f2c1bb9259478a480" +checksum = "8eec768341c5c7789611ae51cf6c459099f22e64a5d5d0ce4892434e33821eaf" dependencies = [ "cc", "libc", @@ -1925,7 +1925,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1954,7 +1954,7 @@ dependencies = [ "libc", "log", "num-bigint", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "plotters", "prettytable-rs", "rand 0.8.5", @@ -2011,10 +2011,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2419f39be147184d34144c0cbed3ac3bf7572f0c8703d7a605db5e0f85c66269" dependencies = [ "darkfi-derive-internal", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2025,7 +2025,23 @@ checksum = "a7000d1d42b2af380c7367b5cde93cc8cc3b44898d2c467f6d9de3011df9f6e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", +] + +[[package]] +name = "darkfi-eventgraph-py" +version = "0.1.0" +dependencies = [ + "async-std", + "blake3 1.5.4", + "darkfi", + "futures", + "pyo3", + "pyo3-asyncio", + "semver 1.0.23", + "sled-overlay", + "smol", + "url", ] [[package]] @@ -2073,19 +2089,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "darkfi-sdk-py" -version = "0.4.1" -dependencies = [ - "darkfi", - "darkfi-sdk", - "halo2_gadgets", - "halo2_proofs", - "plotters", - "pyo3", - "rand 0.8.5", -] - [[package]] name = "darkfi-serial" version = "0.4.2" @@ -2096,7 +2099,7 @@ dependencies = [ "blake3 1.5.4", "bridgetree", "darkfi-derive", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "num-bigint", "pasta_curves", "semver 1.0.23", @@ -2291,7 +2294,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2324,7 +2327,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2418,33 +2421,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-adhoc" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5283ac2881753c76c0892406705553f0d9ab30649f81e18964d3408f4501edb8" -dependencies = [ - "derive-adhoc-macros", - "heck 0.4.1", -] - -[[package]] -name = "derive-adhoc-macros" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c21b673a9b8c78c34908e6fcb42b922e11c4df2de5237f1c3f58d3285904a84b" -dependencies = [ - "heck 0.4.1", - "itertools 0.11.0", - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "sha3", - "strum 0.25.0", - "syn 1.0.109", - "void", -] - [[package]] name = "derive-deftly" version = "0.14.2" @@ -2464,12 +2440,12 @@ dependencies = [ "heck 0.5.0", "indexmap 2.6.0", "itertools 0.13.0", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "sha3", - "strum 0.26.3", - "syn 2.0.79", + "strum", + "syn 2.0.87", "void", ] @@ -2547,7 +2523,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "unicode-xid", ] @@ -2637,7 +2613,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2831,9 +2807,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if 1.0.0", ] @@ -2868,7 +2844,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2889,7 +2865,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2941,7 +2917,7 @@ checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -2951,7 +2927,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ "event-listener 5.3.1", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -2983,15 +2959,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fdeflate" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" +checksum = "07c6f4c64c1d33a3111c4466f7365ebdcc37c5bd1ea0d62aae2e3d722aacbedb" dependencies = [ "simd-adler32", ] @@ -3157,7 +3133,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3202,9 +3178,9 @@ dependencies = [ [[package]] name = "fs-mistrust" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf84fbaf375e6a485fa126f6335c0cfa7741114aa4f86ba37960a42cd1994b8" +checksum = "a12a327e6e1ee5595f66105852c644a2d65dfbc62c30c90f53a2783d270002de" dependencies = [ "derive_builder_fork_arti", "dirs", @@ -3322,21 +3298,21 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "waker-fn", ] [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ - "fastrand 2.1.1", + "fastrand 2.2.0", "futures-core", "futures-io", "parking", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -3347,7 +3323,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3386,7 +3362,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "pin-utils", "slab", ] @@ -3621,9 +3597,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" [[package]] name = "hashlink" @@ -3757,7 +3733,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "fnv", "itoa", ] @@ -3768,7 +3744,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "fnv", "itoa", ] @@ -3800,7 +3776,7 @@ dependencies = [ "cookie", "futures-lite 1.13.0", "infer", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "rand 0.7.3", "serde", "serde_json", @@ -3916,7 +3892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "serde", ] @@ -4036,15 +4012,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -4186,9 +4153,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "libloading" @@ -4202,9 +4169,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libnghttp2-sys" @@ -4623,7 +4590,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4671,10 +4638,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4756,9 +4723,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if 1.0.0", @@ -4777,7 +4744,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4788,18 +4755,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.2+3.3.2" +version = "300.4.0+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -5021,7 +4988,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -5035,22 +5002,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -5061,9 +5028,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -5078,7 +5045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.1", + "fastrand 2.2.0", "futures-io", ] @@ -5180,21 +5147,21 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "windows-sys 0.48.0", ] [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if 1.0.0", "concurrent-queue", "hermit-abi 0.4.0", - "pin-project-lite 0.2.14", - "rustix 0.38.37", + "pin-project-lite 0.2.15", + "rustix 0.38.40", "tracing", "windows-sys 0.59.0", ] @@ -5259,12 +5226,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -5301,23 +5268,13 @@ dependencies = [ "indexmap 2.6.0", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -5352,9 +5309,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -5412,11 +5369,11 @@ dependencies = [ [[package]] name = "pwd-grp" -version = "0.1.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6955c41fd7e4283bdf6ff3e7218b7e3f8ef24c4236b31d22be050f4cfd5e2a2c" +checksum = "b94fdf3867b7f2889a736f0022ea9386766280d2cca4bdbe41629ada9e4f3b8f" dependencies = [ - "derive-adhoc", + "derive-deftly", "libc", "paste", "thiserror", @@ -5424,9 +5381,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.21.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" dependencies = [ "cfg-if 1.0.0", "indoc", @@ -5440,11 +5397,36 @@ dependencies = [ "unindent", ] +[[package]] +name = "pyo3-asyncio" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea6b68e93db3622f3bb3bf363246cf948ed5375afe7abff98ccbdd50b184995" +dependencies = [ + "async-std", + "futures", + "once_cell", + "pin-project-lite 0.2.15", + "pyo3", + "pyo3-asyncio-macros", +] + +[[package]] +name = "pyo3-asyncio-macros" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c467178e1da6252c95c29ecf898b133f742e9181dca5def15dc24e19d45a39" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "pyo3-build-config" -version = "0.21.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" dependencies = [ "once_cell", "target-lexicon", @@ -5452,9 +5434,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" dependencies = [ "libc", "pyo3-build-config", @@ -5462,27 +5444,27 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "pyo3-macros-backend" -version = "0.21.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" dependencies = [ "heck 0.4.1", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -5670,13 +5652,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -5691,9 +5673,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -5787,7 +5769,7 @@ checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", - "bytes 1.7.2", + "bytes 1.8.0", "hashbrown 0.12.3", "indexmap 1.9.3", "ptr_meta", @@ -5927,9 +5909,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.6.0", "errno", @@ -5940,9 +5922,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ "log", "once_cell", @@ -6005,9 +5987,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safelog" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3939f5e7c65f96a54e7d2a6853e3994d691c95f54f5263916a2d1877dad70789" +checksum = "d00c331d3dad51d67db003b70b4e1ab8408c5b89f5830af4d282e612a75a84f3" dependencies = [ "derive_more", "educe", @@ -6074,7 +6056,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -6123,9 +6105,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -6162,13 +6144,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -6191,9 +6173,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -6260,7 +6242,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -6348,7 +6330,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "memmap2 0.6.2", ] @@ -6569,12 +6551,12 @@ dependencies = [ "async-channel 2.3.1", "async-executor", "async-fs", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.3.0", "async-net", "async-process", "blocking", - "futures-lite 2.3.0", + "futures-lite 2.5.0", ] [[package]] @@ -6651,9 +6633,9 @@ dependencies = [ [[package]] name = "ssh-key" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca9b366a80cf18bb6406f4cf4d10aebfb46140a8c0c33f666a144c5c76ecbafc" +checksum = "3b86f5297f0f04d08cabaa0f6bff7cb6aec4d9c3b49d87990d63da9d9156a8c3" dependencies = [ "p256", "p384", @@ -6815,35 +6797,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros 0.25.3", -] - [[package]] name = "strum" version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.26.4", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.79", + "strum_macros", ] [[package]] @@ -6856,7 +6816,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -6882,7 +6842,7 @@ dependencies = [ "log", "mime_guess", "once_cell", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "serde", "serde_json", "web-sys", @@ -6890,15 +6850,15 @@ dependencies = [ [[package]] name = "sval" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf38d1fa2ce984086ea42fb856a9f374d94680a4f796831a7fc868d7f2af1b9" +checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" [[package]] name = "sval_buffer" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81682ff859964ca1d7cf3d3d0f9ec7204ea04c2c32acb8cc2cf68ecbd3127354" +checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" dependencies = [ "sval", "sval_ref", @@ -6906,18 +6866,18 @@ dependencies = [ [[package]] name = "sval_dynamic" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a213b93bb4c6f4c9f9b17f2e740e077fd18746bbf7c80c72bbadcac68fa7ee4" +checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" dependencies = [ "sval", ] [[package]] name = "sval_fmt" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6902c6d3fb52c89206fe0dc93546c0123f7d48b5997fd14e61c9e64ff0b63275" +checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" dependencies = [ "itoa", "ryu", @@ -6926,9 +6886,9 @@ dependencies = [ [[package]] name = "sval_json" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a28041ea78cdc394b930ae6b897d36246dc240a29a6edf82d76562487fb0b4" +checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" dependencies = [ "itoa", "ryu", @@ -6937,9 +6897,9 @@ dependencies = [ [[package]] name = "sval_nested" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850346e4b0742a7f2fd2697d703ff80084d0b658f0f2e336d71b8a06abf9b68e" +checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" dependencies = [ "sval", "sval_buffer", @@ -6948,18 +6908,18 @@ dependencies = [ [[package]] name = "sval_ref" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824afd97a8919f28a35b0fdea979845cc2ae461a8a3aaa129455cb89c88bb77a" +checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" dependencies = [ "sval", ] [[package]] name = "sval_serde" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ada7520dd719ed672c786c7db7de4f5230f4d504b0821bd8305cd30ca442315" +checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" dependencies = [ "serde", "sval", @@ -6979,9 +6939,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -6996,7 +6956,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -7055,14 +7015,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.1.1", + "fastrand 2.2.0", "once_cell", - "rustix 0.38.37", + "rustix 0.38.40", "windows-sys 0.59.0", ] @@ -7097,22 +7057,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -7142,7 +7102,7 @@ dependencies = [ "http-types", "kv-log-macro", "log", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "routefinder", "serde", "serde_json", @@ -7286,7 +7246,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -7298,17 +7258,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.6.0", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.22" @@ -7319,7 +7268,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -7360,7 +7309,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23db3a71001bc0a3f25b0f6ee824b559d128768275811de0d913369990f9a83b" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "derive-deftly", "digest 0.10.7", "educe", @@ -7379,7 +7328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637cf998679d463138d9bffe07c55bec1c3ccc43a66e4a587d8952ceaa6ee7d4" dependencies = [ "bitflags 2.6.0", - "bytes 1.7.2", + "bytes 1.8.0", "caret", "derive_more", "educe", @@ -7529,7 +7478,7 @@ dependencies = [ "serde-value", "serde_ignored", "shellexpand", - "strum 0.26.3", + "strum", "thiserror", "toml 0.8.19", "tor-basic-utils", @@ -7610,7 +7559,7 @@ dependencies = [ "scopeguard", "serde", "signature", - "strum 0.26.3", + "strum", "thiserror", "time 0.3.36", "tor-async-utils", @@ -7643,7 +7592,7 @@ dependencies = [ "paste", "retry-error", "static_assertions", - "strum 0.26.3", + "strum", "thiserror", "tracing", "void", @@ -7673,7 +7622,7 @@ dependencies = [ "rand 0.8.5", "safelog", "serde", - "strum 0.26.3", + "strum", "thiserror", "tor-async-utils", "tor-basic-utils", @@ -7710,7 +7659,7 @@ dependencies = [ "retry-error", "safelog", "slotmap", - "strum 0.26.3", + "strum", "thiserror", "tor-async-utils", "tor-basic-utils", @@ -7789,7 +7738,7 @@ dependencies = [ "safelog", "serde", "serde_with", - "strum 0.26.3", + "strum", "thiserror", "tor-async-utils", "tor-basic-utils", @@ -7885,7 +7834,7 @@ dependencies = [ "safelog", "serde", "serde_with", - "strum 0.26.3", + "strum", "thiserror", "tor-basic-utils", "tor-bytes", @@ -7984,7 +7933,7 @@ dependencies = [ "rand 0.8.5", "serde", "static_assertions", - "strum 0.26.3", + "strum", "thiserror", "time 0.3.36", "tor-basic-utils", @@ -8079,7 +8028,7 @@ checksum = "073a996250f73d7a814d9049de321a1f59a710dc18b92a4da8d26f002a5735dd" dependencies = [ "asynchronous-codec", "bitvec", - "bytes 1.7.2", + "bytes 1.8.0", "cipher 0.4.4", "coarsetime", "derive_builder_fork_arti", @@ -8148,7 +8097,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df693852fb9a1c1a8bca1673fa3a8e1bca929fb2753165b1efce70f9381323b0" dependencies = [ - "async-io 2.3.4", + "async-io 2.4.0", "async-std", "async-trait", "async_executors", @@ -8185,7 +8134,7 @@ dependencies = [ "pin-project", "priority-queue", "slotmap", - "strum 0.26.3", + "strum", "thiserror", "tor-error", "tor-rtcompat", @@ -8224,7 +8173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "tracing-attributes", "tracing-core", ] @@ -8237,7 +8186,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -8307,7 +8256,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -8366,12 +8315,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" @@ -8469,9 +8415,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" @@ -8481,9 +8427,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" dependencies = [ "value-bag-serde1", "value-bag-sval2", @@ -8491,9 +8437,9 @@ dependencies = [ [[package]] name = "value-bag-serde1" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccacf50c5cb077a9abb723c5bcb5e0754c1a433f1e1de89edc328e2760b6328b" +checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" dependencies = [ "erased-serde", "serde", @@ -8502,9 +8448,9 @@ dependencies = [ [[package]] name = "value-bag-sval2" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1785bae486022dfb9703915d42287dcb284c1ee37bd1080eeba78cc04721285b" +checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" dependencies = [ "sval", "sval_buffer", @@ -8555,7 +8501,7 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -8634,7 +8580,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -8668,7 +8614,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8694,7 +8640,7 @@ version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d920d06243e9f456c336c428a34560357dedf59d9febaae14f1995ac120cff6" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "cfg-if 1.0.0", "derivative", "indexmap 1.9.3", @@ -8724,7 +8670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e01832173aa52345e480965f18c638a8a5a9e5e4d85a48675bdf1964147dc7f" dependencies = [ "backtrace", - "bytes 1.7.2", + "bytes 1.8.0", "cfg-if 1.0.0", "enum-iterator", "enumset", @@ -8932,7 +8878,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.37", + "rustix 0.38.40", ] [[package]] @@ -9261,15 +9207,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.20" @@ -9390,7 +9327,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -9410,7 +9347,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ad980f6941f8..d78496f0094d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,8 +36,8 @@ members = [ "bin/lilith", "src/sdk", - "src/sdk/python", - + #"src/sdk/python", + "src/event_graph/python", #"src/serial", #"src/serial/derive", #"src/serial/derive-internal", @@ -48,6 +48,7 @@ members = [ "src/contract/deployooor", "example/dchat/dchatd", + ] [dependencies] diff --git a/script/event_graph_bindings/README.md b/script/event_graph_bindings/README.md new file mode 100644 index 000000000000..e75e2472b631 --- /dev/null +++ b/script/event_graph_bindings/README.md @@ -0,0 +1,7 @@ +# build and install darkfi-eventgraph-py + +follow instructions in `src/event_graph/python/README.md` + +# run example + +make sure the environment under `src/event_graph/python` is activated, thhen run the example python scripts under this directory diff --git a/script/event_graph_bindings/broadcast_event.py b/script/event_graph_bindings/broadcast_event.py new file mode 100644 index 000000000000..0cad66262eff --- /dev/null +++ b/script/event_graph_bindings/broadcast_event.py @@ -0,0 +1,148 @@ +from darkfi_eventgraph_py import event_graph as eg, p2p, sled +import asyncio +import random +import time +import subprocess +import os +# number of nodes +N = 2 +P2PDATASTORE_PATH = '/tmp/p2pdatastore' +SLED_DB_PATH = '/tmp/sleddb' +os.system("rm -rf " + P2PDATASTORE_PATH+"*") +os.system("rm -rf " + SLED_DB_PATH+"*") + +def get_random_node_idx(): + return int(random.random()*N) + +async def start_p2p(node): + await p2p.start_p2p(node) + +async def get_fut_p2p(settings): + return await p2p.new_p2p(settings) + +async def get_fut_eg(node, sled_db): + return await eg.new_event_graph(node, sled_db, P2PDATASTORE_PATH, False, 'dag', 1) + +async def register_protocol(p2p_node, eg_node): + await p2p.register_protocol_p2p(p2p_node, eg_node) +# create p2p node +def new_nodes(starting_port=13200): + p2ps = [] + event_graphs = [] + for i in range(0, N): + node_id = '' + inbound_port = starting_port + i + external_port = starting_port + i + inbound_addrs = [p2p.Url("tcp://127.0.0.1:{}".format(inbound_port))] + external_addrs = [] + peers = [p2p.Url("tcp://127.0.0.1:{}".format(starting_port+j)) for j in range(0,N) if j!=i] + seeds = [] + app_version = p2p.new_version(0, 1, 1, '') + allowed_transports = ['tcp'] + transport_mixing = False + outbound_connections = 0#N + inbound_connections = 8 + outbound_connect_timeout = 15 + channel_handshake_timeout = 10 + channel_heartbeat_interval = 30 + localnet = True + outbound_peer_discovery_cooloff_time = 30 + outbound_peer_discovery_attempt_time = 5 + p2p_datastore = P2PDATASTORE_PATH+'{}'.format(0) + hostlist = '' + greylist_refinery_internval = 15 + white_connect_percnet = 70 + gold_connect_count = 2 + slot_preference_strict = False + time_with_no_connections = 30 + blacklist = [] + ban_policy = p2p.get_strict_banpolicy() + settings = p2p.new_settings( + node_id, + inbound_addrs, + external_addrs, + peers, + seeds, + app_version, + allowed_transports, + transport_mixing, + outbound_connections, + inbound_connections, + outbound_connect_timeout, + channel_handshake_timeout, + channel_heartbeat_interval, + localnet, + outbound_peer_discovery_cooloff_time, + outbound_peer_discovery_attempt_time, + p2p_datastore, + hostlist, + greylist_refinery_internval, + white_connect_percnet, + gold_connect_count, + slot_preference_strict, + time_with_no_connections, + blacklist, + ban_policy + ) + p2p_ptr = asyncio.run(get_fut_p2p(settings)) + sled_db = sled.SledDb(SLED_DB_PATH+'{}'.format(i)) + event_graph = asyncio.run(get_fut_eg(p2p_ptr, sled_db)) + # register event graph protocol + asyncio.run(register_protocol(p2p_ptr, event_graph)) + # start p2p node + asyncio.run(start_p2p(p2p_ptr)) + event_graphs+=[event_graph] + p2ps+=[p2p_ptr] + return (p2ps, event_graphs) + +async def create_new_event(data, event_graph_ptr): + return await eg.new_event(data, event_graph_ptr) + +async def insert_events(node, event): + ids = await node.dag_insert(event) + return ids + +async def broadcast_event_onp2p(p2p_node, event): + await p2p.broadcast_p2p(p2p_node, event) + +async def get_event_by_id(event_graph, event_id): + return await event_graph.dag_get(event_id) + +async def dag_sync(node): + await node.dag_sync() + +# create N nodes +p2ps, egs = new_nodes() + +# select random node +rnd_idx = get_random_node_idx() +random_node = egs[rnd_idx] +print('random node of index {} was selected: {}'.format(rnd_idx, egs[rnd_idx])) + +for evg in egs: + assert(evg.dag_len()==1) + +# create new event +event = asyncio.run(create_new_event([1,2,3], random_node)) +print("event: {}".format(event)) + +# insert event at random node +ids = asyncio.run(insert_events(random_node, [event])) +print("dag id: {}".format(ids[0])) + +# broadcast the new event +random_node_p2p = p2ps[rnd_idx] +asyncio.run(broadcast_event_onp2p(random_node_p2p, event)) + +# dag sync +#for eg in egs: +# asyncio.run(dag_sync(eg)) + +# get broadcasted event +event2 = asyncio.run(get_event_by_id(egs[rnd_idx], ids[0])) +print("broadcasted event: {}".format(event2)) + +# assert event is broadcast to all nodes +# FIXME +#for evg in egs: +# assert(evg.dag_len()==N+1) diff --git a/src/event_graph/mod.rs b/src/event_graph/mod.rs index 397b6746b542..c49e2d676149 100644 --- a/src/event_graph/mod.rs +++ b/src/event_graph/mod.rs @@ -198,6 +198,11 @@ impl EventGraph { self.days_rotation } + /// return dag length necessary for event graph bindings testing. + pub fn dag_len(&self) -> usize { + self.dag.len() + } + /// Sync the DAG from connected peers pub async fn dag_sync(&self) -> Result<()> { // We do an optimistic sync where we ask all our connected peers for diff --git a/src/event_graph/python/.gitignore b/src/event_graph/python/.gitignore new file mode 100644 index 000000000000..c8f044299db3 --- /dev/null +++ b/src/event_graph/python/.gitignore @@ -0,0 +1,72 @@ +/target + +# Byte-compiled / optimized / DLL files +__pycache__/ +.pytest_cache/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +.venv/ +env/ +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +include/ +man/ +venv/ +*.egg-info/ +.installed.cfg +*.egg + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt +pip-selfcheck.json + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Django stuff: +*.log +*.pot + +.DS_Store + +# Sphinx documentation +docs/_build/ + +# PyCharm +.idea/ + +# VSCode +.vscode/ + +# Pyenv +.python-version diff --git a/src/event_graph/python/Cargo.toml b/src/event_graph/python/Cargo.toml new file mode 100644 index 000000000000..c5a0689e7447 --- /dev/null +++ b/src/event_graph/python/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "darkfi-eventgraph-py" +version = "0.1.0" +edition = "2021" +authors = ["Dyne.org foundation "] +license = "AGPL-3.0-only" +homepage = "https://dark.fi" +repository = "https://codeberg.org/darkrenaissance/darkfi" + +[lib] +name = "darkfi_eventgraph_py" +crate-type = ["cdylib"] +doc = false + +[dependencies] +darkfi = { path = "../../..", features = ["net", "event-graph"] } +#darkfi-sdk = {path = "../../sdk"} +sled-overlay = {version = "0.1.4"} + +smol = {version = "2.0.2"} +url = {version = "2.5.2", features = ["serde"]} +futures = {version = "0.3.31"} + +pyo3 = {version = "0.20.0"} +#pyo3-asyncio = {version = "0.20.0", features = ["attributes", "tokio-runtime", "async-std-runtime"]} +pyo3-asyncio = {version = "0.20.0", features = ["attributes", "async-std-runtime"]} +async-std = "1.9" +semver = "1.0" +blake3 = {version = "1.5.4", features = ["rayon"]} +#pyo3-ffi = {version = "0.22.6"} +#tokio = "1.9" +# Blockchain store + + +[lints] +workspace = true diff --git a/src/event_graph/python/Makefile b/src/event_graph/python/Makefile new file mode 100644 index 000000000000..2331623cd6ba --- /dev/null +++ b/src/event_graph/python/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +# Maturin binary +MATURIN = maturin + +all: + $(MATURIN) build --release + +dev: + $(MATURIN) develop --release + +.PHONY: all dev diff --git a/src/event_graph/python/README.md b/src/event_graph/python/README.md new file mode 100644 index 000000000000..acba42c3c76d --- /dev/null +++ b/src/event_graph/python/README.md @@ -0,0 +1,97 @@ +# darkfi-eventgraph-py + +Python bindings for event-graph + +## Build and install + +1. Install `maturin` via your package manager or from source. +2. Run `make` to build the wheel +3. (Optional) Run pip install --user + +## Development + +For a development version you can use a venv: + +``` +$ python3 -m venv venv +$ source venv/bin/activate +(venv) $ make dev +``` + +## usage + +``` python +from darkfi_eventgraph_py import event_graph as eg, p2p, sled +import asyncio + +node_id = '' +inbound_addrs = [p2p.Url("tcp://127.0.0.1:53416")] +external_addrs = [p2p.Url("tcp://127.0.0.1:53416")] +peers = [p2p.Url("tcp://127.0.0.1:5345"), p2p.Url("tcp://127.0.0.1:53416")] +seeds = [] +app_version = p2p.new_version(0, 1, 1, '') +allowed_transports = []#['tcp+tls'] +transport_mixing = False +outbound_connections = 2 +inbound_connections = 8 +outbound_connect_timeout = 15 +channel_handshake_timeout = 10 +channel_heartbeat_interval = 30 +localnet = True +outbound_peer_discovery_cooloff_time = 30 +outbound_peer_discovery_attempt_time = 5 +p2p_datastore = '/tmp/p2pdatastore' +hostlist = '' +greylist_refinery_internval = 15 +white_connect_percnet = 70 +gold_connect_count = 2 +slot_preference_strict = False +time_with_no_connections = 30 +blacklist = [] +ban_policy = p2p.get_strict_banpolicy() +settings = p2p.new_settings( + node_id, + inbound_addrs, + external_addrs, + peers, + seeds, + app_version, + allowed_transports, + transport_mixing, + outbound_connections, + inbound_connections, + outbound_connect_timeout, + channel_handshake_timeout, + channel_heartbeat_interval, + localnet, + outbound_peer_discovery_cooloff_time, + outbound_peer_discovery_attempt_time, + p2p_datastore, + hostlist, + greylist_refinery_internval, + white_connect_percnet, + gold_connect_count, + slot_preference_strict, + time_with_no_connections, + blacklist, + ban_policy +) + +# create p2p node +async def new_p2p(): + p2p_ptr = await p2p.new_p2p(settings) + return p2p_ptr +p2p = asyncio.run(new_p2p()) + +# create sled database +sled_db = sled.SledDb('/tmp/sleddb') + +async def new_eg(): + return await eg.new_event_graph(p2p, sled_db, p2p_datastore, True, '', 0) +event_graph = asyncio.run(new_eg()) + +``` + +## pyo3 warnings + +if you see build warning ["non-local impl definition"](https://github.com/PyO3/pyo3/discussions/4083), ignore it, it's an issue with old pyo3 version, that was patched, in later versions, we forced to use pyo3 version 0.2 due to unmaintained pyo3-asyncio which depend on 0.2 pyo3. diff --git a/src/event_graph/python/pyproject.toml b/src/event_graph/python/pyproject.toml new file mode 100644 index 000000000000..7d7b76097882 --- /dev/null +++ b/src/event_graph/python/pyproject.toml @@ -0,0 +1,15 @@ +[build-system] +requires = ["maturin>=1.0,<2.0"] +build-backend = "maturin" + +[project] +name = "darkfi-eventgraph-py" +requires-python = ">=3.9" +classifiers = [ + "Programming Language :: Rust", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] + +[tool.maturin] +features = ["pyo3/extension-module"] diff --git a/src/event_graph/python/src/event_graph.rs b/src/event_graph/python/src/event_graph.rs new file mode 100644 index 000000000000..39dd3d5d8717 --- /dev/null +++ b/src/event_graph/python/src/event_graph.rs @@ -0,0 +1,253 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2024 Dyne.org foundation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +use super::{p2p::P2pPtr, sled::SledDb}; +use darkfi::{event_graph, event_graph::event, net}; +use pyo3::{ + prelude::PyModule, pyclass, pyfunction, pymethods, types::PyAny, wrap_pyfunction, PyCell, + PyResult, Python, +}; +use pyo3_asyncio; +use sled_overlay::sled; +use smol::Executor; +use std::{self, ops::Deref, path::PathBuf, sync::Arc}; + +#[pyclass] +pub struct EventGraphPtr(pub event_graph::EventGraphPtr); + +#[pyclass] +pub struct EventGraph(pub event_graph::EventGraph); + +#[pyfunction] +fn new_event_graph<'a>( + py: Python<'a>, + p2p: &P2pPtr, + sled_db: &SledDb, + datastore: PathBuf, + replay_mode: bool, + dag_tree_name: String, + days_rotation: u64, +) -> PyResult<&'a PyAny> { + //TODO (research) do we need to implement executors in python? + // Executor require lifetime, but pyclass forbid use of lifetimes + // because lifetime has no meaning in python which is + // a reference-counted language + let ex = Arc::new(Executor::new()); + let dag_tree_name_bind = dag_tree_name.clone(); + let p2p_ptr: net::P2pPtr = p2p.0.clone(); + let sled_db_bind: sled::Db = sled_db.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let event_graph = event_graph::EventGraph::new( + p2p_ptr, + sled_db_bind, + datastore, + replay_mode, + &*dag_tree_name_bind, + days_rotation, + ex, + ); + let eg_res: Result, darkfi::Error> = event_graph.await; + let eg: Arc = eg_res.unwrap(); + //note! pyclass implements IntoPy for EventGraphPtr + let eg_pyclass: EventGraphPtr = EventGraphPtr(eg); + Ok(eg_pyclass) + }) +} + +#[pyclass] +pub struct Event(pub event::Event); + +#[pyfunction] +fn new_event<'a>( + py: Python<'a>, + data: Vec, + eg_py: &PyCell, +) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = eg_py.borrow().deref().0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let eg: &event_graph::EventGraph = eg_ptr.deref(); + let event_fut = event::Event::new(data, eg); + let ev: event::Event = event_fut.await; + let event_py: Event = Event(ev); + Ok(event_py) + }) +} + +/* FIXME eg_option.exect fails +#[pyfunction] +fn egp2eg(eg_py: &PyCell) -> PyResult { + let eg_ptr : event_graph::EventGraphPtr = eg_py.borrow().deref().0.clone(); + let eg_option : Option = Arc::try_unwrap(eg_ptr).ok(); + let eg : event_graph::EventGraph = eg_option.expect("reason"); + Ok(EventGraph(eg)) +} +*/ + +/* +#[pyfunction] +fn egp_dag(eg_py: &PyCell) -> PyResult { + let eg_ptr : event_graph::EventGraphPtr = eg_py.borrow().deref().0.clone(); + Ok(eg_ptr.dag) +} + */ + +#[pyclass] +pub struct Hash(pub blake3::Hash); +//TODO implement new hash + +//#[pyclass] +//pub struct MessageInfo(event_graph::deg::MessageInfo); +// TODO impl new MessageInfo/constructor/builder + +/* +// note! only unit variants supported py pyclass, so implemnet MessageInfo class with boolean type send/recev being true or false. or enum send/recv embedded in the struct. +#[pyclass] +pub enum DegEvent { +SendMessage(MessageInfo), +RecvMessage(MessageInfo), +} +*/ + +#[pymethods] +impl EventGraphPtr { + // FIXME can't get conversion from PyAny to EventGraphPtr because it doesn't impl clone, in otherwords can you get future_into_py return anything other than PyAny if it doesn't implement clone? + /* + #[new] + fn new( + py: Python, + p2p: &P2pPtr, + sled_db: &SledDb, + datastore: PathBuf, + replay_mode: bool, + dag_tree_name: String, + days_rotation: u64, + ) -> PyResult { + let eg_pyany = new_event_graph(py, p2p, sled_db, datastore, replay_mode, dag_tree_name, days_rotation)?; + let eg : EventGraphPtr = eg_pyany.into(); + Ok(eg) + } + */ + + fn dag_sync<'a>(&'a self, py: Python<'a>) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let _ = eg_ptr.dag_sync().await; + Ok(()) + }) + } + + fn dag_insert<'a>( + &'a self, + py: Python<'a>, + events: Vec<&PyCell>, + ) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + let events_native: Vec = + events.iter().map(|i| i.borrow().deref().0.clone()).collect(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let ids_res: Result, darkfi::Error> = + eg_ptr.dag_insert(&events_native[..]).await; + let ids: Vec = ids_res.unwrap(); + let ids_native: Vec = ids.iter().map(|i| Hash(i.clone())).collect(); + Ok(ids_native) + }) + } + + fn dag_get<'a>( + &'a self, + py: Python<'a>, + event_id_native: &PyCell, + ) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + let event_id: blake3::Hash = event_id_native.borrow().deref().0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let event_res: Result, darkfi::Error> = + eg_ptr.dag_get(&event_id).await; + let event: event::Event = event_res + .unwrap() + .expect(&format!("expecting event in return with id: {}", event_id).to_string()); + let event_native: Event = Event(event); + Ok(event_native) + }) + } + + fn dag_len(&self, _py: Python) -> usize { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + eg_ptr.dag_len() + } + + fn order_events<'a>(&'a self, py: Python<'a>) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + eg_ptr.order_events().await; + Ok(()) + }) + } + + fn deg_enable<'a>(&'a self, py: Python<'a>) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + eg_ptr.deg_enable().await; + Ok(()) + }) + } + + fn deg_disable<'a>(&'a self, py: Python<'a>) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + eg_ptr.deg_disable().await; + Ok(()) + }) + } + + fn deg_subscribe<'a>(&'a self, py: Python<'a>) -> PyResult<&'a PyAny> { + let eg_ptr: event_graph::EventGraphPtr = self.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + eg_ptr.deg_subscribe().await; + Ok(()) + }) + } + + /* + //TODO impl + fn deg_notify<'a>(&'a self, py: Python<'a>, event: &PyCell) -> PyResult<&PyAny> { + let eg_ptr : event_graph::EventGraphPtr = self.0.clone(); + let event_native: event_graph::deg::DegEvent = match event.borrow().deref() { + DegEvent::SendMessage(m) => event_graph::deg::DegEvent::SendMessage(m), + DegEvent::RecvMessage(m) => event_graph::deg::DegEvent::RecvMessage(m), + }; + pyo3_asyncio::async_std::future_into_py(py, async move { + eg_ptr.deg_notify(&event_native).await; + Ok(()) + }) + } + */ +} + +pub fn create_module(py: Python<'_>) -> PyResult<&PyModule> { + let submod = PyModule::new(py, "event_graph")?; + submod.add_class::()?; + submod.add_class::()?; + submod.add_class::()?; + submod.add_class::()?; + submod.add_function(wrap_pyfunction!(new_event_graph, submod)?)?; + submod.add_function(wrap_pyfunction!(new_event, submod)?)?; + //submod.add_function(wrap_pyfunction!(egp2eg, submod)?)?; + //submod.add_function(wrap_pyfunction!(egp_dag, submod)?)?; + Ok(submod) +} diff --git a/src/event_graph/python/src/lib.rs b/src/event_graph/python/src/lib.rs new file mode 100644 index 000000000000..10eeae436fae --- /dev/null +++ b/src/event_graph/python/src/lib.rs @@ -0,0 +1,47 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2024 Dyne.org foundation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +mod event_graph; +mod p2p; +mod sled; + +#[pyo3::prelude::pymodule] +fn darkfi_eventgraph_py(py: pyo3::Python<'_>, m: &pyo3::prelude::PyModule) -> pyo3::PyResult<()> { + // sled + let submodule = sled::create_module(py)?; + pyo3::py_run!( + py, + submodule, + "import sys; sys.modules['darkfi_eventgraph_py.sled'] = submodule" + ); + m.add_submodule(submodule)?; + // p2p + let submodule = p2p::create_module(py)?; + pyo3::py_run!(py, submodule, "import sys; sys.modules['darkfi_eventgraph_py.p2p'] = submodule"); + m.add_submodule(submodule)?; + // event_graph + let submodule = event_graph::create_module(py)?; + pyo3::py_run!( + py, + submodule, + "import sys; sys.modules['darkfi_eventgraph_py.event_graph'] = submodule" + ); + m.add_submodule(submodule)?; + // + Ok(()) +} diff --git a/src/event_graph/python/src/p2p.rs b/src/event_graph/python/src/p2p.rs new file mode 100644 index 000000000000..39136ae4b136 --- /dev/null +++ b/src/event_graph/python/src/p2p.rs @@ -0,0 +1,251 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2024 Dyne.org foundation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +use crate::event_graph::{Event, EventGraphPtr}; +use darkfi::{event_graph, net}; +use pyo3::{ + prelude::PyModule, pyclass, pyfunction, pymethods, types::PyAny, wrap_pyfunction, PyCell, + PyResult, Python, +}; +use pyo3_asyncio; +use semver; +use smol; +use std::{ops::Deref, sync::Arc}; +use url; + +#[pyfunction] +fn parse_url(url: &str) -> PyResult { + match url::Url::parse(url) { + Ok(parsed) => Ok(parsed.into()), + Err(e) => Err(pyo3::exceptions::PyValueError::new_err(e.to_string())), + } +} + +#[pyclass] +pub struct Settings(pub net::Settings); + +#[pyclass] +pub struct Version(pub semver::Version); + +#[pyclass] +pub enum BanPolicy { + Strict, + Relaxed, +} + +#[pyclass] +struct Url(pub url::Url); + +#[pymethods] +impl Url { + #[new] + fn new(url_str: String) -> Self { + let url_res: PyResult = parse_url(&url_str); + Self(url::Url::parse(&url_res.unwrap()).unwrap()) + } +} + +#[pyfunction] +fn get_strict_banpolicy() -> PyResult { + Ok(BanPolicy::Strict) +} + +#[pyfunction] +fn get_relaxed_banpolicy() -> PyResult { + Ok(BanPolicy::Relaxed) +} + +#[pyfunction] +fn new_version(major: u64, minor: u64, patch: u64, prerelease: String) -> PyResult { + let version = semver::Version { + major, + minor, + patch, + pre: semver::Prerelease::new(&prerelease).unwrap(), + build: semver::BuildMetadata::EMPTY, + }; + Ok(Version(version)) +} + +type BlacklistEntry = (String, Vec, Vec); + +#[pyfunction] +fn new_settings( + node_id: String, + inbound_addrs: Vec<&PyCell>, + external_addrs: Vec<&PyCell>, + peers: Vec<&PyCell>, + seeds: Vec<&PyCell>, + app_version: &Version, + allowed_transports: Vec, + transport_mixing: bool, + outbound_connections: usize, + inbound_connections: usize, + outbound_connect_timeout: u64, + channel_handshake_timeout: u64, + channel_hearbeat_interval: u64, + localnet: bool, + outbound_peer_discovery_cooloff_time: u64, + outbound_peer_discovery_attempt_time: u64, + p2p_datastore: String, //option + hostlist: String, //option + greylist_refinery_interval: u64, + white_connect_percent: usize, + gold_connect_count: usize, + slot_preference_strict: bool, + time_with_no_connections: u64, + blacklist: Vec, + ban_policy: &BanPolicy, +) -> PyResult { + let settings = net::Settings { + node_id, + inbound_addrs: inbound_addrs.iter().map(|x| x.borrow().deref().0.clone()).collect(), + external_addrs: external_addrs.iter().map(|i| i.borrow().deref().0.clone()).collect(), + peers: peers.iter().map(|i| i.borrow().deref().0.clone()).collect(), + seeds: seeds.iter().map(|i| i.borrow().deref().0.clone()).collect(), + app_version: app_version.0.clone(), + allowed_transports, + transport_mixing, + outbound_connections, + inbound_connections, + outbound_connect_timeout, + channel_handshake_timeout, + channel_heartbeat_interval: channel_hearbeat_interval, + localnet, + outbound_peer_discovery_cooloff_time, + outbound_peer_discovery_attempt_time, + p2p_datastore: Some(p2p_datastore), + hostlist: Some(hostlist), + greylist_refinery_interval, + white_connect_percent, + gold_connect_count, + slot_preference_strict, + time_with_no_connections, + blacklist, + ban_policy: match ban_policy { + BanPolicy::Strict => net::BanPolicy::Strict, + BanPolicy::Relaxed => net::BanPolicy::Relaxed, + }, + }; + Ok(Settings(settings)) +} + +#[pyclass] +pub struct P2pPtr(pub net::P2pPtr); + +#[pymethods] +impl P2pPtr { + // FIXME can't get conversion from PyAny to EventGraphPtr because it doesn't impl clone, in otherwords can you get future_into_py return anything other than PyAny if it doesn't implement clone? + /* + #[new] + fn new<'a>(py: Python<'a>, settings: &'a Settings) -> PyResult { + let p2p_ptr_pyany : PyResult<&PyAny> = new_p2p(py, settings); + // if we return PyResult pyany.borrow_mut() require implementation of From for PyClassInitializer which is required by Result: IntoPyCallbackOutput<_> + // Ok(p2p_ptr.borrow_mut()) + // if we return PyResult<&'a PyAny>, we get error trait From<&PyAny> is not implemented for PyClassInitializer which is required by Result<&PyAny, PyErr>: IntoPyCallbackOutput<_> + //p2p_ptr + let p2p_ptr : P2pPtr = p2p_ptr_pyany.unwrap().borrow(); + Ok(p2p_ptr) + } + */ +} + +#[pyclass] +pub struct P2p(pub net::P2p); + +#[pyfunction] +fn new_p2p<'a>(py: Python<'a>, settings: &'a Settings) -> PyResult<&'a PyAny> { + let set: net::Settings = settings.0.clone(); + let ex = Arc::new(smol::Executor::new()); + let fut = net::P2p::new(set, ex); + pyo3_asyncio::async_std::future_into_py(py, async move { + let p2p_ptr_res: Result = fut.await; + let net_p2p_ptr_res: net::P2pPtr = match p2p_ptr_res { + Ok(p2p) => p2p, + Err(e) => panic!("unwraping p2p ptr failed: {}", e), + }; + let p2p_ptr: P2pPtr = P2pPtr(net_p2p_ptr_res); + Ok(p2p_ptr) + }) +} + +#[pyfunction] +fn start_p2p<'a>(py: Python<'a>, net_p2p_ptr: &'a P2pPtr) -> PyResult<&'a PyAny> { + let p2p_ptr: net::P2pPtr = net_p2p_ptr.0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let _ = p2p_ptr.start().await; + Ok(()) + }) +} + +#[pyfunction] +fn broadcast_p2p<'a>( + py: Python<'a>, + net_p2p_ptr: &'a P2pPtr, + event_py: &PyCell, +) -> PyResult<&'a PyAny> { + let p2p_ptr: net::P2pPtr = net_p2p_ptr.0.clone(); + let event: event_graph::Event = event_py.borrow().deref().0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + let _ = p2p_ptr.broadcast(&event_graph::proto::EventPut(event)).await; + Ok(()) + }) +} + +#[pyfunction] +fn register_protocol_p2p<'a>( + py: Python<'a>, + net_p2p_ptr: &'a P2pPtr, + event_graph: &PyCell, +) -> PyResult<&'a PyAny> { + let p2p_ptr: net::P2pPtr = net_p2p_ptr.0.clone(); + let eg: event_graph::EventGraphPtr = event_graph.borrow().deref().0.clone(); + pyo3_asyncio::async_std::future_into_py(py, async move { + *eg.synced.write().await = true; + let registry = p2p_ptr.protocol_registry(); + registry + .register(net::session::SESSION_DEFAULT, move |channel, _| { + let event_graph_ = eg.clone(); + async move { + event_graph::proto::ProtocolEventGraph::init(event_graph_, channel) + .await + .unwrap() + } + }) + .await; + Ok(()) + }) +} + +pub fn create_module(py: Python<'_>) -> PyResult<&PyModule> { + let submod = PyModule::new(py, "event_graph")?; + submod.add_class::()?; + submod.add_class::()?; + submod.add_class::()?; + submod.add_class::()?; + submod.add_function(wrap_pyfunction!(new_version, submod)?)?; + submod.add_function(wrap_pyfunction!(new_settings, submod)?)?; + submod.add_function(wrap_pyfunction!(get_strict_banpolicy, submod)?)?; + submod.add_function(wrap_pyfunction!(get_relaxed_banpolicy, submod)?)?; + submod.add_function(wrap_pyfunction!(parse_url, submod)?)?; + submod.add_function(wrap_pyfunction!(new_p2p, submod)?)?; + submod.add_function(wrap_pyfunction!(start_p2p, submod)?)?; + submod.add_function(wrap_pyfunction!(broadcast_p2p, submod)?)?; + submod.add_function(wrap_pyfunction!(register_protocol_p2p, submod)?)?; + Ok(submod) +} diff --git a/src/event_graph/python/src/sled.rs b/src/event_graph/python/src/sled.rs new file mode 100644 index 000000000000..fbffab4b0f4e --- /dev/null +++ b/src/event_graph/python/src/sled.rs @@ -0,0 +1,51 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2024 Dyne.org foundation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +use pyo3::{prelude::PyModule, pyclass, pymethods, PyResult, Python}; +use sled_overlay::sled; + +#[pyclass] +pub struct SledDb(pub sled::Db); + +#[pyclass] +pub struct SledTree(pub sled::Tree); + +#[pymethods] +impl SledDb { + #[new] + fn new(pathpy: String) -> Self { + let path: &std::path::Path = std::path::Path::new(&pathpy); + let db_res; + if pathpy == "" { + // note! with this method, make sure to drop db file for every new call + // if the file exists + db_res = sled::open(path); + } else { + // otherwise should use this without a path + db_res = sled::Config::new().temporary(true).open(); + }; + Self(db_res.unwrap()) + } +} + +pub(crate) fn create_module(py: Python<'_>) -> PyResult<&PyModule> { + let submod = PyModule::new(py, "sled")?; + submod.add_class::()?; + submod.add_class::()?; + Ok(submod) +}