From 80cb23c0c6843e8026cd5bee7cdf3bb3d50fa08f Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sat, 15 Jul 2023 16:18:13 -0400 Subject: [PATCH] remove rkyv --- Cargo.lock | 772 ++++++++---------- veilid-core/Cargo.toml | 138 ++-- .../src/crypto/types/byte_array_types.rs | 3 +- veilid-core/src/crypto/types/crypto_typed.rs | 19 +- .../src/crypto/types/crypto_typed_group.rs | 36 +- veilid-core/src/crypto/types/keypair.rs | 15 +- .../src/intf/native/protected_store.rs | 31 - veilid-core/src/intf/wasm/protected_store.rs | 35 - veilid-core/src/lib.rs | 11 +- veilid-core/src/network_manager/mod.rs | 4 + veilid-core/src/network_manager/native/mod.rs | 37 + .../src/network_manager/types/address.rs | 17 +- .../src/network_manager/types/address_type.rs | 19 +- .../types/connection_descriptor.rs | 17 +- .../network_manager/types/dial_info/mod.rs | 16 +- .../network_manager/types/dial_info/tcp.rs | 17 +- .../network_manager/types/dial_info/udp.rs | 17 +- .../src/network_manager/types/dial_info/ws.rs | 19 +- .../network_manager/types/dial_info/wss.rs | 17 +- .../network_manager/types/dial_info_class.rs | 17 +- .../network_manager/types/dial_info_filter.rs | 18 +- .../types/low_level_protocol_type.rs | 20 +- .../network_manager/types/network_class.rs | 17 +- .../src/network_manager/types/peer_address.rs | 19 +- .../network_manager/types/protocol_type.rs | 23 +- .../src/network_manager/types/signal_info.rs | 3 +- .../network_manager/types/socket_address.rs | 16 +- veilid-core/src/network_manager/wasm/mod.rs | 59 +- veilid-core/src/routing_table/bucket.rs | 15 +- veilid-core/src/routing_table/bucket_entry.rs | 19 +- veilid-core/src/routing_table/mod.rs | 41 +- .../route_spec_store/route_set_spec_detail.rs | 11 +- .../route_spec_store_content.rs | 13 +- .../route_spec_store/route_stats.rs | 17 +- .../tests/test_serialize_routing_table.rs | 2 +- .../routing_table/types/dial_info_detail.rs | 16 +- .../src/routing_table/types/direction.rs | 20 +- .../src/routing_table/types/node_info.rs | 53 +- .../src/routing_table/types/node_status.rs | 3 +- .../src/routing_table/types/peer_info.rs | 5 +- .../src/routing_table/types/routing_domain.rs | 14 +- .../types/signed_direct_node_info.rs | 5 +- .../routing_table/types/signed_node_info.rs | 5 +- .../types/signed_relayed_node_info.rs | 5 +- .../src/storage_manager/record_store.rs | 22 +- .../storage_manager/storage_manager_inner.rs | 15 +- .../types/local_record_detail.rs | 5 +- .../src/storage_manager/types/record.rs | 19 +- .../src/storage_manager/types/record_data.rs | 15 +- .../types/remote_record_detail.rs | 5 +- .../types/signed_value_data.rs | 15 +- .../types/signed_value_descriptor.rs | 14 +- veilid-core/src/table_store/table_db.rs | 50 +- veilid-core/src/table_store/table_store.rs | 11 +- .../src/table_store/tests/test_table_store.rs | 44 - veilid-core/src/tests/native/mod.rs | 4 - veilid-core/src/veilid_api/error.rs | 21 +- .../src/veilid_api/json_api/crypto_system.rs | 32 +- veilid-core/src/veilid_api/json_api/mod.rs | 14 +- .../veilid_api/json_api/routing_context.rs | 6 +- .../src/veilid_api/json_api/table_db.rs | 14 +- .../src/veilid_api/serialize_helpers/mod.rs | 13 +- .../serialize_helpers/rkyv_enum_set.rs | 53 -- .../serialize_helpers/rkyv_range_set_blaze.rs | 73 -- .../serialize_helpers/serialize_json.rs | 213 +++-- .../serialize_helpers/veilid_rkyv.rs | 151 ---- veilid-core/src/veilid_api/tests/mod.rs | 1 - .../veilid_api/tests/test_serialize_rkyv.rs | 16 - .../src/veilid_api/types/aligned_u64.rs | 21 +- .../src/veilid_api/types/app_message_call.rs | 38 +- .../types/dht/dht_record_descriptor.rs | 16 +- .../src/veilid_api/types/dht/schema/dflt.rs | 16 +- .../src/veilid_api/types/dht/schema/mod.rs | 16 +- .../src/veilid_api/types/dht/schema/smpl.rs | 32 +- .../src/veilid_api/types/dht/value_data.rs | 18 +- .../types/dht/value_subkey_range_set.rs | 17 +- veilid-core/src/veilid_api/types/fourcc.rs | 16 +- veilid-core/src/veilid_api/types/safety.rs | 74 +- veilid-core/src/veilid_api/types/stats.rs | 75 +- veilid-core/src/veilid_api/types/tunnel.rs | 86 +- .../src/veilid_api/types/veilid_log.rs | 37 +- .../src/veilid_api/types/veilid_state.rs | 143 +--- veilid-core/src/veilid_config.rs | 269 +----- veilid-core/tests/web.rs | 6 - veilid-flutter/rust/src/dart_ffi.rs | 2 +- veilid-tools/Cargo.toml | 1 - 86 files changed, 943 insertions(+), 2442 deletions(-) delete mode 100644 veilid-core/src/veilid_api/serialize_helpers/rkyv_enum_set.rs delete mode 100644 veilid-core/src/veilid_api/serialize_helpers/rkyv_range_set_blaze.rs delete mode 100644 veilid-core/src/veilid_api/serialize_helpers/veilid_rkyv.rs delete mode 100644 veilid-core/src/veilid_api/tests/test_serialize_rkyv.rs diff --git a/Cargo.lock b/Cargo.lock index 97c76291..88f2f1ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ "gimli", ] @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-logd-logger" @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anyhow" @@ -215,12 +215,13 @@ dependencies = [ [[package]] name = "argon2" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c2fcf79ad1932ac6269a738109997a83c227c09b75842ae564dc8ede6a861c" +checksum = "b2e554a8638bdc1e4eae9984845306cc95f8a9208ba8d49c3859fd958b46774d" dependencies = [ "base64ct", "blake2", + "cpufeatures", "password-hash", ] @@ -238,9 +239,9 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "as-slice" @@ -266,9 +267,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -318,7 +319,7 @@ dependencies = [ "log", "parking", "polling", - "rustix", + "rustix 0.37.23", "slab", "socket2 0.4.9", "waker-fn", @@ -346,7 +347,7 @@ dependencies = [ "cfg-if 1.0.0", "event-listener", "futures-lite", - "rustix", + "rustix 0.37.23", "signal-hook", "windows-sys 0.48.0", ] @@ -373,7 +374,7 @@ dependencies = [ "log", "memchr", "once_cell", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "pin-utils", "slab", "wasm-bindgen-futures", @@ -402,7 +403,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", ] [[package]] @@ -413,7 +414,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -444,20 +445,20 @@ dependencies = [ "futures-core", "futures-io", "rustls 0.20.8", - "rustls-pemfile 1.0.2", + "rustls-pemfile 1.0.3", "webpki 0.22.0", "webpki-roots 0.22.6", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -483,7 +484,7 @@ dependencies = [ "futures-io", "futures-util", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "tungstenite 0.19.0", ] @@ -499,9 +500,9 @@ dependencies = [ "futures-task", "futures-timer", "futures-util", - "pin-project 1.1.0", + "pin-project 1.1.2", "rustc_version 0.4.0", - "tokio 1.28.2", + "tokio 1.29.1", "wasm-bindgen-futures", ] @@ -576,7 +577,7 @@ dependencies = [ "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "rustversion", "serde", "sync_wrapper", @@ -604,15 +605,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ "addr2line", "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -697,9 +698,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "bitvec" @@ -724,9 +725,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b71f35bd3fa1a4c86b85d32c8b9069ea7fe14f7a53cfabb65f62d4265b888" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" dependencies = [ "arrayref", "arrayvec", @@ -831,28 +832,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "bytecheck" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "bytemuck" version = "1.13.1" @@ -885,9 +864,9 @@ checksum = "95e65021d89250bbfe7c2791789ced2c4bdc21b0e8bb59c64f3fd6145a5fd678" [[package]] name = "capnpc" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a9ad66f56468a890565d818ec4ab1300c1f6c62adbbc3295392f61d8f7dbd7" +checksum = "fbbc3763fb3e6635188e9cc51ee11a26f8777c553ca377430818dbebaaf6042b" dependencies = [ "capnp", ] @@ -1072,7 +1051,7 @@ dependencies = [ "atty", "bitflags 1.3.2", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "strsim 0.10.0", "termcolor", "textwrap 0.16.0", @@ -1080,21 +1059,20 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.4" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80672091db20273a15cf9fdd4e47ed43b5091ec9841bf4c6145c9dfbbcae09ed" +checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.3.4" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1458a1df40e1e2afebb7ab60ce55c1fa8f431146205aa5f4887e0b111c27636" +checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" dependencies = [ "anstyle", - "bitflags 1.3.2", "clap_lex 0.5.0", ] @@ -1204,9 +1182,9 @@ dependencies = [ [[package]] name = "console-subscriber" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ab2224a0311582eb03adba4caaf18644f7b1f10a760803a803b9b605187fc7" +checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" dependencies = [ "console-api", "crossbeam-channel", @@ -1218,7 +1196,7 @@ dependencies = [ "serde", "serde_json", "thread_local", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", "tonic 0.9.2", "tracing", @@ -1254,9 +1232,9 @@ checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] name = "constant_time_eq" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" @@ -1316,9 +1294,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -1341,7 +1319,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.3.4", + "clap 4.3.12", "criterion-plot", "futures", "is-terminal", @@ -1487,7 +1465,7 @@ dependencies = [ "libc", "log", "signal-hook", - "tokio 1.28.2", + "tokio 1.29.1", "unicode-segmentation", "unicode-width", ] @@ -1502,7 +1480,7 @@ dependencies = [ "flexi_logger", "lazy_static", "log", - "time 0.3.22", + "time 0.3.23", "unicode-width", ] @@ -1544,9 +1522,9 @@ dependencies = [ "owning_ref", "serde_json", "serde_yaml", - "time 0.3.22", - "tokio 1.28.2", - "toml 0.7.4", + "time 0.3.23", + "tokio 1.29.1", + "toml 0.7.6", "unicode-segmentation", "unicode-width", "xi-unicode", @@ -1595,12 +1573,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -1619,15 +1597,15 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -1643,23 +1621,23 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.12.3", + "hashbrown 0.14.0", "lock_api", "once_cell", "parking_lot_core 0.9.8", @@ -1782,22 +1760,22 @@ dependencies = [ [[package]] name = "enum-map" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988f0d17a0fa38291e5f41f71ea8d46a5d5497b9054d5a759fae2cbb819f2356" +checksum = "017b207acb4cc917f4c31758ed95c0bc63ddb0f358b22eb38f80a2b2a43f6b1f" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4da76b3b6116d758c7ba93f7ec6a35d2e2cf24feda76c6e38a375f4d5c59f2" +checksum = "8560b409800a72d2d7860f8e5f4e0b0bd22bea6a352ea2a9ce30ccdef7f16d2f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -1837,10 +1815,10 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -1876,6 +1854,12 @@ dependencies = [ "regex", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -2037,7 +2021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -2055,7 +2039,7 @@ dependencies = [ "regex", "rustversion", "thiserror", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -2067,7 +2051,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "pin-project 1.1.0", + "pin-project 1.1.2", "spin 0.9.8", ] @@ -2198,7 +2182,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "waker-fn", ] @@ -2210,7 +2194,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -2248,16 +2232,16 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "pin-utils", "slab", ] [[package]] name = "gen_ops" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c56cad8ee78109d547e40bf4ad78968a25157e7963d799d79921655629825a" +checksum = "304de19db7028420975a296ab0fcbbc8e69438c4ed254a1e41e2a7f37d5f0e0a" [[package]] name = "generic-array" @@ -2347,9 +2331,9 @@ dependencies = [ [[package]] name = "gloo-utils" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" +checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" dependencies = [ "js-sys", "serde", @@ -2390,9 +2374,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes 1.4.0", "fnv", @@ -2400,9 +2384,9 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-util", "tracing", ] @@ -2509,18 +2493,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -2578,7 +2553,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes 1.4.0", "http", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", ] [[package]] @@ -2601,9 +2576,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes 1.4.0", "futures-channel", @@ -2615,9 +2590,9 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "socket2 0.4.9", - "tokio 1.28.2", + "tokio 1.29.1", "tower-service", "tracing", "want", @@ -2630,8 +2605,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ "hyper", - "pin-project-lite 0.2.9", - "tokio 1.28.2", + "pin-project-lite 0.2.10", + "tokio 1.29.1", "tokio-io-timeout", ] @@ -2709,7 +2684,7 @@ dependencies = [ "simplelog 0.9.0", "tokio 0.2.25", "tokio 0.3.7", - "tokio 1.28.2", + "tokio 1.29.1", "url", "xmltree", ] @@ -2789,6 +2764,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "inout" version = "0.1.3" @@ -2825,7 +2810,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -2853,19 +2838,18 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", + "hermit-abi 0.3.2", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -2880,9 +2864,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "jni" @@ -3022,7 +3006,7 @@ dependencies = [ "keyvaluedb", "keyvaluedb-shared-tests", "parking_lot 0.12.1", - "tokio 1.28.2", + "tokio 1.29.1", "wasm-bindgen-futures", "wasm-bindgen-test", ] @@ -3051,9 +3035,9 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "rusqlite", - "sysinfo 0.29.2", + "sysinfo 0.29.4", "tempfile", - "tokio 1.28.2", + "tokio 1.29.1", ] [[package]] @@ -3100,9 +3084,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -3149,6 +3133,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "lock_api" version = "0.4.10" @@ -3186,12 +3176,6 @@ dependencies = [ "libc", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -3204,7 +3188,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -3270,15 +3254,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -3481,6 +3456,17 @@ dependencies = [ "netlink-packet-utils", ] +[[package]] +name = "netlink-packet-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" +dependencies = [ + "anyhow", + "byteorder", + "netlink-packet-utils", +] + [[package]] name = "netlink-packet-route" version = "0.15.0" @@ -3491,7 +3477,21 @@ dependencies = [ "bitflags 1.3.2", "byteorder", "libc", - "netlink-packet-core", + "netlink-packet-core 0.5.0", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6de2fe935f44cbdfcab77dce2150d68eda75be715cd42d4d6f52b0bd4dcc5b1" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core 0.7.0", "netlink-packet-utils", ] @@ -3509,17 +3509,17 @@ dependencies = [ [[package]] name = "netlink-proto" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26305d12193227ef7b8227e7d61ae4eaf174607f79bd8eeceff07aacaefde497" +checksum = "842c6770fc4bb33dd902f41829c61ef872b8e38de1405aa0b938b27b8fba12c3" dependencies = [ "bytes 1.4.0", "futures", "log", - "netlink-packet-core", + "netlink-packet-core 0.7.0", "netlink-sys", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", ] [[package]] @@ -3533,7 +3533,7 @@ dependencies = [ "futures", "libc", "log", - "tokio 1.28.2", + "tokio 1.29.1", ] [[package]] @@ -3635,9 +3635,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ "num-bigint", "num-complex", @@ -3711,11 +3711,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] @@ -3780,9 +3780,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] @@ -3831,7 +3831,7 @@ dependencies = [ "prost", "protobuf", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", "tonic 0.8.3", ] @@ -3869,10 +3869,10 @@ dependencies = [ "fnv", "futures-channel", "futures-util", - "indexmap", + "indexmap 1.9.3", "js-sys", "once_cell", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "thiserror", ] @@ -3895,7 +3895,7 @@ dependencies = [ "percent-encoding", "rand 0.8.5", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", ] @@ -3963,9 +3963,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.0" +version = "3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "430d26d62e66cbff6ae144e8eebd43c0235922dec7e3aa0d2016c32d4575bf45" +checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" dependencies = [ "arrayvec", "bitvec", @@ -3977,9 +3977,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.0" +version = "3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1620b1e3fc72ebaee01ff56fca838bab537c5d093a18b3549c3bbea374aa0b6" +checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -4038,7 +4038,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -4054,9 +4054,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" [[package]] name = "pathdiff" @@ -4078,9 +4078,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" dependencies = [ "thiserror", "ucd-trie", @@ -4088,9 +4088,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" +checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" dependencies = [ "pest", "pest_generator", @@ -4098,22 +4098,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" +checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] name = "pest_meta" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" dependencies = [ "once_cell", "pest", @@ -4127,7 +4127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -4151,11 +4151,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ - "pin-project-internal 1.1.0", + "pin-project-internal 1.1.2", ] [[package]] @@ -4171,13 +4171,13 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -4188,9 +4188,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -4242,7 +4242,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -4257,7 +4257,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "windows-sys 0.48.0", ] @@ -4328,9 +4328,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] @@ -4395,26 +4395,6 @@ version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -4423,9 +4403,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -4509,16 +4489,14 @@ dependencies = [ [[package]] name = "range-set-blaze" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85443a0bf00e4fca6fc4500501c8673d3255c46d5760e8b648308c3d1b9d2203" +checksum = "cf36131a8443d1cda3cd66eeac16d60ce46aa7c415f71e12c28d95c195e3ff23" dependencies = [ "gen_ops", "itertools", "num-integer", "num-traits", - "rand 0.8.5", - "thiserror", ] [[package]] @@ -4580,13 +4558,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-automata 0.3.3", + "regex-syntax 0.7.4", ] [[package]] @@ -4598,6 +4577,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -4606,18 +4596,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" - -[[package]] -name = "rend" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" -dependencies = [ - "bytecheck", -] +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "resolv-conf" @@ -4644,34 +4625,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rkyv" -version = "0.7.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" -dependencies = [ - "bitvec", - "bytecheck", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rlp" version = "0.5.2" @@ -4707,21 +4660,21 @@ dependencies = [ [[package]] name = "rtnetlink" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7d42da676fdf7e470e2502717587dd1089d8b48d9d1b846dcc3c01072858cb" +checksum = "6333af2adba73478936174a0ef3edf05fbfa058539c21d567344a53bb6d75cfd" dependencies = [ "async-global-executor", "futures", "log", - "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-core 0.7.0", + "netlink-packet-route 0.17.0", "netlink-packet-utils", "netlink-proto", "netlink-sys", "nix 0.26.2", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", ] [[package]] @@ -4730,7 +4683,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "fallible-iterator", "fallible-streaming-iterator", "hashlink 0.8.3", @@ -4805,15 +4758,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", "windows-sys 0.48.0", ] @@ -4853,18 +4819,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.2", ] [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.101.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" dependencies = [ "ring", "untrusted", @@ -4872,15 +4838,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "same-file" @@ -4947,21 +4913,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "secrecy" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" -dependencies = [ - "zeroize", -] - [[package]] name = "secret-service" version = "2.0.2" @@ -5043,9 +4994,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.164" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" dependencies = [ "serde_derive", ] @@ -5071,13 +5022,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -5093,9 +5044,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.97" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" dependencies = [ "itoa", "ryu", @@ -5104,31 +5055,31 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" dependencies = [ "serde", ] [[package]] name = "serde_yaml" -version = "0.9.21" +version = "0.9.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" dependencies = [ - "indexmap", + "indexmap 2.0.0", "itoa", "ryu", "serde", @@ -5304,12 +5255,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - [[package]] name = "simplelog" version = "0.9.0" @@ -5329,7 +5274,7 @@ checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -5343,9 +5288,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "snailquote" @@ -5471,7 +5416,7 @@ dependencies = [ "async-channel", "cfg-if 1.0.0", "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", ] [[package]] @@ -5511,9 +5456,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" dependencies = [ "proc-macro2", "quote", @@ -5554,9 +5499,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.2" +version = "0.29.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9557d0845b86eea8182f7b10dff120214fb6cd9fd937b6f4917714e546a38695" +checksum = "751e810399bba86e9326f5762b7f32ac5a085542df78da6a78d94e07d14d7c11" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys 0.8.4", @@ -5583,7 +5528,7 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.23", "windows-sys 0.48.0", ] @@ -5613,22 +5558,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -5680,16 +5625,16 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "libc", "num_threads", "serde", "time-core", - "time-macros 0.2.9", + "time-macros 0.2.10", ] [[package]] @@ -5710,9 +5655,9 @@ dependencies = [ [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -5789,22 +5734,23 @@ dependencies = [ "autocfg", "libc", "mio 0.7.14", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", ] [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes 1.4.0", "libc", "mio 0.8.8", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "signal-hook-registry", "socket2 0.4.9", "tokio-macros", @@ -5818,8 +5764,8 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "pin-project-lite 0.2.9", - "tokio 1.28.2", + "pin-project-lite 0.2.10", + "tokio 1.29.1", ] [[package]] @@ -5830,7 +5776,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -5840,8 +5786,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", - "tokio 1.28.2", + "pin-project-lite 0.2.10", + "tokio 1.29.1", ] [[package]] @@ -5854,8 +5800,8 @@ dependencies = [ "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.9", - "tokio 1.28.2", + "pin-project-lite 0.2.10", + "tokio 1.29.1", "tracing", ] @@ -5870,9 +5816,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -5882,20 +5828,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap", + "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", @@ -5921,10 +5867,10 @@ dependencies = [ "hyper", "hyper-timeout", "percent-encoding", - "pin-project 1.1.0", + "pin-project 1.1.2", "prost", "prost-derive", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", "tokio-util", "tower", @@ -5952,9 +5898,9 @@ dependencies = [ "hyper", "hyper-timeout", "percent-encoding", - "pin-project 1.1.0", + "pin-project 1.1.2", "prost", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", "tower", "tower-layer", @@ -5983,12 +5929,12 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", - "pin-project 1.1.0", - "pin-project-lite 0.2.9", + "indexmap 1.9.3", + "pin-project 1.1.2", + "pin-project-lite 0.2.10", "rand 0.8.5", "slab", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-util", "tower-layer", "tower-service", @@ -6015,7 +5961,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.10", "tracing-attributes", "tracing-core", ] @@ -6027,19 +5973,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.22", + "time 0.3.23", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -6068,7 +6014,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.1.0", + "pin-project 1.1.2", "tracing", ] @@ -6155,9 +6101,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" +checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" dependencies = [ "serde", "stable_deref_trait", @@ -6183,7 +6129,7 @@ dependencies = [ "smallvec", "thiserror", "tinyvec", - "tokio 1.28.2", + "tokio 1.29.1", "tracing", "url", ] @@ -6203,7 +6149,7 @@ dependencies = [ "resolv-conf", "smallvec", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", "tracing", "trust-dns-proto", ] @@ -6260,9 +6206,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uint" @@ -6284,9 +6230,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-normalization" @@ -6360,12 +6306,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "uuid" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81" - [[package]] name = "valuable" version = "0.1.0" @@ -6374,9 +6314,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d330786735ea358f3bc09eea4caa098569c1c93f342d9aca0514915022fe7e" +checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" [[package]] name = "vcpkg" @@ -6421,7 +6361,7 @@ dependencies = [ "serial_test", "stop-token", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-util", "veilid-tools", ] @@ -6474,10 +6414,9 @@ dependencies = [ "keyvaluedb-web", "lazy_static", "libc", - "maplit", "ndk", "ndk-glue", - "netlink-packet-route", + "netlink-packet-route 0.15.0", "netlink-sys", "nix 0.26.2", "num-traits", @@ -6487,13 +6426,11 @@ dependencies = [ "parking_lot 0.12.1", "paste", "range-set-blaze", - "rkyv", "rtnetlink", "rusqlite", "rustls 0.19.1", "rustls-pemfile 0.2.1", "schemars", - "secrecy", "send_wrapper 0.6.0", "serde", "serde-big-array", @@ -6505,7 +6442,7 @@ dependencies = [ "static_assertions", "stop-token", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", "tokio-util", "tracing", @@ -6522,7 +6459,7 @@ dependencies = [ "weak-table", "web-sys", "webpki 0.22.0", - "webpki-roots 0.23.1", + "webpki-roots 0.24.0", "wee_alloc", "winapi 0.3.9", "windows 0.38.0", @@ -6551,7 +6488,7 @@ dependencies = [ "parking_lot 0.12.1", "serde", "serde_json", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", "tokio-util", "tracing", @@ -6596,7 +6533,7 @@ dependencies = [ "signal-hook-async-std", "stop-token", "sysinfo 0.28.4", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-stream", "tokio-util", "tracing", @@ -6632,7 +6569,6 @@ dependencies = [ "lazy_static", "libc", "log", - "maplit", "ndk", "ndk-glue", "nix 0.26.2", @@ -6649,7 +6585,7 @@ dependencies = [ "static_assertions", "stop-token", "thiserror", - "tokio 1.28.2", + "tokio 1.29.1", "tokio-util", "tracing", "tracing-oslog", @@ -6764,7 +6700,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", "wasm-bindgen-shared", ] @@ -6798,7 +6734,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6900,9 +6836,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ "rustls-webpki", ] @@ -7030,7 +6966,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -7069,7 +7005,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -7089,9 +7025,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", @@ -7218,9 +7154,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" dependencies = [ "memchr", ] @@ -7314,9 +7250,9 @@ checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" [[package]] name = "xml-rs" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52839dc911083a8ef63efa4d039d1f58b5e409f923e44c80828f206f66e5541c" +checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" [[package]] name = "xmltree" @@ -7388,7 +7324,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] diff --git a/veilid-core/Cargo.toml b/veilid-core/Cargo.toml index baced512..1b7848c0 100644 --- a/veilid-core/Cargo.toml +++ b/veilid-core/Cargo.toml @@ -31,100 +31,126 @@ veilid_core_android_tests = ["dep:paranoid-android"] veilid_core_ios_tests = ["dep:tracing-oslog"] network-result-extra = ["veilid-tools/network-result-extra"] +### DEPENDENCIES + [dependencies] + +# Tools veilid-tools = { path = "../veilid-tools", features = [ "tracing" ] } +paste = "1.0.12" +once_cell = "^1" +owning_ref = "^0" +backtrace = { version = "^0" } +num-traits = "0.2.15" +shell-words = "1.1.0" +static_assertions = "^1" +cfg-if = "^1" +hex = "^0" +lazy_static = "^1" +directories = "^4" + +# Logging tracing = { version = "^0", features = ["log", "attributes"] } tracing-subscriber = "^0" tracing-error = "^0" eyre = "^0" -capnp = { version = "^0", default_features = false } -static_assertions = "^1" -cfg-if = "^1" thiserror = "^1" -hex = "^0" -generic-array = "^0" -secrecy = "^0" -chacha20poly1305 = "^0" -chacha20 = "^0" -hashlink = { path = "../external/hashlink", features = ["serde_impl"] } -serde = { version = "^1", features = ["derive" ] } -serde_json = { version = "^1" } -serde-big-array = "^0" -futures-util = { version = "^0", default_features = false, features = ["alloc"] } -parking_lot = "^0" -lazy_static = "^1" -directories = "^4" -once_cell = "^1" -json = "^0" -owning_ref = "^0" -flume = { version = "^0", features = ["async"] } -enumset = { version= "^1", features = ["serde"] } -backtrace = { version = "^0" } -stop-token = { version = "^0", default-features = false } -num-traits = "0.2.15" -shell-words = "1.1.0" +# Data structures +enumset = { version= "^1", features = ["serde"] } +keyvaluedb = { path = "../external/keyvaluedb/keyvaluedb" } +range-set-blaze = "0.1.5" +weak-table = "0.3.2" +generic-array = "^0" +hashlink = { path = "../external/hashlink", features = ["serde_impl"] } + +# System +futures-util = { version = "^0", default_features = false, features = ["alloc"] } +flume = { version = "^0", features = ["async"] } +parking_lot = "^0" +stop-token = { version = "^0", default-features = false } + +# Crypto ed25519-dalek = { version = "^1", default_features = false, features = ["alloc", "u64_backend"] } x25519-dalek = { version = "^1", default_features = false, features = ["u64_backend"] } curve25519-dalek = { version = "^3", default_features = false, features = ["alloc", "u64_backend"] } blake3 = { version = "^1" } +chacha20poly1305 = "^0" +chacha20 = "^0" +argon2 = "0.5.0" - +# Network async-std-resolver = { version = "^0", optional = true } trust-dns-resolver = { version = "^0", optional = true } enum-as-inner = "=0.5.1" # temporary fix for trust-dns-resolver v0.22.0 -keyvaluedb = { path = "../external/keyvaluedb/keyvaluedb" } - -rkyv = { version = "^0", default_features = false, features = ["std", "alloc", "strict", "size_32", "validation"] } +# Serialization +capnp = { version = "^0", default_features = false } +serde = { version = "^1", features = ["derive" ] } +serde_json = { version = "^1" } +serde-big-array = "^0" +json = "^0" data-encoding = { version = "^2" } -weak-table = "0.3.2" -range-set-blaze = "0.1.5" -argon2 = "0.5.0" -paste = "1.0.12" schemars = "0.8.12" # Dependencies for native builds only # Linux, Windows, Mac, iOS, Android [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -async-std = { version = "^1", features = ["unstable"], optional = true} -tokio = { version = "^1", features = ["full"], optional = true} -tokio-util = { version = "^0", features = ["compat"], optional = true} -tokio-stream = { version = "^0", features = ["net"], optional = true} -async-io = { version = "^1" } -async-tungstenite = { version = "^0", features = ["async-tls"] } -maplit = "^1" + +# Tools config = { version = "^0", features = ["yaml"] } -keyring-manager = { path = "../external/keyring-manager" } -async-tls = "^0.11" -igd = { path = "../external/rust-igd" } -webpki = "^0" -webpki-roots = "^0" -rustls = "^0.19" -rustls-pemfile = "^0.2" -futures-util = { version = "^0", default-features = false, features = ["async-await", "sink", "std", "io"] } -keyvaluedb-sqlite = { path = "../external/keyvaluedb/keyvaluedb-sqlite" } -socket2 = { version = "^0", features = ["all"] } bugsalot = { git = "https://github.com/crioux/bugsalot.git" } chrono = "^0" libc = "^0" nix = "^0" +# System +async-std = { version = "^1", features = ["unstable"], optional = true} +tokio = { version = "^1", features = ["full"], optional = true} +tokio-util = { version = "^0", features = ["compat"], optional = true} +tokio-stream = { version = "^0", features = ["net"], optional = true} +async-io = { version = "^1" } +futures-util = { version = "^0", default-features = false, features = ["async-await", "sink", "std", "io"] } + +# Data structures +keyring-manager = { path = "../external/keyring-manager" } +keyvaluedb-sqlite = { path = "../external/keyvaluedb/keyvaluedb-sqlite" } + +# Network +async-tungstenite = { version = "^0", features = ["async-tls"] } +igd = { path = "../external/rust-igd" } +async-tls = "^0.11" +webpki = "^0" +webpki-roots = "^0" +rustls = "^0.19" +rustls-pemfile = "^0.2" +socket2 = { version = "^0", features = ["all"] } + # Dependencies for WASM builds only [target.'cfg(target_arch = "wasm32")'.dependencies] + +# Tools +getrandom = { version = "^0", features = ["js"] } + +# System +async_executors = { version = "^0", default-features = false, features = [ "bindgen", "timer" ]} +async-lock = "^2" wasm-bindgen = "^0" js-sys = "^0" wasm-bindgen-futures = "^0" -keyvaluedb-web = { path = "../external/keyvaluedb/keyvaluedb-web" } -getrandom = { version = "^0", features = ["js"] } -ws_stream_wasm = "^0" -async_executors = { version = "^0", default-features = false, features = [ "bindgen", "timer" ]} -async-lock = "^2" send_wrapper = { version = "^0", features = ["futures"] } + +# Network +ws_stream_wasm = "^0" + +# Logging wasm-logger = "^0" tracing-wasm = "^0" -# Configuration for WASM32 'web-sys' crate +# Data Structures +keyvaluedb-web = { path = "../external/keyvaluedb/keyvaluedb-web" } + +### Configuration for WASM32 'web-sys' crate [target.'cfg(target_arch = "wasm32")'.dependencies.web-sys] version = "^0" features = [ diff --git a/veilid-core/src/crypto/types/byte_array_types.rs b/veilid-core/src/crypto/types/byte_array_types.rs index 9d60d4f4..4cdf2300 100644 --- a/veilid-core/src/crypto/types/byte_array_types.rs +++ b/veilid-core/src/crypto/types/byte_array_types.rs @@ -77,8 +77,7 @@ where macro_rules! byte_array_type { ($name:ident, $size:expr, $encoded_size:expr) => { - #[derive(Clone, Copy, Hash, RkyvArchive, RkyvSerialize, RkyvDeserialize)] - #[archive_attr(repr(C), derive(CheckBytes, Hash, Eq, PartialEq, PartialOrd, Ord))] + #[derive(Clone, Copy, Hash)] pub struct $name { pub bytes: [u8; $size], } diff --git a/veilid-core/src/crypto/types/crypto_typed.rs b/veilid-core/src/crypto/types/crypto_typed.rs index b0d3c61a..740f888c 100644 --- a/veilid-core/src/crypto/types/crypto_typed.rs +++ b/veilid-core/src/crypto/types/crypto_typed.rs @@ -1,7 +1,6 @@ use super::*; -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes, Hash, PartialEq, Eq))] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct CryptoTyped where K: Clone @@ -14,9 +13,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { pub kind: CryptoKind, pub value: K, @@ -34,9 +31,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { pub fn new(kind: CryptoKind, value: K) -> Self { Self { kind, value } @@ -54,9 +49,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) @@ -75,9 +68,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn cmp(&self, other: &Self) -> cmp::Ordering { let x = compare_crypto_kind(&self.kind, &other.kind); @@ -100,9 +91,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { write!(f, "{}:{}", self.kind, self.value) @@ -120,9 +109,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { type Err = VeilidAPIError; fn from_str(s: &str) -> Result { @@ -152,9 +139,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn deserialize(deserializer: D) -> Result where @@ -176,9 +161,7 @@ where + Ord + PartialOrd + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn serialize(&self, serializer: S) -> Result where diff --git a/veilid-core/src/crypto/types/crypto_typed_group.rs b/veilid-core/src/crypto/types/crypto_typed_group.rs index fd2efb33..80f717bc 100644 --- a/veilid-core/src/crypto/types/crypto_typed_group.rs +++ b/veilid-core/src/crypto/types/crypto_typed_group.rs @@ -1,21 +1,6 @@ use super::*; -#[derive( - Clone, - Debug, - Serialize, - Deserialize, - PartialOrd, - Ord, - PartialEq, - Eq, - Hash, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - Default, -)] -#[archive_attr(repr(C), derive(CheckBytes, Hash, PartialEq, Eq))] +#[derive(Clone, Debug, Serialize, Deserialize, PartialOrd, Ord, PartialEq, Eq, Hash, Default)] #[serde(from = "Vec>", into = "Vec>")] pub struct CryptoTypedGroup where @@ -29,10 +14,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, - > as RkyvArchive>::Archived: Hash + PartialEq + Eq, { items: Vec>, } @@ -49,9 +31,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { pub fn new() -> Self { Self { items: Vec::new() } @@ -163,9 +143,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { type Target = [CryptoTyped]; @@ -187,9 +165,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { write!(f, "[")?; @@ -217,9 +193,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { type Err = VeilidAPIError; fn from_str(s: &str) -> Result { @@ -250,9 +224,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn from(x: CryptoTyped) -> Self { let mut tks = CryptoTypedGroup::::with_capacity(1); @@ -272,9 +244,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn from(x: Vec>) -> Self { let mut tks = CryptoTypedGroup::::with_capacity(x.len()); @@ -294,9 +264,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn from(x: &[CryptoTyped]) -> Self { let mut tks = CryptoTypedGroup::::with_capacity(x.len()); @@ -316,9 +284,7 @@ where + PartialOrd + Ord + Hash - + RkyvArchive + Encodable, - ::Archived: Hash + PartialEq + Eq, { fn into(self) -> Vec> { self.items diff --git a/veilid-core/src/crypto/types/keypair.rs b/veilid-core/src/crypto/types/keypair.rs index d17a12a0..f8e6e6da 100644 --- a/veilid-core/src/crypto/types/keypair.rs +++ b/veilid-core/src/crypto/types/keypair.rs @@ -1,19 +1,6 @@ use super::*; -#[derive( - Clone, - Copy, - Default, - PartialOrd, - Ord, - PartialEq, - Eq, - Hash, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes, Hash, PartialEq, Eq))] +#[derive(Clone, Copy, Default, PartialOrd, Ord, PartialEq, Eq, Hash)] pub struct KeyPair { pub key: PublicKey, pub secret: SecretKey, diff --git a/veilid-core/src/intf/native/protected_store.rs b/veilid-core/src/intf/native/protected_store.rs index 380a0c34..7faa0f49 100644 --- a/veilid-core/src/intf/native/protected_store.rs +++ b/veilid-core/src/intf/native/protected_store.rs @@ -141,16 +141,6 @@ impl ProtectedStore { } } - #[instrument(level = "trace", skip(self, value))] - pub async fn save_user_secret_rkyv(&self, key: K, value: &T) -> EyreResult - where - K: AsRef + fmt::Debug, - T: RkyvSerialize, - { - let v = to_rkyv(value)?; - self.save_user_secret(key, &v).await - } - #[instrument(level = "trace", skip(self, value))] pub async fn save_user_secret_json(&self, key: K, value: &T) -> EyreResult where @@ -161,27 +151,6 @@ impl ProtectedStore { self.save_user_secret(&key, &v).await } - #[instrument(level = "trace", skip(self))] - pub async fn load_user_secret_rkyv(&self, key: K) -> EyreResult> - where - K: AsRef + fmt::Debug, - T: RkyvArchive, - ::Archived: - for<'t> CheckBytes>, - ::Archived: RkyvDeserialize, - { - let out = self.load_user_secret(key).await?; - let b = match out { - Some(v) => v, - None => { - return Ok(None); - } - }; - - let obj = from_rkyv(b)?; - Ok(Some(obj)) - } - #[instrument(level = "trace", skip(self))] pub async fn load_user_secret_json(&self, key: K) -> EyreResult> where diff --git a/veilid-core/src/intf/wasm/protected_store.rs b/veilid-core/src/intf/wasm/protected_store.rs index 39c9bacd..087596ef 100644 --- a/veilid-core/src/intf/wasm/protected_store.rs +++ b/veilid-core/src/intf/wasm/protected_store.rs @@ -1,9 +1,5 @@ use super::*; use data_encoding::BASE64URL_NOPAD; -use rkyv::{ - bytecheck::CheckBytes, Archive as RkyvArchive, Deserialize as RkyvDeserialize, - Serialize as RkyvSerialize, -}; use web_sys::*; @@ -126,16 +122,6 @@ impl ProtectedStore { } } - #[instrument(level = "trace", skip(self, value))] - pub async fn save_user_secret_rkyv(&self, key: K, value: &T) -> EyreResult - where - K: AsRef + fmt::Debug, - T: RkyvSerialize, - { - let v = to_rkyv(value)?; - self.save_user_secret(key, &v).await - } - #[instrument(level = "trace", skip(self, value))] pub async fn save_user_secret_json(&self, key: K, value: &T) -> EyreResult where @@ -146,27 +132,6 @@ impl ProtectedStore { self.save_user_secret(key, &v).await } - #[instrument(level = "trace", skip(self))] - pub async fn load_user_secret_rkyv(&self, key: K) -> EyreResult> - where - K: AsRef + fmt::Debug, - T: RkyvArchive, - ::Archived: - for<'t> CheckBytes>, - ::Archived: RkyvDeserialize, - { - let out = self.load_user_secret(key).await?; - let b = match out { - Some(v) => v, - None => { - return Ok(None); - } - }; - - let obj = from_rkyv(b)?; - Ok(Some(obj)) - } - #[instrument(level = "trace", skip(self))] pub async fn load_user_secret_json(&self, key: K) -> EyreResult> where diff --git a/veilid-core/src/lib.rs b/veilid-core/src/lib.rs index ef3bdeb9..2446cfe4 100644 --- a/veilid-core/src/lib.rs +++ b/veilid-core/src/lib.rs @@ -88,16 +88,11 @@ pub static DEFAULT_LOG_IGNORE_LIST: [&str; 21] = [ use cfg_if::*; use enumset::*; use eyre::{bail, eyre, Report as EyreReport, Result as EyreResult, WrapErr}; -use parking_lot::*; -use rkyv::{ - bytecheck, bytecheck::CheckBytes, de::deserializers::SharedDeserializeMap, with::Skip, - Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize, -}; -use tracing::*; -use veilid_tools::*; -type RkyvDefaultValidator<'t> = rkyv::validation::validators::DefaultValidator<'t>; use futures_util::stream::FuturesUnordered; +use parking_lot::*; use schemars::{schema_for, JsonSchema}; use serde::*; use stop_token::*; use thiserror::Error as ThisError; +use tracing::*; +use veilid_tools::*; diff --git a/veilid-core/src/network_manager/mod.rs b/veilid-core/src/network_manager/mod.rs index 02387a9e..c74bb4f5 100644 --- a/veilid-core/src/network_manager/mod.rs +++ b/veilid-core/src/network_manager/mod.rs @@ -36,12 +36,16 @@ use hashlink::LruCache; use intf::*; #[cfg(not(target_arch = "wasm32"))] use native::*; +#[cfg(not(target_arch = "wasm32"))] +pub use native::{LOCAL_NETWORK_CAPABILITIES, MAX_CAPABILITIES, PUBLIC_INTERNET_CAPABILITIES}; use receipt_manager::*; use routing_table::*; use rpc_processor::*; use storage_manager::*; #[cfg(target_arch = "wasm32")] use wasm::*; +#[cfg(target_arch = "wasm32")] +pub use wasm::{LOCAL_NETWORK_CAPABILITIES, MAX_CAPABILITIES, PUBLIC_INTERNET_CAPABILITIES}; //////////////////////////////////////////////////////////////////////////////////////// diff --git a/veilid-core/src/network_manager/native/mod.rs b/veilid-core/src/network_manager/native/mod.rs index cf04b50a..fe0408c2 100644 --- a/veilid-core/src/network_manager/native/mod.rs +++ b/veilid-core/src/network_manager/native/mod.rs @@ -30,6 +30,43 @@ use std::path::{Path, PathBuf}; pub const PEEK_DETECT_LEN: usize = 64; +cfg_if! { + if #[cfg(all(feature = "unstable-blockstore", feature="unstable-tunnels"))] { + const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 8; + } else if #[cfg(any(feature = "unstable-blockstore", feature="unstable-tunnels"))] { + const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 7; + } else { + const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 6; + } +} +pub const PUBLIC_INTERNET_CAPABILITIES: [Capability; PUBLIC_INTERNET_CAPABILITIES_LEN] = [ + CAP_ROUTE, + #[cfg(feature = "unstable-tunnels")] + CAP_TUNNEL, + CAP_SIGNAL, + CAP_RELAY, + CAP_VALIDATE_DIAL_INFO, + CAP_DHT, + CAP_APPMESSAGE, + #[cfg(feature = "unstable-blockstore")] + CAP_BLOCKSTORE, +]; + +#[cfg(feature = "unstable-blockstore")] +const LOCAL_NETWORK_CAPABILITIES_LEN: usize = 4; +#[cfg(not(feature = "unstable-blockstore"))] +const LOCAL_NETWORK_CAPABILITIES_LEN: usize = 3; + +pub const LOCAL_NETWORK_CAPABILITIES: [Capability; LOCAL_NETWORK_CAPABILITIES_LEN] = [ + CAP_RELAY, + CAP_DHT, + CAP_APPMESSAGE, + #[cfg(feature = "unstable-blockstore")] + CAP_BLOCKSTORE, +]; + +pub const MAX_CAPABILITIES: usize = 64; + ///////////////////////////////////////////////////////////////// struct NetworkInner { diff --git a/veilid-core/src/network_manager/types/address.rs b/veilid-core/src/network_manager/types/address.rs index 0dbb0e95..e89ed185 100644 --- a/veilid-core/src/network_manager/types/address.rs +++ b/veilid-core/src/network_manager/types/address.rs @@ -2,22 +2,7 @@ use super::*; // Ordering here matters, IPV6 is preferred to IPV4 in dial info sorts // See issue #236 for eventual resolution of this unfortunate implementation -#[derive( - Copy, - Clone, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] pub enum Address { IPV6(Ipv6Addr), IPV4(Ipv4Addr), diff --git a/veilid-core/src/network_manager/types/address_type.rs b/veilid-core/src/network_manager/types/address_type.rs index 5193654e..53ddcb4f 100644 --- a/veilid-core/src/network_manager/types/address_type.rs +++ b/veilid-core/src/network_manager/types/address_type.rs @@ -1,22 +1,11 @@ +#![allow(non_snake_case)] use super::*; #[allow(clippy::derive_hash_xor_eq)] -#[derive( - Debug, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - EnumSetType, -)] +#[derive(Debug, PartialOrd, Ord, Hash, Serialize, Deserialize, EnumSetType)] #[enumset(repr = "u8")] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum AddressType { - IPV4, - IPV6, + IPV6 = 0, + IPV4 = 1, } pub type AddressTypeSet = EnumSet; diff --git a/veilid-core/src/network_manager/types/connection_descriptor.rs b/veilid-core/src/network_manager/types/connection_descriptor.rs index 54481c39..b57fcc91 100644 --- a/veilid-core/src/network_manager/types/connection_descriptor.rs +++ b/veilid-core/src/network_manager/types/connection_descriptor.rs @@ -7,22 +7,7 @@ use super::*; /// If the medium does not allow local addresses, None should have been used or 'new_no_local' /// If we are specifying only a port, then the socket's 'local_address()' should have been used, since an /// established connection is always from a real address to another real address. -#[derive( - Copy, - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct ConnectionDescriptor { remote: PeerAddress, local: Option, diff --git a/veilid-core/src/network_manager/types/dial_info/mod.rs b/veilid-core/src/network_manager/types/dial_info/mod.rs index 5eec84f5..1450b3b3 100644 --- a/veilid-core/src/network_manager/types/dial_info/mod.rs +++ b/veilid-core/src/network_manager/types/dial_info/mod.rs @@ -12,21 +12,7 @@ pub use wss::*; // Keep member order appropriate for sorting < preference // Must match ProtocolType order -#[derive( - Clone, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] #[serde(tag = "kind")] pub enum DialInfo { UDP(DialInfoUDP), diff --git a/veilid-core/src/network_manager/types/dial_info/tcp.rs b/veilid-core/src/network_manager/types/dial_info/tcp.rs index ce7de8b4..062893a3 100644 --- a/veilid-core/src/network_manager/types/dial_info/tcp.rs +++ b/veilid-core/src/network_manager/types/dial_info/tcp.rs @@ -1,21 +1,6 @@ use super::*; -#[derive( - Clone, - Default, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] pub struct DialInfoTCP { pub socket_address: SocketAddress, } diff --git a/veilid-core/src/network_manager/types/dial_info/udp.rs b/veilid-core/src/network_manager/types/dial_info/udp.rs index d799e116..4f2f86fe 100644 --- a/veilid-core/src/network_manager/types/dial_info/udp.rs +++ b/veilid-core/src/network_manager/types/dial_info/udp.rs @@ -1,21 +1,6 @@ use super::*; -#[derive( - Clone, - Default, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] pub struct DialInfoUDP { pub socket_address: SocketAddress, } diff --git a/veilid-core/src/network_manager/types/dial_info/ws.rs b/veilid-core/src/network_manager/types/dial_info/ws.rs index 18e2a37c..a79c28f4 100644 --- a/veilid-core/src/network_manager/types/dial_info/ws.rs +++ b/veilid-core/src/network_manager/types/dial_info/ws.rs @@ -1,22 +1,7 @@ use super::*; -#[derive( - Clone, - Default, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] pub struct DialInfoWS { pub socket_address: SocketAddress, pub request: String, -} \ No newline at end of file +} diff --git a/veilid-core/src/network_manager/types/dial_info/wss.rs b/veilid-core/src/network_manager/types/dial_info/wss.rs index e999430d..b2adcf8c 100644 --- a/veilid-core/src/network_manager/types/dial_info/wss.rs +++ b/veilid-core/src/network_manager/types/dial_info/wss.rs @@ -1,21 +1,6 @@ use super::*; -#[derive( - Clone, - Default, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] pub struct DialInfoWSS { pub socket_address: SocketAddress, pub request: String, diff --git a/veilid-core/src/network_manager/types/dial_info_class.rs b/veilid-core/src/network_manager/types/dial_info_class.rs index f3f91376..3348fd1b 100644 --- a/veilid-core/src/network_manager/types/dial_info_class.rs +++ b/veilid-core/src/network_manager/types/dial_info_class.rs @@ -1,22 +1,7 @@ use super::*; // Keep member order appropriate for sorting < preference -#[derive( - Copy, - Clone, - Debug, - Eq, - PartialEq, - Ord, - PartialOrd, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum DialInfoClass { Direct = 0, // D = Directly reachable with public IP and no firewall, with statically configured port Mapped = 1, // M = Directly reachable with via portmap behind any NAT or firewalled with dynamically negotiated port diff --git a/veilid-core/src/network_manager/types/dial_info_filter.rs b/veilid-core/src/network_manager/types/dial_info_filter.rs index c51a5acb..4f7fce87 100644 --- a/veilid-core/src/network_manager/types/dial_info_filter.rs +++ b/veilid-core/src/network_manager/types/dial_info_filter.rs @@ -1,24 +1,8 @@ use super::*; -#[derive( - Copy, - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct DialInfoFilter { - #[with(RkyvEnumSet)] pub protocol_type_set: ProtocolTypeSet, - #[with(RkyvEnumSet)] pub address_type_set: AddressTypeSet, } diff --git a/veilid-core/src/network_manager/types/low_level_protocol_type.rs b/veilid-core/src/network_manager/types/low_level_protocol_type.rs index 69dfeae7..be552282 100644 --- a/veilid-core/src/network_manager/types/low_level_protocol_type.rs +++ b/veilid-core/src/network_manager/types/low_level_protocol_type.rs @@ -1,25 +1,15 @@ +#![allow(non_snake_case)] + use super::*; // Keep member order appropriate for sorting < preference // Must match DialInfo order #[allow(clippy::derive_hash_xor_eq)] -#[derive( - Debug, - PartialOrd, - Ord, - Hash, - EnumSetType, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] +#[derive(Debug, PartialOrd, Ord, Hash, EnumSetType, Serialize, Deserialize)] #[enumset(repr = "u8")] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum LowLevelProtocolType { - UDP, - TCP, + UDP = 0, + TCP = 1, } impl LowLevelProtocolType { diff --git a/veilid-core/src/network_manager/types/network_class.rs b/veilid-core/src/network_manager/types/network_class.rs index 828edac7..0570b9d2 100644 --- a/veilid-core/src/network_manager/types/network_class.rs +++ b/veilid-core/src/network_manager/types/network_class.rs @@ -1,21 +1,6 @@ use super::*; -#[derive( - Copy, - Clone, - Debug, - Eq, - PartialEq, - Ord, - PartialOrd, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum NetworkClass { InboundCapable = 0, // I = Inbound capable without relay, may require signal OutboundOnly = 1, // O = Outbound only, inbound relay required except with reverse connect signal diff --git a/veilid-core/src/network_manager/types/peer_address.rs b/veilid-core/src/network_manager/types/peer_address.rs index 83df0bea..e505aa1c 100644 --- a/veilid-core/src/network_manager/types/peer_address.rs +++ b/veilid-core/src/network_manager/types/peer_address.rs @@ -1,24 +1,9 @@ use super::*; -#[derive( - Copy, - Clone, - Debug, - PartialEq, - PartialOrd, - Eq, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)] pub struct PeerAddress { protocol_type: ProtocolType, - #[serde(with = "json_as_string")] + #[serde(with = "as_human_string")] socket_address: SocketAddress, } diff --git a/veilid-core/src/network_manager/types/protocol_type.rs b/veilid-core/src/network_manager/types/protocol_type.rs index 41167580..54319322 100644 --- a/veilid-core/src/network_manager/types/protocol_type.rs +++ b/veilid-core/src/network_manager/types/protocol_type.rs @@ -1,27 +1,16 @@ +#![allow(non_snake_case)] use super::*; // Keep member order appropriate for sorting < preference // Must match DialInfo order #[allow(clippy::derive_hash_xor_eq)] -#[derive( - Debug, - PartialOrd, - Ord, - Hash, - EnumSetType, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] +#[derive(Debug, PartialOrd, Ord, Hash, EnumSetType, Serialize, Deserialize)] #[enumset(repr = "u8")] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum ProtocolType { - UDP, - TCP, - WS, - WSS, + UDP = 0, + TCP = 1, + WS = 2, + WSS = 3, } impl ProtocolType { diff --git a/veilid-core/src/network_manager/types/signal_info.rs b/veilid-core/src/network_manager/types/signal_info.rs index bf2aa861..0fb49746 100644 --- a/veilid-core/src/network_manager/types/signal_info.rs +++ b/veilid-core/src/network_manager/types/signal_info.rs @@ -1,8 +1,7 @@ use super::*; /// Parameter for Signal operation -#[derive(Clone, Debug, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Clone, Debug, Serialize, Deserialize)] pub enum SignalInfo { /// UDP Hole Punch Request HolePunch { diff --git a/veilid-core/src/network_manager/types/socket_address.rs b/veilid-core/src/network_manager/types/socket_address.rs index 35515b90..c68cd805 100644 --- a/veilid-core/src/network_manager/types/socket_address.rs +++ b/veilid-core/src/network_manager/types/socket_address.rs @@ -1,22 +1,8 @@ use super::*; #[derive( - Copy, - Default, - Clone, - Debug, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, + Copy, Default, Clone, Debug, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize, )] -#[archive_attr(repr(C), derive(CheckBytes))] pub struct SocketAddress { address: Address, port: u16, diff --git a/veilid-core/src/network_manager/wasm/mod.rs b/veilid-core/src/network_manager/wasm/mod.rs index dcdd0f85..86d56584 100644 --- a/veilid-core/src/network_manager/wasm/mod.rs +++ b/veilid-core/src/network_manager/wasm/mod.rs @@ -10,6 +10,45 @@ use std::io; ///////////////////////////////////////////////////////////////// +cfg_if! { + if #[cfg(all(feature = "unstable-blockstore", feature="unstable-tunnels"))] { + const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 6; + } else if #[cfg(any(feature = "unstable-blockstore", feature="unstable-tunnels"))] { + const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 5; + } else { + const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 4; + } +} +pub const PUBLIC_INTERNET_CAPABILITIES: [Capability; PUBLIC_INTERNET_CAPABILITIES_LEN] = [ + CAP_ROUTE, + #[cfg(feature = "unstable-tunnels")] + CAP_TUNNEL, + CAP_SIGNAL, + //CAP_RELAY, + //CAP_VALIDATE_DIAL_INFO, + CAP_DHT, + CAP_APPMESSAGE, + #[cfg(feature = "unstable-blockstore")] + CAP_BLOCKSTORE, +]; + +#[cfg(feature = "unstable-blockstore")] +const LOCAL_NETWORK_CAPABILITIES_LEN: usize = 3; +#[cfg(not(feature = "unstable-blockstore"))] +const LOCAL_NETWORK_CAPABILITIES_LEN: usize = 2; + +pub const LOCAL_NETWORK_CAPABILITIES: [Capability; LOCAL_NETWORK_CAPABILITIES_LEN] = [ + //CAP_RELAY, + CAP_DHT, + CAP_APPMESSAGE, + #[cfg(feature = "unstable-blockstore")] + CAP_BLOCKSTORE, +]; + +pub const MAX_CAPABILITIES: usize = 64; + +///////////////////////////////////////////////////////////////// + struct NetworkInner { network_started: bool, network_needs_restart: bool, @@ -273,10 +312,10 @@ impl Network { let inbound = ProtocolTypeSet::new(); let mut outbound = ProtocolTypeSet::new(); - if c.network.protocol.ws.connect && c.capabilities.protocol_connect_ws { + if c.network.protocol.ws.connect { outbound.insert(ProtocolType::WS); } - if c.network.protocol.wss.connect && c.capabilities.protocol_connect_wss { + if c.network.protocol.wss.connect { outbound.insert(ProtocolType::WSS); } @@ -301,15 +340,26 @@ impl Network { // set up the routing table's network config // if we have static public dialinfo, upgrade our network class + + let public_internet_capabilities = { + let c = self.config.get(); + PUBLIC_INTERNET_CAPABILITIES + .iter() + .copied() + .filter(|cap| !c.capabilities.disable.contains(cap)) + .collect::>() + }; + editor_public_internet.setup_network( protocol_config.outbound, protocol_config.inbound, protocol_config.family_global, + public_internet_capabilities, ); editor_public_internet.set_network_class(Some(NetworkClass::WebApp)); // commit routing table edits - editor_public_internet.commit().await; + editor_public_internet.commit(); self.inner.lock().network_started = true; Ok(()) @@ -339,8 +389,7 @@ impl Network { .clear_dial_info_details() .set_network_class(None) .clear_relay_node() - .commit() - .await; + .commit(); // Cancels all async background tasks by dropping join handles *self.inner.lock() = Self::new_inner(); diff --git a/veilid-core/src/routing_table/bucket.rs b/veilid-core/src/routing_table/bucket.rs index 93c1a65d..f34405f6 100644 --- a/veilid-core/src/routing_table/bucket.rs +++ b/veilid-core/src/routing_table/bucket.rs @@ -1,6 +1,5 @@ use super::*; use core::sync::atomic::Ordering; -use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; /// Routing Table Bucket /// Stores map of public keys to entries, which may be in multiple routing tables per crypto kind @@ -16,15 +15,13 @@ pub struct Bucket { pub(super) type EntriesIter<'a> = alloc::collections::btree_map::Iter<'a, PublicKey, Arc>; -#[derive(Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Serialize, Deserialize)] struct SerializedBucketEntryData { key: PublicKey, value: u32, // index into serialized entries list } -#[derive(Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Serialize, Deserialize)] struct SerializedBucketData { entries: Vec, } @@ -50,7 +47,7 @@ impl Bucket { data: Vec, all_entries: &[Arc], ) -> EyreResult<()> { - let bucket_data: SerializedBucketData = from_rkyv(data)?; + let bucket_data: SerializedBucketData = deserialize_json_bytes(&data)?; for e in bucket_data.entries { self.entries @@ -64,7 +61,7 @@ impl Bucket { &self, all_entries: &mut Vec>, entry_map: &mut HashMap<*const BucketEntry, u32>, - ) -> EyreResult> { + ) -> Vec { let mut entries = Vec::new(); for (k, v) in &self.entries { let entry_index = entry_map.entry(Arc::as_ptr(v)).or_insert_with(|| { @@ -78,8 +75,8 @@ impl Bucket { }); } let bucket_data = SerializedBucketData { entries }; - let out = to_rkyv(&bucket_data)?; - Ok(out) + let out = serialize_json_bytes(&bucket_data); + out } /// Create a new entry with a node_id of this crypto kind and return it diff --git a/veilid-core/src/routing_table/bucket_entry.rs b/veilid-core/src/routing_table/bucket_entry.rs index e400875d..b2acbf4e 100644 --- a/veilid-core/src/routing_table/bucket_entry.rs +++ b/veilid-core/src/routing_table/bucket_entry.rs @@ -39,8 +39,7 @@ pub enum BucketEntryState { pub struct LastConnectionKey(ProtocolType, AddressType); /// Bucket entry information specific to the LocalNetwork RoutingDomain -#[derive(Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Serialize, Deserialize)] pub struct BucketEntryPublicInternet { /// The PublicInternet node info signed_node_info: Option>, @@ -51,8 +50,7 @@ pub struct BucketEntryPublicInternet { } /// Bucket entry information specific to the LocalNetwork RoutingDomain -#[derive(Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Serialize, Deserialize)] pub struct BucketEntryLocalNetwork { /// The LocalNetwork node info signed_node_info: Option>, @@ -63,8 +61,7 @@ pub struct BucketEntryLocalNetwork { } /// The data associated with each bucket entry -#[derive(Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Serialize, Deserialize)] pub struct BucketEntryInner { /// The node ids matching this bucket entry, with the cryptography versions supported by this node as the 'kind' field validated_node_ids: TypedKeyGroup, @@ -79,7 +76,7 @@ pub struct BucketEntryInner { /// unreachable may now be reachable with the same SignedNodeInfo/DialInfo updated_since_last_network_change: bool, /// The last connection descriptors used to contact this node, per protocol type - #[with(Skip)] + #[serde(skip)] last_connections: BTreeMap, /// The node info for this entry on the publicinternet routing domain public_internet: BucketEntryPublicInternet, @@ -88,18 +85,18 @@ pub struct BucketEntryInner { /// Statistics gathered for the peer peer_stats: PeerStats, /// The accounting for the latency statistics - #[with(Skip)] + #[serde(skip)] latency_stats_accounting: LatencyStatsAccounting, /// The accounting for the transfer statistics - #[with(Skip)] + #[serde(skip)] transfer_stats_accounting: TransferStatsAccounting, /// Tracking identifier for NodeRef debugging #[cfg(feature = "tracking")] - #[with(Skip)] + #[serde(skip)] next_track_id: usize, /// Backtraces for NodeRef debugging #[cfg(feature = "tracking")] - #[with(Skip)] + #[serde(skip)] node_ref_tracks: HashMap, } diff --git a/veilid-core/src/routing_table/mod.rs b/veilid-core/src/routing_table/mod.rs index 4981aa60..a44223bb 100644 --- a/veilid-core/src/routing_table/mod.rs +++ b/veilid-core/src/routing_table/mod.rs @@ -48,6 +48,12 @@ pub const PRIVATE_ROUTE_MANAGEMENT_INTERVAL_SECS: u32 = 1; // We should ping them with some frequency and 30 seconds is typical timeout pub const CONNECTIONLESS_TIMEOUT_SECS: u32 = 29; +// Table store keys +const ALL_ENTRY_BYTES: &[u8] = b"all_entry_bytes"; +const ROUTING_TABLE: &str = "routing_table"; +const SERIALIZED_BUCKET_MAP: &[u8] = b"serialized_bucket_map"; +const CACHE_VALIDITY_KEY: &[u8] = b"cache_validity_key"; + pub type LowLevelProtocolPorts = BTreeSet<(LowLevelProtocolType, AddressType, u16)>; pub type ProtocolToPortMapping = BTreeMap<(ProtocolType, AddressType), (LowLevelProtocolType, u16)>; #[derive(Clone, Debug)] @@ -295,7 +301,7 @@ impl RoutingTable { } /// Serialize the routing table. - fn serialized_buckets(&self) -> EyreResult<(SerializedBucketMap, SerializedBuckets)> { + fn serialized_buckets(&self) -> (SerializedBucketMap, SerializedBuckets) { // Since entries are shared by multiple buckets per cryptokind // we need to get the list of all unique entries when serializing let mut all_entries: Vec> = Vec::new(); @@ -309,7 +315,7 @@ impl RoutingTable { let buckets = inner.buckets.get(&ck).unwrap(); let mut serialized_buckets = Vec::new(); for bucket in buckets.iter() { - serialized_buckets.push(bucket.save_bucket(&mut all_entries, &mut entry_map)?) + serialized_buckets.push(bucket.save_bucket(&mut all_entries, &mut entry_map)) } serialized_bucket_map.insert(ck, serialized_buckets); } @@ -319,25 +325,25 @@ impl RoutingTable { let mut all_entry_bytes = Vec::with_capacity(all_entries.len()); for entry in all_entries { // Serialize entry - let entry_bytes = entry.with_inner(|e| to_rkyv(e))?; + let entry_bytes = entry.with_inner(|e| serialize_json_bytes(e)); all_entry_bytes.push(entry_bytes); } - Ok((serialized_bucket_map, all_entry_bytes)) + (serialized_bucket_map, all_entry_bytes) } /// Write the serialized routing table to the table store. async fn save_buckets(&self) -> EyreResult<()> { - let (serialized_bucket_map, all_entry_bytes) = self.serialized_buckets()?; + let (serialized_bucket_map, all_entry_bytes) = self.serialized_buckets(); let table_store = self.unlocked_inner.network_manager().table_store(); - let tdb = table_store.open("routing_table", 1).await?; + let tdb = table_store.open(ROUTING_TABLE, 1).await?; let dbx = tdb.transact(); - if let Err(e) = dbx.store_rkyv(0, b"serialized_bucket_map", &serialized_bucket_map) { + if let Err(e) = dbx.store_json(0, SERIALIZED_BUCKET_MAP, &serialized_bucket_map) { dbx.rollback(); return Err(e.into()); } - if let Err(e) = dbx.store_rkyv(0, b"all_entry_bytes", &all_entry_bytes) { + if let Err(e) = dbx.store_json(0, ALL_ENTRY_BYTES, &all_entry_bytes) { dbx.rollback(); return Err(e.into()); } @@ -362,9 +368,9 @@ impl RoutingTable { // Deserialize bucket map and all entries from the table store let table_store = self.unlocked_inner.network_manager().table_store(); - let db = table_store.open("routing_table", 1).await?; + let db = table_store.open(ROUTING_TABLE, 1).await?; - let caches_valid = match db.load(0, b"cache_validity_key").await? { + let caches_valid = match db.load(0, CACHE_VALIDITY_KEY).await? { Some(v) => v == cache_validity_key, None => false, }; @@ -372,19 +378,18 @@ impl RoutingTable { // Caches not valid, start over log_rtab!(debug "cache validity key changed, emptying routing table"); drop(db); - table_store.delete("routing_table").await?; - let db = table_store.open("routing_table", 1).await?; - db.store(0, b"cache_validity_key", &cache_validity_key) - .await?; + table_store.delete(ROUTING_TABLE).await?; + let db = table_store.open(ROUTING_TABLE, 1).await?; + db.store(0, CACHE_VALIDITY_KEY, &cache_validity_key).await?; return Ok(()); } // Caches valid, load saved routing table - let Some(serialized_bucket_map): Option = db.load_rkyv(0, b"serialized_bucket_map").await? else { + let Some(serialized_bucket_map): Option = db.load_json(0, SERIALIZED_BUCKET_MAP).await? else { log_rtab!(debug "no bucket map in saved routing table"); return Ok(()); }; - let Some(all_entry_bytes): Option = db.load_rkyv(0, b"all_entry_bytes").await? else { + let Some(all_entry_bytes): Option = db.load_json(0, ALL_ENTRY_BYTES).await? else { log_rtab!(debug "no all_entry_bytes in saved routing table"); return Ok(()); }; @@ -405,8 +410,8 @@ impl RoutingTable { ) -> EyreResult<()> { let mut all_entries: Vec> = Vec::with_capacity(all_entry_bytes.len()); for entry_bytes in all_entry_bytes { - let entryinner = - from_rkyv(entry_bytes).wrap_err("failed to deserialize bucket entry")?; + let entryinner = deserialize_json_bytes(&entry_bytes) + .wrap_err("failed to deserialize bucket entry")?; let entry = Arc::new(BucketEntry::new_with_inner(entryinner)); // Keep strong reference in table diff --git a/veilid-core/src/routing_table/route_spec_store/route_set_spec_detail.rs b/veilid-core/src/routing_table/route_spec_store/route_set_spec_detail.rs index a61473a8..e4f58462 100644 --- a/veilid-core/src/routing_table/route_spec_store/route_set_spec_detail.rs +++ b/veilid-core/src/routing_table/route_spec_store/route_set_spec_detail.rs @@ -1,7 +1,6 @@ use super::*; -#[derive(Clone, Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C, align(8)), derive(CheckBytes))] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct RouteSpecDetail { /// Crypto kind pub crypto_kind: CryptoKind, @@ -11,20 +10,18 @@ pub struct RouteSpecDetail { pub hops: Vec, } -#[derive(Clone, Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C, align(8)), derive(CheckBytes))] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct RouteSetSpecDetail { /// Route set per crypto kind route_set: BTreeMap, /// Route noderefs - #[with(Skip)] + #[serde(skip)] hop_node_refs: Vec, /// Published private route, do not reuse for ephemeral routes /// Not serialized because all routes should be re-published when restarting - #[with(Skip)] + #[serde(skip)] published: bool, /// Directions this route is guaranteed to work in - #[with(RkyvEnumSet)] directions: DirectionSet, /// Stability preference (prefer reliable nodes over faster) stability: Stability, diff --git a/veilid-core/src/routing_table/route_spec_store/route_spec_store_content.rs b/veilid-core/src/routing_table/route_spec_store/route_spec_store_content.rs index 9c5fbafe..e1d003e3 100644 --- a/veilid-core/src/routing_table/route_spec_store/route_spec_store_content.rs +++ b/veilid-core/src/routing_table/route_spec_store/route_spec_store_content.rs @@ -1,8 +1,7 @@ use super::*; /// The core representation of the RouteSpecStore that can be serialized -#[derive(Debug, Clone, Default, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C, align(8)), derive(CheckBytes))] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct RouteSpecStoreContent { /// All of the route sets we have allocated so far indexed by key id_by_key: HashMap, @@ -23,7 +22,7 @@ impl RouteSpecStoreContent { let table_store = routing_table.network_manager().table_store(); let rsstdb = table_store.open("RouteSpecStore", 1).await?; let mut content: RouteSpecStoreContent = - rsstdb.load_rkyv(0, b"content").await?.unwrap_or_default(); + rsstdb.load_json(0, b"content").await?.unwrap_or_default(); // Look up all route hop noderefs since we can't serialize those let mut dead_ids = Vec::new(); @@ -63,7 +62,7 @@ impl RouteSpecStoreContent { // This skips #[with(Skip)] saving the secret keys, we save them in the protected store instead let table_store = routing_table.network_manager().table_store(); let rsstdb = table_store.open("RouteSpecStore", 1).await?; - rsstdb.store_rkyv(0, b"content", self).await?; + rsstdb.store_json(0, b"content", self).await?; Ok(()) } @@ -96,9 +95,9 @@ impl RouteSpecStoreContent { pub fn get_id_by_key(&self, key: &PublicKey) -> Option { self.id_by_key.get(key).cloned() } - pub fn iter_ids(&self) -> std::collections::hash_map::Keys { - self.details.keys() - } + // pub fn iter_ids(&self) -> std::collections::hash_map::Keys { + // self.details.keys() + // } pub fn iter_details(&self) -> std::collections::hash_map::Iter { self.details.iter() } diff --git a/veilid-core/src/routing_table/route_spec_store/route_stats.rs b/veilid-core/src/routing_table/route_spec_store/route_stats.rs index 1327e87f..ad7bdf70 100644 --- a/veilid-core/src/routing_table/route_spec_store/route_stats.rs +++ b/veilid-core/src/routing_table/route_spec_store/route_stats.rs @@ -1,34 +1,33 @@ use super::*; -#[derive(Clone, Debug, Default, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct RouteStats { /// Consecutive failed to send count - #[with(Skip)] + #[serde(skip)] pub failed_to_send: u32, /// Questions lost - #[with(Skip)] + #[serde(skip)] pub questions_lost: u32, /// Timestamp of when the route was created pub created_ts: Timestamp, /// Timestamp of when the route was last checked for validity - #[with(Skip)] + #[serde(skip)] pub last_tested_ts: Option, /// Timestamp of when the route was last sent to - #[with(Skip)] + #[serde(skip)] pub last_sent_ts: Option, /// Timestamp of when the route was last received over - #[with(Skip)] + #[serde(skip)] pub last_received_ts: Option, /// Transfers up and down pub transfer_stats_down_up: TransferStatsDownUp, /// Latency stats pub latency_stats: LatencyStats, /// Accounting mechanism for this route's RPC latency - #[with(Skip)] + #[serde(skip)] latency_stats_accounting: LatencyStatsAccounting, /// Accounting mechanism for the bandwidth across this route - #[with(Skip)] + #[serde(skip)] transfer_stats_accounting: TransferStatsAccounting, } diff --git a/veilid-core/src/routing_table/tests/test_serialize_routing_table.rs b/veilid-core/src/routing_table/tests/test_serialize_routing_table.rs index 89811612..265b99aa 100644 --- a/veilid-core/src/routing_table/tests/test_serialize_routing_table.rs +++ b/veilid-core/src/routing_table/tests/test_serialize_routing_table.rs @@ -35,7 +35,7 @@ pub async fn test_routingtable_buckets_round_trip() { // Add lots of routes to `original` here to exercise all various types. - let (serialized_bucket_map, all_entry_bytes) = original.serialized_buckets().unwrap(); + let (serialized_bucket_map, all_entry_bytes) = original.serialized_buckets(); copy.populate_routing_table( &mut copy.inner.write(), diff --git a/veilid-core/src/routing_table/types/dial_info_detail.rs b/veilid-core/src/routing_table/types/dial_info_detail.rs index 52e51492..4e59b1af 100644 --- a/veilid-core/src/routing_table/types/dial_info_detail.rs +++ b/veilid-core/src/routing_table/types/dial_info_detail.rs @@ -1,21 +1,7 @@ use super::*; // Keep member order appropriate for sorting < preference -#[derive( - Debug, - Clone, - PartialEq, - PartialOrd, - Ord, - Eq, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)] pub struct DialInfoDetail { pub class: DialInfoClass, pub dial_info: DialInfo, diff --git a/veilid-core/src/routing_table/types/direction.rs b/veilid-core/src/routing_table/types/direction.rs index 98f50182..76187032 100644 --- a/veilid-core/src/routing_table/types/direction.rs +++ b/veilid-core/src/routing_table/types/direction.rs @@ -1,22 +1,12 @@ +#![allow(non_snake_case)] + use super::*; #[allow(clippy::derive_hash_xor_eq)] -#[derive( - Debug, - PartialOrd, - Ord, - Hash, - EnumSetType, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] +#[derive(Debug, PartialOrd, Ord, Hash, EnumSetType, Serialize, Deserialize)] #[enumset(repr = "u8")] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum Direction { - Inbound, - Outbound, + Inbound = 0, + Outbound = 1, } pub type DirectionSet = EnumSet; diff --git a/veilid-core/src/routing_table/types/node_info.rs b/veilid-core/src/routing_table/types/node_info.rs index 4bbf31da..838022e3 100644 --- a/veilid-core/src/routing_table/types/node_info.rs +++ b/veilid-core/src/routing_table/types/node_info.rs @@ -12,61 +12,10 @@ pub const CAP_APPMESSAGE: Capability = FourCC(*b"APPM"); #[cfg(feature = "unstable-blockstore")] pub const CAP_BLOCKSTORE: Capability = FourCC(*b"BLOC"); -cfg_if! { - if #[cfg(all(feature = "unstable-blockstore", feature="unstable-tunnels"))] { - const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 8; - } else if #[cfg(any(feature = "unstable-blockstore", feature="unstable-tunnels"))] { - const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 7; - } else { - const PUBLIC_INTERNET_CAPABILITIES_LEN: usize = 6; - } -} -pub const PUBLIC_INTERNET_CAPABILITIES: [Capability; PUBLIC_INTERNET_CAPABILITIES_LEN] = [ - CAP_ROUTE, - #[cfg(feature = "unstable-tunnels")] - CAP_TUNNEL, - CAP_SIGNAL, - CAP_RELAY, - CAP_VALIDATE_DIAL_INFO, - CAP_DHT, - CAP_APPMESSAGE, - #[cfg(feature = "unstable-blockstore")] - CAP_BLOCKSTORE, -]; - -#[cfg(feature = "unstable-blockstore")] -const LOCAL_NETWORK_CAPABILITIES_LEN: usize = 4; -#[cfg(not(feature = "unstable-blockstore"))] -const LOCAL_NETWORK_CAPABILITIES_LEN: usize = 3; - -pub const LOCAL_NETWORK_CAPABILITIES: [Capability; LOCAL_NETWORK_CAPABILITIES_LEN] = [ - CAP_RELAY, - CAP_DHT, - CAP_APPMESSAGE, - #[cfg(feature = "unstable-blockstore")] - CAP_BLOCKSTORE, -]; - -pub const MAX_CAPABILITIES: usize = 64; - -#[derive( - Clone, - Default, - PartialEq, - Eq, - Debug, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct NodeInfo { network_class: NetworkClass, - #[with(RkyvEnumSet)] outbound_protocols: ProtocolTypeSet, - #[with(RkyvEnumSet)] address_types: AddressTypeSet, envelope_support: Vec, crypto_support: Vec, diff --git a/veilid-core/src/routing_table/types/node_status.rs b/veilid-core/src/routing_table/types/node_status.rs index 2ecb1460..8d937860 100644 --- a/veilid-core/src/routing_table/types/node_status.rs +++ b/veilid-core/src/routing_table/types/node_status.rs @@ -2,8 +2,7 @@ use super::*; /// Non-nodeinfo status for each node is returned by the StatusA call -#[derive(Clone, Debug, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct NodeStatus { // Reserved for expansion } diff --git a/veilid-core/src/routing_table/types/peer_info.rs b/veilid-core/src/routing_table/types/peer_info.rs index 0f0e453d..60e83430 100644 --- a/veilid-core/src/routing_table/types/peer_info.rs +++ b/veilid-core/src/routing_table/types/peer_info.rs @@ -1,9 +1,6 @@ use super::*; -#[derive( - Clone, Debug, Serialize, Deserialize, PartialEq, Eq, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct PeerInfo { node_ids: TypedKeyGroup, signed_node_info: SignedNodeInfo, diff --git a/veilid-core/src/routing_table/types/routing_domain.rs b/veilid-core/src/routing_table/types/routing_domain.rs index dcd143a9..8947fd82 100644 --- a/veilid-core/src/routing_table/types/routing_domain.rs +++ b/veilid-core/src/routing_table/types/routing_domain.rs @@ -4,20 +4,8 @@ use super::*; // Routing domain here is listed in order of preference, keep in order #[allow(clippy::derive_hash_xor_eq)] -#[derive( - Debug, - Ord, - PartialOrd, - Hash, - EnumSetType, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] +#[derive(Debug, Ord, PartialOrd, Hash, EnumSetType, Serialize, Deserialize)] #[enumset(repr = "u8")] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum RoutingDomain { LocalNetwork = 0, PublicInternet = 1, diff --git a/veilid-core/src/routing_table/types/signed_direct_node_info.rs b/veilid-core/src/routing_table/types/signed_direct_node_info.rs index 4ebb2717..521b1bbe 100644 --- a/veilid-core/src/routing_table/types/signed_direct_node_info.rs +++ b/veilid-core/src/routing_table/types/signed_direct_node_info.rs @@ -1,10 +1,7 @@ use super::*; /// Signed NodeInfo that can be passed around amongst peers and verifiable -#[derive( - Clone, Debug, PartialEq, Eq, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SignedDirectNodeInfo { node_info: NodeInfo, timestamp: Timestamp, diff --git a/veilid-core/src/routing_table/types/signed_node_info.rs b/veilid-core/src/routing_table/types/signed_node_info.rs index 3246ef73..801de847 100644 --- a/veilid-core/src/routing_table/types/signed_node_info.rs +++ b/veilid-core/src/routing_table/types/signed_node_info.rs @@ -1,9 +1,6 @@ use super::*; -#[derive( - Clone, Debug, PartialEq, Eq, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum SignedNodeInfo { Direct(SignedDirectNodeInfo), Relayed(SignedRelayedNodeInfo), diff --git a/veilid-core/src/routing_table/types/signed_relayed_node_info.rs b/veilid-core/src/routing_table/types/signed_relayed_node_info.rs index 68f62bdc..462ebb31 100644 --- a/veilid-core/src/routing_table/types/signed_relayed_node_info.rs +++ b/veilid-core/src/routing_table/types/signed_relayed_node_info.rs @@ -1,10 +1,7 @@ use super::*; /// Signed NodeInfo with a relay that can be passed around amongst peers and verifiable -#[derive( - Clone, Debug, PartialEq, Eq, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SignedRelayedNodeInfo { node_info: NodeInfo, relay_ids: TypedKeyGroup, diff --git a/veilid-core/src/storage_manager/record_store.rs b/veilid-core/src/storage_manager/record_store.rs index b9208635..70bbf694 100644 --- a/veilid-core/src/storage_manager/record_store.rs +++ b/veilid-core/src/storage_manager/record_store.rs @@ -9,9 +9,7 @@ use hashlink::LruCache; pub struct RecordStore where - D: fmt::Debug + Clone + RkyvArchive + RkyvSerialize, - for<'t> ::Archived: CheckBytes>, - ::Archived: RkyvDeserialize, + D: fmt::Debug + Clone + Serialize + for<'d> Deserialize<'d>, { table_store: TableStore, name: String, @@ -41,9 +39,7 @@ pub struct SubkeyResult { impl RecordStore where - D: fmt::Debug + Clone + RkyvArchive + RkyvSerialize, - for<'t> ::Archived: CheckBytes>, - ::Archived: RkyvDeserialize, + D: fmt::Debug + Clone + Serialize + for<'d> Deserialize<'d>, { pub fn new(table_store: TableStore, name: &str, limits: RecordStoreLimits) -> Self { let subkey_cache_size = limits.subkey_cache_size as usize; @@ -93,7 +89,7 @@ where let mut record_index_saved: Vec<(RecordTableKey, Record)> = Vec::with_capacity(record_table_keys.len()); for rtk in record_table_keys { - if let Some(vr) = record_table.load_rkyv::>(0, &rtk).await? { + if let Some(vr) = record_table.load_json::>(0, &rtk).await? { let rik = RecordTableKey::try_from(rtk.as_ref())?; record_index_saved.push((rik, vr)); } @@ -265,7 +261,7 @@ where for rtk in changed_records { // Get the changed record and save it to the table if let Some(r) = self.record_index.peek(&rtk) { - if let Err(e) = rt_xact.store_rkyv(0, &rtk.bytes(), r) { + if let Err(e) = rt_xact.store_json(0, &rtk.bytes(), r) { log_stor!(error "failed to save record: {}", e); } } @@ -303,7 +299,7 @@ where // Save to record table record_table - .store_rkyv(0, &rtk.bytes(), &record) + .store_json(0, &rtk.bytes(), &record) .await .map_err(VeilidAPIError::internal)?; @@ -451,7 +447,7 @@ where } // If not in cache, try to pull from table store if it is in our stored subkey set let Some(record_data) = subkey_table - .load_rkyv::(0, &stk.bytes()) + .load_json::(0, &stk.bytes()) .await .map_err(VeilidAPIError::internal)? else { apibail_internal!("failed to get subkey that was stored"); @@ -517,7 +513,7 @@ where } // If not in cache, try to pull from table store if it is in our stored subkey set let Some(record_data) = subkey_table - .load_rkyv::(0, &stk.bytes()) + .load_json::(0, &stk.bytes()) .await .map_err(VeilidAPIError::internal)? else { apibail_internal!("failed to peek subkey that was stored"); @@ -575,7 +571,7 @@ where } else { // If not in cache, try to pull from table store if let Some(record_data) = subkey_table - .load_rkyv::(0, &stk_bytes) + .load_json::(0, &stk_bytes) .await .map_err(VeilidAPIError::internal)? { @@ -606,7 +602,7 @@ where // Write subkey subkey_table - .store_rkyv(0, &stk_bytes, &record_data) + .store_json(0, &stk_bytes, &record_data) .await .map_err(VeilidAPIError::internal)?; diff --git a/veilid-core/src/storage_manager/storage_manager_inner.rs b/veilid-core/src/storage_manager/storage_manager_inner.rs index bf06161e..2d74c2b5 100644 --- a/veilid-core/src/storage_manager/storage_manager_inner.rs +++ b/veilid-core/src/storage_manager/storage_manager_inner.rs @@ -1,5 +1,8 @@ use super::*; +const STORAGE_MANAGER_METADATA: &str = "storage_manager_metadata"; +const OFFLINE_SUBKEY_WRITES: &[u8] = b"offline_subkey_writes"; + /// Locked structure for storage manager pub(super) struct StorageManagerInner { unlocked_inner: Arc, @@ -68,7 +71,7 @@ impl StorageManagerInner { let metadata_db = self.unlocked_inner .table_store - .open(&format!("storage_manager_metadata"), 1) + .open(STORAGE_MANAGER_METADATA, 1) .await?; let local_limits = local_limits_from_config(self.unlocked_inner.config.clone()); @@ -146,7 +149,7 @@ impl StorageManagerInner { async fn save_metadata(&mut self) -> EyreResult<()>{ if let Some(metadata_db) = &self.metadata_db { let tx = metadata_db.transact(); - tx.store_rkyv(0, b"offline_subkey_writes", &self.offline_subkey_writes)?; + tx.store_json(0, OFFLINE_SUBKEY_WRITES, &self.offline_subkey_writes)?; tx.commit().await.wrap_err("failed to commit")? } Ok(()) @@ -154,10 +157,10 @@ impl StorageManagerInner { async fn load_metadata(&mut self) -> EyreResult<()> { if let Some(metadata_db) = &self.metadata_db { - self.offline_subkey_writes = match metadata_db.load_rkyv(0, b"offline_subkey_writes").await { + self.offline_subkey_writes = match metadata_db.load_json(0, OFFLINE_SUBKEY_WRITES).await { Ok(v) => v.unwrap_or_default(), Err(_) => { - if let Err(e) = metadata_db.delete(0,b"offline_subkey_writes").await { + if let Err(e) = metadata_db.delete(0, OFFLINE_SUBKEY_WRITES).await { debug!("offline_subkey_writes format changed, clearing: {}", e); } Default::default() @@ -483,9 +486,7 @@ impl StorageManagerInner { /// # DHT Key = Hash(ownerKeyKind) of: [ ownerKeyValue, schema ] fn get_key(vcrypto: CryptoSystemVersion, record: &Record) -> TypedKey where - D: fmt::Debug + Clone + RkyvArchive + RkyvSerialize, - for<'t> ::Archived: CheckBytes>, - ::Archived: RkyvDeserialize, + D: fmt::Debug + Clone + Serialize, { let compiled = record.descriptor().schema_data(); let mut hash_data = Vec::::with_capacity(PUBLIC_KEY_LENGTH + 4 + compiled.len()); diff --git a/veilid-core/src/storage_manager/types/local_record_detail.rs b/veilid-core/src/storage_manager/types/local_record_detail.rs index 9f16ba80..64e1f8d7 100644 --- a/veilid-core/src/storage_manager/types/local_record_detail.rs +++ b/veilid-core/src/storage_manager/types/local_record_detail.rs @@ -1,10 +1,7 @@ use super::*; /// Information required to handle locally opened records -#[derive( - Clone, Debug, PartialEq, Eq, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct LocalRecordDetail { /// The last 'safety selection' used when creating/opening this record. /// Even when closed, this safety selection applies to re-publication attempts by the system. diff --git a/veilid-core/src/storage_manager/types/record.rs b/veilid-core/src/storage_manager/types/record.rs index 86786c96..76f61bc0 100644 --- a/veilid-core/src/storage_manager/types/record.rs +++ b/veilid-core/src/storage_manager/types/record.rs @@ -1,14 +1,9 @@ use super::*; -#[derive( - Clone, Debug, PartialEq, Eq, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Record where - D: fmt::Debug + Clone + RkyvArchive + RkyvSerialize, - for<'t> ::Archived: CheckBytes>, - ::Archived: RkyvDeserialize, + D: fmt::Debug + Clone + Serialize, { descriptor: SignedValueDescriptor, subkey_count: usize, @@ -20,9 +15,7 @@ where impl Record where - D: fmt::Debug + Clone + RkyvArchive + RkyvSerialize, - for<'t> ::Archived: CheckBytes>, - ::Archived: RkyvDeserialize, + D: fmt::Debug + Clone + Serialize, { pub fn new( cur_ts: Timestamp, @@ -84,9 +77,9 @@ where mem::size_of::>() + self.descriptor.total_size() + self.record_data_size } - pub fn detail(&self) -> &D { - &self.detail - } + // pub fn detail(&self) -> &D { + // &self.detail + // } pub fn detail_mut(&mut self) -> &mut D { &mut self.detail } diff --git a/veilid-core/src/storage_manager/types/record_data.rs b/veilid-core/src/storage_manager/types/record_data.rs index a9f8ed51..532f4e0b 100644 --- a/veilid-core/src/storage_manager/types/record_data.rs +++ b/veilid-core/src/storage_manager/types/record_data.rs @@ -1,19 +1,6 @@ use super::*; -#[derive( - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] pub struct RecordData { signed_value_data: SignedValueData, } diff --git a/veilid-core/src/storage_manager/types/remote_record_detail.rs b/veilid-core/src/storage_manager/types/remote_record_detail.rs index e835faa6..f17a474d 100644 --- a/veilid-core/src/storage_manager/types/remote_record_detail.rs +++ b/veilid-core/src/storage_manager/types/remote_record_detail.rs @@ -1,7 +1,4 @@ use super::*; -#[derive( - Clone, Debug, PartialEq, Eq, Serialize, Deserialize, RkyvArchive, RkyvSerialize, RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct RemoteRecordDetail {} diff --git a/veilid-core/src/storage_manager/types/signed_value_data.rs b/veilid-core/src/storage_manager/types/signed_value_data.rs index 466764c8..1a2a3cf8 100644 --- a/veilid-core/src/storage_manager/types/signed_value_data.rs +++ b/veilid-core/src/storage_manager/types/signed_value_data.rs @@ -3,20 +3,7 @@ use super::*; ///////////////////////////////////////////////////////////////////////////////////////////////////// /// -#[derive( - Clone, - Debug, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)] pub struct SignedValueData { value_data: ValueData, signature: Signature, diff --git a/veilid-core/src/storage_manager/types/signed_value_descriptor.rs b/veilid-core/src/storage_manager/types/signed_value_descriptor.rs index ec5a3f38..a1c07615 100644 --- a/veilid-core/src/storage_manager/types/signed_value_descriptor.rs +++ b/veilid-core/src/storage_manager/types/signed_value_descriptor.rs @@ -3,19 +3,7 @@ use super::*; ///////////////////////////////////////////////////////////////////////////////////////////////////// /// -#[derive( - Clone, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)] pub struct SignedValueDescriptor { owner: PublicKey, schema_data: Vec, diff --git a/veilid-core/src/table_store/table_db.rs b/veilid-core/src/table_store/table_db.rs index f8f5b69a..41c5129a 100644 --- a/veilid-core/src/table_store/table_db.rs +++ b/veilid-core/src/table_store/table_db.rs @@ -195,15 +195,6 @@ impl TableDB { db.write(dbt).await.map_err(VeilidAPIError::generic) } - /// Store a key in rkyv format with a value in a column in the TableDB. Performs a single transaction immediately. - pub async fn store_rkyv(&self, col: u32, key: &[u8], value: &T) -> VeilidAPIResult<()> - where - T: RkyvSerialize, - { - let value = to_rkyv(value)?; - self.store(col, key, &value).await - } - /// Store a key in json format with a value in a column in the TableDB. Performs a single transaction immediately. pub async fn store_json(&self, col: u32, key: &[u8], value: &T) -> VeilidAPIResult<()> where @@ -230,21 +221,6 @@ impl TableDB { .map(|v| self.maybe_decrypt(&v))) } - /// Read an rkyv key from a column in the TableDB immediately - pub async fn load_rkyv(&self, col: u32, key: &[u8]) -> VeilidAPIResult> - where - T: RkyvArchive, - ::Archived: - for<'t> CheckBytes>, - ::Archived: RkyvDeserialize, - { - let out = match self.load(col, key).await? { - Some(v) => Some(from_rkyv(v)?), - None => None, - }; - Ok(out) - } - /// Read an serde-json key from a column in the TableDB immediately pub async fn load_json(&self, col: u32, key: &[u8]) -> VeilidAPIResult> where @@ -276,21 +252,6 @@ impl TableDB { Ok(old_value) } - /// Delete rkyv key with from a column in the TableDB - pub async fn delete_rkyv(&self, col: u32, key: &[u8]) -> VeilidAPIResult> - where - T: RkyvArchive, - ::Archived: - for<'t> CheckBytes>, - ::Archived: RkyvDeserialize, - { - let old_value = match self.delete(col, key).await? { - Some(v) => Some(from_rkyv(v)?), - None => None, - }; - Ok(old_value) - } - /// Delete serde-json key with from a column in the TableDB pub async fn delete_json(&self, col: u32, key: &[u8]) -> VeilidAPIResult> where @@ -377,16 +338,7 @@ impl TableDBTransaction { Ok(()) } - /// Store a key in rkyv format with a value in a column in the TableDB - pub fn store_rkyv(&self, col: u32, key: &[u8], value: &T) -> VeilidAPIResult<()> - where - T: RkyvSerialize, - { - let value = to_rkyv(value)?; - self.store(col, key, &value) - } - - /// Store a key in rkyv format with a value in a column in the TableDB + /// Store a key in json format with a value in a column in the TableDB pub fn store_json(&self, col: u32, key: &[u8], value: &T) -> VeilidAPIResult<()> where T: serde::Serialize, diff --git a/veilid-core/src/table_store/table_store.rs b/veilid-core/src/table_store/table_store.rs index fb293c44..04a9206f 100644 --- a/veilid-core/src/table_store/table_store.rs +++ b/veilid-core/src/table_store/table_store.rs @@ -1,6 +1,8 @@ use super::*; use keyvaluedb::*; +const ALL_TABLE_NAMES: &[u8] = b"all_table_names"; + struct TableStoreInner { opened: BTreeMap>, encryption_key: Option, @@ -52,12 +54,11 @@ impl TableStore { async fn flush(&self) { let (all_table_names_value, all_tables_db) = { let inner = self.inner.lock(); - let all_table_names_value = - to_rkyv(&inner.all_table_names).expect("failed to archive all_table_names"); + let all_table_names_value = serialize_json_bytes(&inner.all_table_names); (all_table_names_value, inner.all_tables_db.clone().unwrap()) }; let mut dbt = DBTransaction::new(); - dbt.put(0, b"all_table_names", &all_table_names_value); + dbt.put(0, ALL_TABLE_NAMES, &all_table_names_value); if let Err(e) = all_tables_db.write(dbt).await { error!("failed to write all tables db: {}", e); } @@ -373,8 +374,8 @@ impl TableStore { .open("__veilid_all_tables", 1) .await .wrap_err("failed to create all tables table")?; - match all_tables_db.get(0, b"all_table_names").await { - Ok(Some(v)) => match from_rkyv::>(v) { + match all_tables_db.get(0, ALL_TABLE_NAMES).await { + Ok(Some(v)) => match deserialize_json_bytes::>(&v) { Ok(all_table_names) => { let mut inner = self.inner.lock(); inner.all_table_names = all_table_names; diff --git a/veilid-core/src/table_store/tests/test_table_store.rs b/veilid-core/src/table_store/tests/test_table_store.rs index 86383f39..9bb503b3 100644 --- a/veilid-core/src/table_store/tests/test_table_store.rs +++ b/veilid-core/src/table_store/tests/test_table_store.rs @@ -145,7 +145,6 @@ pub async fn test_transaction(ts: TableStore) { let tx = db.transact(); assert!(tx.store(0, b"aaa", b"a-value").is_ok()); assert!(tx.store_json(1, b"bbb", &"b-value".to_owned()).is_ok()); - assert!(tx.store_rkyv(2, b"ccc", &"c-value".to_owned()).is_ok()); assert!(tx.store(3, b"ddd", b"d-value").is_err()); assert!(tx.store(0, b"ddd", b"d-value").is_ok()); assert!(tx.delete(0, b"ddd").is_ok()); @@ -160,51 +159,9 @@ pub async fn test_transaction(ts: TableStore) { db.load_json::(1, b"bbb").await, Ok(Some("b-value".to_owned())) ); - assert_eq!( - db.load_rkyv::(2, b"ccc").await, - Ok(Some("c-value".to_owned())) - ); assert_eq!(db.load(0, b"ddd").await, Ok(None)); } -pub async fn test_rkyv(vcrypto: CryptoSystemVersion, ts: TableStore) { - trace!("test_rkyv"); - - let _ = ts.delete("test"); - let db = ts.open("test", 3).await.expect("should have opened"); - let keypair = vcrypto.generate_keypair(); - - assert!(db.store_rkyv(0, b"asdf", &keypair).await.is_ok()); - - assert_eq!(db.load_rkyv::(0, b"qwer").await.unwrap(), None); - - let d = match db.load_rkyv::(0, b"asdf").await { - Ok(x) => x, - Err(e) => { - panic!("couldn't decode: {}", e); - } - }; - assert_eq!(d, Some(keypair), "keys should be equal"); - - let d = match db.delete_rkyv::(0, b"asdf").await { - Ok(x) => x, - Err(e) => { - panic!("couldn't decode: {}", e); - } - }; - assert_eq!(d, Some(keypair), "keys should be equal"); - - assert!( - db.store(1, b"foo", b"1234567890").await.is_ok(), - "should store new key" - ); - - assert!( - db.load_rkyv::(1, b"foo").await.is_err(), - "should fail to unfreeze" - ); -} - pub async fn test_json(vcrypto: CryptoSystemVersion, ts: TableStore) { trace!("test_json"); @@ -304,7 +261,6 @@ pub async fn test_all() { test_delete_open_delete(ts.clone()).await; test_store_delete_load(ts.clone()).await; test_transaction(ts.clone()).await; - test_rkyv(vcrypto.clone(), ts.clone()).await; test_json(vcrypto, ts.clone()).await; let _ = ts.delete("test").await; } diff --git a/veilid-core/src/tests/native/mod.rs b/veilid-core/src/tests/native/mod.rs index e8b450a3..382d10eb 100644 --- a/veilid-core/src/tests/native/mod.rs +++ b/veilid-core/src/tests/native/mod.rs @@ -35,8 +35,6 @@ pub async fn run_all_tests() { test_envelope_receipt::test_all().await; info!("TEST: veilid_api::tests::test_serialize_json"); veilid_api::tests::test_serialize_json::test_all().await; - info!("TEST: veilid_api::tests::test_serialize_rkyv"); - veilid_api::tests::test_serialize_rkyv::test_all().await; info!("TEST: routing_table::test_serialize_routing_table"); routing_table::tests::test_serialize_routing_table::test_all().await; @@ -138,8 +136,6 @@ cfg_if! { run_test!(veilid_api, test_serialize_json); - run_test!(veilid_api, test_serialize_rkyv); - run_test!(routing_table, test_serialize_routing_table); } } diff --git a/veilid-core/src/veilid_api/error.rs b/veilid-core/src/veilid_api/error.rs index 0eb7b791..6fcc4861 100644 --- a/veilid-core/src/veilid_api/error.rs +++ b/veilid-core/src/veilid_api/error.rs @@ -105,21 +105,8 @@ macro_rules! apibail_already_initialized { } #[derive( - ThisError, - Clone, - Debug, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + ThisError, Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] #[serde(tag = "kind")] pub enum VeilidAPIError { #[error("Not initialized")] @@ -137,9 +124,9 @@ pub enum VeilidAPIError { #[error("No connection: {message}")] NoConnection { message: String }, #[error("Key not found: {key}")] - KeyNotFound { - #[schemars(with="String")] - key: TypedKey + KeyNotFound { + #[schemars(with = "String")] + key: TypedKey, }, #[error("Internal: {message}")] Internal { message: String }, diff --git a/veilid-core/src/veilid_api/json_api/crypto_system.rs b/veilid-core/src/veilid_api/json_api/crypto_system.rs index 5fa499c8..d66bcaf4 100644 --- a/veilid-core/src/veilid_api/json_api/crypto_system.rs +++ b/veilid-core/src/veilid_api/json_api/crypto_system.rs @@ -35,24 +35,24 @@ pub enum CryptoSystemRequestOp { }, DefaultSaltLength, HashPassword { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] password: Vec, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] salt: Vec, }, VerifyPassword { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] password: Vec, password_hash: String, }, DeriveSharedSecret { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] password: Vec, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] salt: Vec, }, @@ -60,7 +60,7 @@ pub enum CryptoSystemRequestOp { RandomSharedSecret, GenerateKeyPair, GenerateHash { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, }, @@ -71,7 +71,7 @@ pub enum CryptoSystemRequestOp { secret: SecretKey, }, ValidateHash { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, #[schemars(with = "String")] @@ -88,14 +88,14 @@ pub enum CryptoSystemRequestOp { key: PublicKey, #[schemars(with = "String")] secret: SecretKey, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, }, Verify { #[schemars(with = "String")] key: PublicKey, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, #[schemars(with = "String")] @@ -103,31 +103,31 @@ pub enum CryptoSystemRequestOp { }, AeadOverhead, DecryptAead { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] body: Vec, #[schemars(with = "String")] nonce: Nonce, #[schemars(with = "String")] shared_secret: SharedSecret, - #[serde(with = "opt_json_as_base64")] + #[serde(with = "as_human_opt_base64")] #[schemars(with = "Option")] associated_data: Option>, }, EncryptAead { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] body: Vec, #[schemars(with = "String")] nonce: Nonce, #[schemars(with = "String")] shared_secret: SharedSecret, - #[serde(with = "opt_json_as_base64")] + #[serde(with = "as_human_opt_base64")] #[schemars(with = "Option")] associated_data: Option>, }, CryptNoAuth { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] body: Vec, #[schemars(with = "String")] @@ -152,7 +152,7 @@ pub enum CryptoSystemResponseOp { result: ApiResultWithString, }, RandomBytes { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] value: Vec, }, @@ -221,7 +221,7 @@ pub enum CryptoSystemResponseOp { result: ApiResultWithVecU8, }, CryptNoAuth { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] value: Vec, }, diff --git a/veilid-core/src/veilid_api/json_api/mod.rs b/veilid-core/src/veilid_api/json_api/mod.rs index 50596326..5b04a4bd 100644 --- a/veilid-core/src/veilid_api/json_api/mod.rs +++ b/veilid-core/src/veilid_api/json_api/mod.rs @@ -58,7 +58,7 @@ pub enum RequestOp { sequencing: Sequencing, }, ImportRemotePrivateRoute { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] blob: Vec, }, @@ -69,7 +69,7 @@ pub enum RequestOp { AppCallReply { #[schemars(with = "String")] call_id: OperationId, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] message: Vec, }, @@ -96,14 +96,14 @@ pub enum RequestOp { VerifySignatures { #[schemars(with = "Vec")] node_ids: Vec, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, #[schemars(with = "Vec")] signatures: Vec, }, GenerateSignatures { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, #[schemars(with = "Vec")] @@ -126,7 +126,7 @@ pub enum RequestOp { pub struct NewPrivateRouteResult { #[schemars(with = "String")] route_id: RouteId, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] blob: Vec, } @@ -260,7 +260,7 @@ where #[serde(untagged)] pub enum ApiResultWithVecU8 { Ok { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] value: Vec, }, @@ -271,7 +271,7 @@ pub enum ApiResultWithVecU8 { #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(transparent)] pub struct VecU8 { - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] value: Vec, } diff --git a/veilid-core/src/veilid_api/json_api/routing_context.rs b/veilid-core/src/veilid_api/json_api/routing_context.rs index d589bdbc..dc4ac323 100644 --- a/veilid-core/src/veilid_api/json_api/routing_context.rs +++ b/veilid-core/src/veilid_api/json_api/routing_context.rs @@ -27,13 +27,13 @@ pub enum RoutingContextRequestOp { }, AppCall { target: String, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] message: Vec, }, AppMessage { target: String, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] message: Vec, }, @@ -66,7 +66,7 @@ pub enum RoutingContextRequestOp { #[schemars(with = "String")] key: TypedKey, subkey: ValueSubkey, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, }, diff --git a/veilid-core/src/veilid_api/json_api/table_db.rs b/veilid-core/src/veilid_api/json_api/table_db.rs index 3a1d2008..54d35fcd 100644 --- a/veilid-core/src/veilid_api/json_api/table_db.rs +++ b/veilid-core/src/veilid_api/json_api/table_db.rs @@ -25,22 +25,22 @@ pub enum TableDbRequestOp { Transact, Store { col: u32, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] key: Vec, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] value: Vec, }, Load { col: u32, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] key: Vec, }, Delete { col: u32, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] key: Vec, }, @@ -101,16 +101,16 @@ pub enum TableDbTransactionRequestOp { Rollback, Store { col: u32, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] key: Vec, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] value: Vec, }, Delete { col: u32, - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] key: Vec, }, diff --git a/veilid-core/src/veilid_api/serialize_helpers/mod.rs b/veilid-core/src/veilid_api/serialize_helpers/mod.rs index 5a3805fd..e18fb135 100644 --- a/veilid-core/src/veilid_api/serialize_helpers/mod.rs +++ b/veilid-core/src/veilid_api/serialize_helpers/mod.rs @@ -1,14 +1,7 @@ -mod rkyv_enum_set; -mod rkyv_range_set_blaze; -pub mod serialize_arc; -mod serialize_json; -pub mod serialize_range_set_blaze; -mod veilid_rkyv; - use super::*; use core::fmt::Debug; -pub use rkyv_enum_set::*; -pub use rkyv_range_set_blaze::*; +pub mod serialize_arc; +mod serialize_json; +pub mod serialize_range_set_blaze; pub use serialize_json::*; -pub use veilid_rkyv::*; diff --git a/veilid-core/src/veilid_api/serialize_helpers/rkyv_enum_set.rs b/veilid-core/src/veilid_api/serialize_helpers/rkyv_enum_set.rs deleted file mode 100644 index a3422b48..00000000 --- a/veilid-core/src/veilid_api/serialize_helpers/rkyv_enum_set.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::*; - -pub struct RkyvEnumSet; - -impl rkyv::with::ArchiveWith> for RkyvEnumSet -where - T: EnumSetType + EnumSetTypeWithRepr, - ::Repr: rkyv::Archive, -{ - type Archived = rkyv::Archived<::Repr>; - type Resolver = rkyv::Resolver<::Repr>; - - #[inline] - unsafe fn resolve_with( - field: &EnumSet, - pos: usize, - resolver: Self::Resolver, - out: *mut Self::Archived, - ) { - let r = field.as_repr(); - r.resolve(pos, resolver, out); - } -} - -impl rkyv::with::SerializeWith, S> for RkyvEnumSet -where - S: rkyv::Fallible + ?Sized, - T: EnumSetType + EnumSetTypeWithRepr, - ::Repr: rkyv::Serialize, -{ - fn serialize_with(field: &EnumSet, serializer: &mut S) -> Result { - let r = field.as_repr(); - r.serialize(serializer) - } -} - -impl - rkyv::with::DeserializeWith::Repr>, EnumSet, D> - for RkyvEnumSet -where - D: rkyv::Fallible + ?Sized, - T: EnumSetType + EnumSetTypeWithRepr, - ::Repr: rkyv::Archive, - rkyv::Archived<::Repr>: - rkyv::Deserialize<::Repr, D>, -{ - fn deserialize_with( - field: &rkyv::Archived<::Repr>, - deserializer: &mut D, - ) -> Result, D::Error> { - Ok(EnumSet::::from_repr(field.deserialize(deserializer)?)) - } -} diff --git a/veilid-core/src/veilid_api/serialize_helpers/rkyv_range_set_blaze.rs b/veilid-core/src/veilid_api/serialize_helpers/rkyv_range_set_blaze.rs deleted file mode 100644 index 67388e4a..00000000 --- a/veilid-core/src/veilid_api/serialize_helpers/rkyv_range_set_blaze.rs +++ /dev/null @@ -1,73 +0,0 @@ -use super::*; - -use range_set_blaze::*; - -pub struct RkyvRangeSetBlaze; - -impl rkyv::with::ArchiveWith> for RkyvRangeSetBlaze -where - T: rkyv::Archive + Integer, -{ - type Archived = rkyv::Archived>; - type Resolver = rkyv::Resolver>; - - #[inline] - unsafe fn resolve_with( - field: &RangeSetBlaze, - pos: usize, - resolver: Self::Resolver, - out: *mut Self::Archived, - ) { - let mut r = Vec::::with_capacity(field.ranges_len() * 2); - for range in field.ranges() { - r.push(*range.start()); - r.push(*range.end()); - } - r.resolve(pos, resolver, out); - } -} - -impl rkyv::with::SerializeWith, S> for RkyvRangeSetBlaze -where - S: rkyv::Fallible + ?Sized, - Vec: rkyv::Serialize, - T: rkyv::Archive + Integer, -{ - fn serialize_with( - field: &RangeSetBlaze, - serializer: &mut S, - ) -> Result { - let mut r = Vec::::with_capacity(field.ranges_len() * 2); - for range in field.ranges() { - r.push(*range.start()); - r.push(*range.end()); - } - r.serialize(serializer) - } -} - -impl rkyv::with::DeserializeWith>, RangeSetBlaze, D> - for RkyvRangeSetBlaze -where - D: rkyv::Fallible + ?Sized, - T: rkyv::Archive + Integer, - rkyv::Archived: rkyv::Deserialize, - D::Error: From, -{ - fn deserialize_with( - field: &rkyv::Archived>, - deserializer: &mut D, - ) -> Result, D::Error> { - let mut out = RangeSetBlaze::::new(); - if field.len() % 2 == 1 { - return Err("invalid range set length".to_owned().into()); - } - let f = field.as_slice(); - for i in 0..field.len() / 2 { - let l: T = f[i * 2].deserialize(deserializer)?; - let u: T = f[i * 2 + 1].deserialize(deserializer)?; - out.ranges_insert(l..=u); - } - Ok(out) - } -} diff --git a/veilid-core/src/veilid_api/serialize_helpers/serialize_json.rs b/veilid-core/src/veilid_api/serialize_helpers/serialize_json.rs index afdab167..1f41ebf4 100644 --- a/veilid-core/src/veilid_api/serialize_helpers/serialize_json.rs +++ b/veilid-core/src/veilid_api/serialize_helpers/serialize_json.rs @@ -13,6 +13,18 @@ pub fn deserialize_json<'a, T: de::Deserialize<'a> + Debug>(arg: &'a str) -> Vei ), }) } +pub fn deserialize_json_bytes<'a, T: de::Deserialize<'a> + Debug>( + arg: &'a [u8], +) -> VeilidAPIResult { + serde_json::from_slice(arg).map_err(|e| VeilidAPIError::ParseError { + message: e.to_string(), + value: format!( + "deserialize_json_bytes:\n---\n{:?}\n---\n to type {}", + arg, + std::any::type_name::() + ), + }) +} // #[instrument(level = "trace", ret, err)] pub fn deserialize_opt_json( @@ -28,6 +40,20 @@ pub fn deserialize_opt_json( deserialize_json(arg) } +// #[instrument(level = "trace", ret, err)] +pub fn deserialize_opt_json_bytes( + arg: Option>, +) -> VeilidAPIResult { + let arg = arg.as_ref().ok_or_else(|| VeilidAPIError::ParseError { + message: "invalid null string".to_owned(), + value: format!( + "deserialize_json_opt: null to type {}", + std::any::type_name::() + ), + })?; + deserialize_json_bytes(arg.as_slice()) +} + // #[instrument(level = "trace", ret)] pub fn serialize_json(val: T) -> String { match serde_json::to_string(&val) { @@ -37,97 +63,138 @@ pub fn serialize_json(val: T) -> String { } } } +pub fn serialize_json_bytes(val: T) -> Vec { + match serde_json::to_vec(&val) { + Ok(v) => v, + Err(e) => { + panic!( + "failed to serialize json value to bytes: {}\nval={:?}", + e, val + ); + } + } +} -pub mod json_as_base64 { +pub mod as_human_base64 { use data_encoding::BASE64URL_NOPAD; use serde::{Deserialize, Deserializer, Serialize, Serializer}; pub fn serialize(v: &Vec, s: S) -> Result { - let base64 = BASE64URL_NOPAD.encode(v); - String::serialize(&base64, s) + if s.is_human_readable() { + let base64 = BASE64URL_NOPAD.encode(v); + String::serialize(&base64, s) + } else { + Vec::::serialize(v, s) + } } pub fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result, D::Error> { - let base64 = String::deserialize(d)?; - BASE64URL_NOPAD - .decode(base64.as_bytes()) - .map_err(|e| serde::de::Error::custom(e)) + if d.is_human_readable() { + let base64 = String::deserialize(d)?; + BASE64URL_NOPAD + .decode(base64.as_bytes()) + .map_err(|e| serde::de::Error::custom(e)) + } else { + Vec::::deserialize(d) + } } } -pub mod opt_json_as_base64 { +pub mod as_human_opt_base64 { use data_encoding::BASE64URL_NOPAD; use serde::{Deserialize, Deserializer, Serialize, Serializer}; pub fn serialize(v: &Option>, s: S) -> Result { - let base64 = v.as_ref().map(|x| BASE64URL_NOPAD.encode(&x)); - Option::::serialize(&base64, s) + if s.is_human_readable() { + let base64 = v.as_ref().map(|x| BASE64URL_NOPAD.encode(&x)); + Option::::serialize(&base64, s) + } else { + Option::>::serialize(v, s) + } } pub fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result>, D::Error> { - let base64 = Option::::deserialize(d)?; - base64 - .map(|x| { - BASE64URL_NOPAD - .decode(x.as_bytes()) - .map_err(|e| serde::de::Error::custom(e)) - }) - .transpose() - } -} - -pub mod json_as_string { - use std::fmt::Display; - use std::str::FromStr; - - use serde::{de, Deserialize, Deserializer, Serializer}; - - pub fn serialize(value: &T, serializer: S) -> Result - where - T: Display, - S: Serializer, - { - serializer.collect_str(value) - } - - pub fn deserialize<'de, T, D>(deserializer: D) -> Result - where - T: FromStr, - T::Err: Display, - D: Deserializer<'de>, - { - String::deserialize(deserializer)? - .parse() - .map_err(de::Error::custom) - } -} - -pub mod opt_json_as_string { - use std::fmt::Display; - use std::str::FromStr; - - use serde::{de, Deserialize, Deserializer, Serializer}; - - pub fn serialize(value: &Option, serializer: S) -> Result - where - T: Display, - S: Serializer, - { - match value { - Some(v) => serializer.collect_str(v), - None => serializer.serialize_none(), - } - } - - pub fn deserialize<'de, T, D>(deserializer: D) -> Result, D::Error> - where - T: FromStr, - T::Err: Display, - D: Deserializer<'de>, - { - match Option::::deserialize(deserializer)? { - None => Ok(None), - Some(v) => Ok(Some(v.parse::().map_err(de::Error::custom)?)), + if d.is_human_readable() { + let base64 = Option::::deserialize(d)?; + base64 + .map(|x| { + BASE64URL_NOPAD + .decode(x.as_bytes()) + .map_err(|e| serde::de::Error::custom(e)) + }) + .transpose() + } else { + Option::>::deserialize(d) + } + } +} + +pub mod as_human_string { + use std::fmt::Display; + use std::str::FromStr; + + use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; + + pub fn serialize(value: &T, s: S) -> Result + where + T: Display + Serialize, + S: Serializer, + { + if s.is_human_readable() { + s.collect_str(value) + } else { + T::serialize(value, s) + } + } + + pub fn deserialize<'de, T, D>(d: D) -> Result + where + T: FromStr + Deserialize<'de>, + T::Err: Display, + D: Deserializer<'de>, + { + if d.is_human_readable() { + String::deserialize(d)?.parse().map_err(de::Error::custom) + } else { + T::deserialize(d) + } + } +} + +pub mod as_human_opt_string { + use std::fmt::Display; + use std::str::FromStr; + + use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; + + pub fn serialize(value: &Option, s: S) -> Result + where + T: Display + Serialize, + S: Serializer, + { + if s.is_human_readable() { + match value { + Some(v) => s.collect_str(v), + None => s.serialize_none(), + } + } else { + Option::::serialize(value, s) + } + } + + pub fn deserialize<'de, T, D>(d: D) -> Result, D::Error> + where + T: FromStr + Deserialize<'de>, + T::Err: Display, + D: Deserializer<'de>, + { + if d.is_human_readable() { + match Option::::deserialize(d)? { + None => Ok(None), + Some(v) => Ok(Some(v.parse::().map_err(de::Error::custom)?)), + } + } else { + Option::::deserialize(d) } } } diff --git a/veilid-core/src/veilid_api/serialize_helpers/veilid_rkyv.rs b/veilid-core/src/veilid_api/serialize_helpers/veilid_rkyv.rs deleted file mode 100644 index cff3c7f8..00000000 --- a/veilid-core/src/veilid_api/serialize_helpers/veilid_rkyv.rs +++ /dev/null @@ -1,151 +0,0 @@ -use super::*; -use rkyv::ser::Serializer; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -pub struct VeilidRkyvSerializer { - inner: S, -} - -impl VeilidRkyvSerializer { - pub fn into_inner(self) -> S { - self.inner - } -} - -impl rkyv::Fallible for VeilidRkyvSerializer { - type Error = VeilidRkyvError; -} - -impl rkyv::ser::ScratchSpace for VeilidRkyvSerializer { - unsafe fn push_scratch( - &mut self, - layout: core::alloc::Layout, - ) -> Result, Self::Error> { - self.inner - .push_scratch(layout) - .map_err(VeilidRkyvError::Inner) - } - unsafe fn pop_scratch( - &mut self, - ptr: core::ptr::NonNull, - layout: core::alloc::Layout, - ) -> Result<(), Self::Error> { - self.inner - .pop_scratch(ptr, layout) - .map_err(VeilidRkyvError::Inner) - } -} - -impl rkyv::ser::Serializer for VeilidRkyvSerializer { - #[inline] - fn pos(&self) -> usize { - self.inner.pos() - } - - #[inline] - fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error> { - self.inner.write(bytes).map_err(VeilidRkyvError::Inner) - } -} - -impl Default for VeilidRkyvSerializer { - fn default() -> Self { - Self { - inner: S::default(), - } - } -} - -pub type DefaultVeilidRkyvSerializer = - VeilidRkyvSerializer>; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#[derive(Debug, Default)] -pub struct VeilidSharedDeserializeMap { - inner: SharedDeserializeMap, -} - -impl VeilidSharedDeserializeMap { - #[inline] - pub fn new() -> Self { - Self { - inner: SharedDeserializeMap::new(), - } - } -} -impl rkyv::Fallible for VeilidSharedDeserializeMap { - type Error = VeilidRkyvError; -} - -impl rkyv::de::SharedDeserializeRegistry for VeilidSharedDeserializeMap { - fn get_shared_ptr(&mut self, ptr: *const u8) -> Option<&dyn rkyv::de::SharedPointer> { - self.inner.get_shared_ptr(ptr) - } - - fn add_shared_ptr( - &mut self, - ptr: *const u8, - shared: Box, - ) -> Result<(), Self::Error> { - self.inner - .add_shared_ptr(ptr, shared) - .map_err(VeilidRkyvError::Inner) - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#[derive(Debug)] -pub enum VeilidRkyvError { - Inner(E), - StringError(String), -} - -impl From for VeilidRkyvError { - fn from(s: String) -> Self { - Self::StringError(s) - } -} - -impl fmt::Display for VeilidRkyvError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - VeilidRkyvError::Inner(e) => write!(f, "Inner: {}", e), - VeilidRkyvError::StringError(s) => write!(f, "StringError: {}", s), - } - } -} - -impl std::error::Error for VeilidRkyvError {} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -pub fn to_rkyv(value: &T) -> VeilidAPIResult> -where - T: RkyvSerialize, -{ - let mut serializer = DefaultVeilidRkyvSerializer::default(); - serializer - .serialize_value(value) - .map_err(|e| VeilidAPIError::generic(format!("failed to serialize object: {}", e)))?; - Ok(serializer - .into_inner() - .into_serializer() - .into_inner() - .to_vec()) -} - -pub fn from_rkyv(bytes: Vec) -> VeilidAPIResult -where - T: RkyvArchive, - ::Archived: - for<'t> CheckBytes>, - ::Archived: RkyvDeserialize, -{ - rkyv::check_archived_root::(&bytes) - .map_err(|e| VeilidAPIError::generic(format!("checkbytes failed: {}", e)))? - .deserialize(&mut VeilidSharedDeserializeMap::default()) - .map_err(|e| VeilidAPIError::generic(format!("failed to deserialize: {}", e))) -} diff --git a/veilid-core/src/veilid_api/tests/mod.rs b/veilid-core/src/veilid_api/tests/mod.rs index a5fe97b7..9a4b8807 100644 --- a/veilid-core/src/veilid_api/tests/mod.rs +++ b/veilid-core/src/veilid_api/tests/mod.rs @@ -1,6 +1,5 @@ mod fixtures; pub mod test_serialize_json; -pub mod test_serialize_rkyv; mod test_types; mod test_types_dht; mod test_types_dht_schema; diff --git a/veilid-core/src/veilid_api/tests/test_serialize_rkyv.rs b/veilid-core/src/veilid_api/tests/test_serialize_rkyv.rs deleted file mode 100644 index 0566f7b7..00000000 --- a/veilid-core/src/veilid_api/tests/test_serialize_rkyv.rs +++ /dev/null @@ -1,16 +0,0 @@ -use crate::*; - -pub async fn test_simple_string() { - let plain = "basic string".to_string(); - let serialized = b"basic string\x0c\x00\x00\x00\xf4\xff\xff\xff".to_vec(); - - let a = to_rkyv(&plain); - assert_eq!(a.unwrap(), serialized); - - let b = from_rkyv::(serialized); - assert_eq!(b.unwrap(), plain); -} - -pub async fn test_all() { - test_simple_string().await; -} diff --git a/veilid-core/src/veilid_api/types/aligned_u64.rs b/veilid-core/src/veilid_api/types/aligned_u64.rs index 566bac84..fbad5696 100644 --- a/veilid-core/src/veilid_api/types/aligned_u64.rs +++ b/veilid-core/src/veilid_api/types/aligned_u64.rs @@ -2,29 +2,16 @@ use super::*; /// Aligned u64 /// Required on 32-bit platforms for serialization because Rust aligns u64 on 4 byte boundaries -/// And zero-copy serialization with Rkyv requires 8-byte alignment +/// Some zero-copy serialization frameworks also want 8-byte alignment +/// Supports serializing to string for JSON as well, since JSON can't handle 64-bit numbers to Javascript #[derive( - Clone, - Default, - PartialEq, - Eq, - PartialOrd, - Ord, - Copy, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Clone, Default, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Serialize, Deserialize, JsonSchema, )] #[repr(C, align(8))] -#[archive_attr(repr(C, align(8)), derive(CheckBytes))] #[serde(transparent)] pub struct AlignedU64( - #[serde(with = "json_as_string")] + #[serde(with = "as_human_string")] #[schemars(with = "String")] u64, ); diff --git a/veilid-core/src/veilid_api/types/app_message_call.rs b/veilid-core/src/veilid_api/types/app_message_call.rs index 36fa47e1..f47be2af 100644 --- a/veilid-core/src/veilid_api/types/app_message_call.rs +++ b/veilid-core/src/veilid_api/types/app_message_call.rs @@ -1,27 +1,15 @@ use super::*; /// Direct statement blob passed to hosting application for processing -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidAppMessage { /// Some(sender) if the message was sent directly, None if received via a private/safety route - #[serde(with = "opt_json_as_string")] + #[serde(with = "as_human_opt_string")] #[schemars(with = "Option")] pub sender: Option, /// The content of the message to deliver to the application - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] pub message: Vec, } @@ -40,32 +28,20 @@ impl VeilidAppMessage { } /// Direct question blob passed to hosting application for processing to send an eventual AppReply -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidAppCall { /// Some(sender) if the request was sent directly, None if received via a private/safety route - #[serde(with = "opt_json_as_string")] + #[serde(with = "as_human_opt_string")] #[schemars(with = "Option")] sender: Option, /// The content of the request to deliver to the application - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] message: Vec, /// The id to reply to - #[serde(with = "json_as_string")] + #[serde(with = "as_human_string")] #[schemars(with = "String")] call_id: OperationId, } diff --git a/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs b/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs index 6bbbe597..251d1e28 100644 --- a/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs +++ b/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs @@ -1,21 +1,7 @@ use super::*; /// DHT Record Descriptor -#[derive( - Debug, - Clone, - PartialOrd, - Ord, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct DHTRecordDescriptor { /// DHT Key = Hash(ownerKeyKind) of: [ ownerKeyValue, schema ] #[schemars(with = "String")] diff --git a/veilid-core/src/veilid_api/types/dht/schema/dflt.rs b/veilid-core/src/veilid_api/types/dht/schema/dflt.rs index a742bdec..b2c6b2b7 100644 --- a/veilid-core/src/veilid_api/types/dht/schema/dflt.rs +++ b/veilid-core/src/veilid_api/types/dht/schema/dflt.rs @@ -1,21 +1,7 @@ use super::*; /// Default DHT Schema (DFLT) -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Ord, - PartialOrd, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize, JsonSchema)] pub struct DHTSchemaDFLT { /// Owner subkey count pub o_cnt: u16, diff --git a/veilid-core/src/veilid_api/types/dht/schema/mod.rs b/veilid-core/src/veilid_api/types/dht/schema/mod.rs index 2361e32c..ec54ae30 100644 --- a/veilid-core/src/veilid_api/types/dht/schema/mod.rs +++ b/veilid-core/src/veilid_api/types/dht/schema/mod.rs @@ -7,21 +7,7 @@ pub use dflt::*; pub use smpl::*; /// Enum over all the supported DHT Schemas -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Ord, - PartialOrd, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize, JsonSchema)] #[serde(tag = "kind")] pub enum DHTSchema { DFLT(DHTSchemaDFLT), diff --git a/veilid-core/src/veilid_api/types/dht/schema/smpl.rs b/veilid-core/src/veilid_api/types/dht/schema/smpl.rs index 9b2c7df1..942652fe 100644 --- a/veilid-core/src/veilid_api/types/dht/schema/smpl.rs +++ b/veilid-core/src/veilid_api/types/dht/schema/smpl.rs @@ -1,21 +1,7 @@ use super::*; /// Simple DHT Schema (SMPL) Member -#[derive( - Debug, - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, JsonSchema)] pub struct DHTSchemaSMPLMember { /// Member key #[schemars(with = "String")] @@ -25,21 +11,7 @@ pub struct DHTSchemaSMPLMember { } /// Simple DHT Schema (SMPL) -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Ord, - PartialOrd, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize, JsonSchema)] pub struct DHTSchemaSMPL { /// Owner subkey count pub o_cnt: u16, diff --git a/veilid-core/src/veilid_api/types/dht/value_data.rs b/veilid-core/src/veilid_api/types/dht/value_data.rs index b71ba9fc..f15c4a4c 100644 --- a/veilid-core/src/veilid_api/types/dht/value_data.rs +++ b/veilid-core/src/veilid_api/types/dht/value_data.rs @@ -1,26 +1,12 @@ use super::*; -#[derive( - Clone, - Default, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize, JsonSchema)] pub struct ValueData { /// An increasing sequence number to time-order the DHT record changes seq: ValueSeqNum, /// The contents of a DHT Record - #[serde(with = "json_as_base64")] + #[serde(with = "as_human_base64")] #[schemars(with = "String")] data: Vec, diff --git a/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs b/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs index 241223c1..9e7eb970 100644 --- a/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs +++ b/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs @@ -2,24 +2,9 @@ use super::*; use core::ops::{Deref, DerefMut}; use range_set_blaze::*; -#[derive( - Clone, - Default, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Default, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize, JsonSchema)] #[serde(transparent)] pub struct ValueSubkeyRangeSet { - #[with(RkyvRangeSetBlaze)] #[serde(with = "serialize_range_set_blaze")] #[schemars(with = "Vec<(u32,u32)>")] data: RangeSetBlaze, diff --git a/veilid-core/src/veilid_api/types/fourcc.rs b/veilid-core/src/veilid_api/types/fourcc.rs index 1d56da33..5995c1b5 100644 --- a/veilid-core/src/veilid_api/types/fourcc.rs +++ b/veilid-core/src/veilid_api/types/fourcc.rs @@ -2,22 +2,8 @@ use super::*; /// FOURCC code #[derive( - Copy, - Default, - Clone, - Hash, - PartialOrd, - Ord, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Default, Clone, Hash, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(C), derive(CheckBytes, PartialOrd, Ord, PartialEq, Eq, Hash))] #[serde(try_from = "String")] #[serde(into = "String")] pub struct FourCC(pub [u8; 4]); diff --git a/veilid-core/src/veilid_api/types/safety.rs b/veilid-core/src/veilid_api/types/safety.rs index 970619c2..8e49cf5f 100644 --- a/veilid-core/src/veilid_api/types/safety.rs +++ b/veilid-core/src/veilid_api/types/safety.rs @@ -2,26 +2,12 @@ use super::*; // Ordering here matters, >= is used to check strength of sequencing requirement #[derive( - Copy, - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum Sequencing { - NoPreference, - PreferOrdered, - EnsureOrdered, + NoPreference = 0, + PreferOrdered = 1, + EnsureOrdered = 2, } impl Default for Sequencing { @@ -32,25 +18,11 @@ impl Default for Sequencing { // Ordering here matters, >= is used to check strength of stability requirement #[derive( - Copy, - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum Stability { - LowLatency, - Reliable, + LowLatency = 0, + Reliable = 1, } impl Default for Stability { @@ -61,22 +33,8 @@ impl Default for Stability { /// The choice of safety route to include in compiled routes #[derive( - Copy, - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum SafetySelection { /// Don't use a safety route, only specify the sequencing preference Unsafe(Sequencing), @@ -101,22 +59,8 @@ impl Default for SafetySelection { /// Options for safety routes (sender privacy) #[derive( - Copy, - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(C), derive(CheckBytes))] pub struct SafetySpec { /// preferred safety route set id if it still exists #[schemars(with = "Option")] diff --git a/veilid-core/src/veilid_api/types/stats.rs b/veilid-core/src/veilid_api/types/stats.rs index a7bbce14..836cb728 100644 --- a/veilid-core/src/veilid_api/types/stats.rs +++ b/veilid-core/src/veilid_api/types/stats.rs @@ -1,39 +1,13 @@ use super::*; -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct LatencyStats { pub fastest: TimestampDuration, // fastest latency in the ROLLING_LATENCIES_SIZE last latencies pub average: TimestampDuration, // average latency over the ROLLING_LATENCIES_SIZE last latencies pub slowest: TimestampDuration, // slowest latency in the ROLLING_LATENCIES_SIZE last latencies } -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct TransferStats { pub total: ByteCount, // total amount transferred ever pub maximum: ByteCount, // maximum rate over the ROLLING_TRANSFERS_SIZE last amounts @@ -41,39 +15,13 @@ pub struct TransferStats { pub minimum: ByteCount, // minimum rate over the ROLLING_TRANSFERS_SIZE last amounts } -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct TransferStatsDownUp { pub down: TransferStats, pub up: TransferStats, } -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct RPCStats { pub messages_sent: u32, // number of rpcs that have been sent in the total_time range pub messages_rcvd: u32, // number of rpcs that have been received in the total_time range @@ -85,20 +33,7 @@ pub struct RPCStats { pub failed_to_send: u32, // number of messages that have failed to send since we last successfully sent one } -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct PeerStats { pub time_added: Timestamp, // when the peer was added to the routing table pub rpc_stats: RPCStats, // information about RPCs diff --git a/veilid-core/src/veilid_api/types/tunnel.rs b/veilid-core/src/veilid_api/types/tunnel.rs index 370b45ee..6b5220cf 100644 --- a/veilid-core/src/veilid_api/types/tunnel.rs +++ b/veilid-core/src/veilid_api/types/tunnel.rs @@ -7,64 +7,26 @@ pub type TunnelId = AlignedU64; #[cfg(feature = "unstable-tunnels")] #[derive( - Copy, - Clone, - Debug, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum TunnelMode { - Raw, - Turn, + Raw = 0, + Turn = 1, } #[cfg(feature = "unstable-tunnels")] #[derive( - Copy, - Clone, - Debug, - PartialOrd, - PartialEq, - Eq, - Ord, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Copy, Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum TunnelError { - BadId, // Tunnel ID was rejected - NoEndpoint, // Endpoint was unreachable - RejectedMode, // Endpoint couldn't provide mode - NoCapacity, // Endpoint is full + BadId = 0, // Tunnel ID was rejected + NoEndpoint = 1, // Endpoint was unreachable + RejectedMode = 2, // Endpoint couldn't provide mode + NoCapacity = 3, // Endpoint is full } #[cfg(feature = "unstable-tunnels")] -#[derive( - Clone, - Debug, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct TunnelEndpoint { pub mode: TunnelMode, pub description: String, // XXX: TODO @@ -81,20 +43,7 @@ impl Default for TunnelEndpoint { } #[cfg(feature = "unstable-tunnels")] -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct FullTunnel { pub id: TunnelId, pub timeout: TimestampDuration, @@ -103,20 +52,7 @@ pub struct FullTunnel { } #[cfg(feature = "unstable-tunnels")] -#[derive( - Clone, - Debug, - Default, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct PartialTunnel { pub id: TunnelId, pub timeout: TimestampDuration, diff --git a/veilid-core/src/veilid_api/types/veilid_log.rs b/veilid-core/src/veilid_api/types/veilid_log.rs index f377115c..bf9c5963 100644 --- a/veilid-core/src/veilid_api/types/veilid_log.rs +++ b/veilid-core/src/veilid_api/types/veilid_log.rs @@ -2,27 +2,14 @@ use super::*; /// Log level for VeilidCore #[derive( - Debug, - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Copy, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, + Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Serialize, Deserialize, JsonSchema, )] -#[archive_attr(repr(u8), derive(CheckBytes))] pub enum VeilidLogLevel { Error = 1, - Warn, - Info, - Debug, - Trace, + Warn = 2, + Info = 3, + Debug = 4, + Trace = 5, } impl VeilidLogLevel { @@ -92,19 +79,7 @@ impl fmt::Display for VeilidLogLevel { } } /// A VeilidCore log message with optional backtrace -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidLog { pub log_level: VeilidLogLevel, pub message: String, diff --git a/veilid-core/src/veilid_api/types/veilid_state.rs b/veilid-core/src/veilid_api/types/veilid_state.rs index c86dac03..88ee35b9 100644 --- a/veilid-core/src/veilid_api/types/veilid_state.rs +++ b/veilid-core/src/veilid_api/types/veilid_state.rs @@ -1,29 +1,16 @@ use super::*; /// Attachment abstraction for network 'signal strength' -#[derive( - Debug, - PartialEq, - Eq, - Clone, - Copy, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, JsonSchema)] pub enum AttachmentState { - Detached, - Attaching, - AttachedWeak, - AttachedGood, - AttachedStrong, - FullyAttached, - OverAttached, - Detaching, + Detached = 0, + Attaching = 1, + AttachedWeak = 2, + AttachedGood = 3, + AttachedStrong = 4, + FullyAttached = 5, + OverAttached = 6, + Detaching = 7, } impl fmt::Display for AttachmentState { @@ -60,38 +47,14 @@ impl TryFrom for AttachmentState { } } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidStateAttachment { pub state: AttachmentState, pub public_internet_ready: bool, pub local_network_ready: bool, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct PeerTableData { #[schemars(with = "Vec")] pub node_ids: Vec, @@ -99,19 +62,7 @@ pub struct PeerTableData { pub peer_stats: PeerStats, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidStateNetwork { pub started: bool, pub bps_down: ByteCount, @@ -119,19 +70,7 @@ pub struct VeilidStateNetwork { pub peers: Vec, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidRouteChange { #[schemars(with = "Vec")] pub dead_routes: Vec, @@ -139,36 +78,12 @@ pub struct VeilidRouteChange { pub dead_remote_routes: Vec, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidStateConfig { pub config: VeilidConfigInner, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidValueChange { #[schemars(with = "String")] pub key: TypedKey, @@ -177,19 +92,7 @@ pub struct VeilidValueChange { pub value: ValueData, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(u8), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] #[serde(tag = "kind")] pub enum VeilidUpdate { Log(VeilidLog), @@ -203,19 +106,7 @@ pub enum VeilidUpdate { Shutdown, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] -#[archive_attr(repr(C), derive(CheckBytes))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidState { pub attachment: VeilidStateAttachment, pub network: VeilidStateNetwork, diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index 3d51a0bd..91027978 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -14,19 +14,7 @@ pub type ConfigCallback = Arc ConfigCallbackReturn + Send + Sy /// url: 'https://localhost:5150' /// ``` /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigHTTPS { pub enabled: bool, pub listen_address: String, @@ -44,19 +32,7 @@ pub struct VeilidConfigHTTPS { /// url: 'https://localhost:5150' /// ``` /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigHTTP { pub enabled: bool, pub listen_address: String, @@ -70,19 +46,7 @@ pub struct VeilidConfigHTTP { /// /// To be implemented... /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigApplication { pub https: VeilidConfigHTTPS, pub http: VeilidConfigHTTP, @@ -98,19 +62,7 @@ pub struct VeilidConfigApplication { /// public_address: '' /// ``` /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigUDP { pub enabled: bool, pub socket_pool_size: u32, @@ -128,19 +80,7 @@ pub struct VeilidConfigUDP { /// listen_address: ':5150' /// public_address: '' /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigTCP { pub connect: bool, pub listen: bool, @@ -160,19 +100,8 @@ pub struct VeilidConfigTCP { /// path: 'ws' /// url: 'ws://localhost:5150/ws' /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] + pub struct VeilidConfigWS { pub connect: bool, pub listen: bool, @@ -193,19 +122,8 @@ pub struct VeilidConfigWS { /// path: 'ws' /// url: '' /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] + pub struct VeilidConfigWSS { pub connect: bool, pub listen: bool, @@ -222,19 +140,8 @@ pub struct VeilidConfigWSS { /// All protocols are available by default, and the Veilid node will /// sort out which protocol is used for each peer connection. /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] + pub struct VeilidConfigProtocol { pub udp: VeilidConfigUDP, pub tcp: VeilidConfigTCP, @@ -250,19 +157,7 @@ pub struct VeilidConfigProtocol { /// private_key_path: /path/to/private/key /// connection_initial_timeout_ms: 2000 /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigTLS { pub certificate_path: String, pub private_key_path: String, @@ -271,19 +166,7 @@ pub struct VeilidConfigTLS { /// Configure the Distributed Hash Table (DHT) /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigDHT { pub max_find_node_count: u32, pub resolve_node_timeout_ms: u32, @@ -308,19 +191,7 @@ pub struct VeilidConfigDHT { /// Configure RPC /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigRPC { pub concurrency: u32, pub queue_size: u32, @@ -333,19 +204,7 @@ pub struct VeilidConfigRPC { /// Configure the network routing table /// -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigRoutingTable { #[schemars(with = "Vec")] pub node_id: TypedKeyGroup, @@ -361,19 +220,7 @@ pub struct VeilidConfigRoutingTable { // xxx pub enable_local_network: bool, } -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigNetwork { pub connection_initial_timeout_ms: u32, pub connection_inactivity_timeout_ms: u32, @@ -396,55 +243,19 @@ pub struct VeilidConfigNetwork { pub protocol: VeilidConfigProtocol, } -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigTableStore { pub directory: String, pub delete: bool, } -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigBlockStore { pub directory: String, pub delete: bool, } -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigProtectedStore { pub allow_insecure_fallback: bool, pub always_use_insecure_storage: bool, @@ -454,36 +265,12 @@ pub struct VeilidConfigProtectedStore { pub new_device_encryption_key_password: Option, } -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigCapabilities { pub disable: Vec, } -#[derive( - Clone, - Copy, - PartialEq, - Eq, - Debug, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize, JsonSchema)] pub enum VeilidConfigLogLevel { Off, Error, @@ -570,19 +357,7 @@ impl fmt::Display for VeilidConfigLogLevel { } } -#[derive( - Default, - Debug, - Clone, - PartialEq, - Eq, - Serialize, - Deserialize, - RkyvArchive, - RkyvSerialize, - RkyvDeserialize, - JsonSchema, -)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub struct VeilidConfigInner { pub program_name: String, pub namespace: String, diff --git a/veilid-core/tests/web.rs b/veilid-core/tests/web.rs index caba3621..a15aae86 100644 --- a/veilid-core/tests/web.rs +++ b/veilid-core/tests/web.rs @@ -97,12 +97,6 @@ async fn wasm_test_serialize_json() { test_serialize_json::test_all().await; } -#[wasm_bindgen_test] -async fn wasm_test_serialize_rkyv() { - setup(); - test_serialize_rkyv::test_all().await; -} - #[wasm_bindgen_test] async fn wasm_test_serialize_routing_table() { setup(); diff --git a/veilid-flutter/rust/src/dart_ffi.rs b/veilid-flutter/rust/src/dart_ffi.rs index c86e9fb5..b7c6111f 100644 --- a/veilid-flutter/rust/src/dart_ffi.rs +++ b/veilid-flutter/rust/src/dart_ffi.rs @@ -119,7 +119,7 @@ pub struct VeilidFFIConfig { #[derive(Debug, Deserialize, Serialize)] pub struct VeilidFFIRouteBlob { pub route_id: veilid_core::RouteId, - #[serde(with = "veilid_core::json_as_base64")] + #[serde(with = "veilid_core::as_human_base64")] pub blob: Vec, } diff --git a/veilid-tools/Cargo.toml b/veilid-tools/Cargo.toml index 4b3875da..94c6be7a 100644 --- a/veilid-tools/Cargo.toml +++ b/veilid-tools/Cargo.toml @@ -46,7 +46,6 @@ flume = { version = "^0", features = ["async"] } async-std = { version = "^1", features = ["unstable"], optional = true} tokio = { version = "^1", features = ["full"], optional = true} tokio-util = { version = "^0", features = ["compat"], optional = true} -maplit = "^1" futures-util = { version = "^0", default-features = false, features = ["async-await", "sink", "std", "io"] } chrono = "^0"