From 13ed4379d5d730934179275cbfd8ee715e8a2d76 Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Wed, 4 Jan 2023 01:24:00 +0800 Subject: [PATCH] fix: move back to upstream bitswap crate --- Cargo.lock | 511 ++++++++++++++++------------ Cargo.toml | 9 +- node/db/Cargo.toml | 2 + node/db/src/lib.rs | 42 +++ node/db/src/memory.rs | 18 +- node/db/src/parity_db.rs | 22 +- node/db/src/rocks.rs | 21 +- node/db/src/utils.rs | 8 +- node/forest_libp2p/src/behaviour.rs | 15 +- node/forest_libp2p/src/service.rs | 2 +- 10 files changed, 400 insertions(+), 250 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8240693fc66b..8ce395a16546 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" dependencies = [ "backtrace", ] @@ -222,9 +222,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983cd8b9d4b02a6dc6ffa557262eb5858a27a0038ffffe21a0f133eaa819a164" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "argon2" @@ -406,9 +406,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" +checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3" dependencies = [ "proc-macro2", "quote", @@ -457,7 +457,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -680,9 +680,9 @@ dependencies = [ [[package]] name = "blake2" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ "digest 0.10.6", ] @@ -1039,12 +1039,25 @@ checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ "core2", "multibase", - "multihash", + "multihash 0.16.3", "serde", "serde_bytes", "unsigned-varint", ] +[[package]] +name = "cid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" +dependencies = [ + "core2", + "multibase", + "multihash 0.17.0", + "serde", + "unsigned-varint", +] + [[package]] name = "cipher" version = "0.2.5" @@ -1175,16 +1188,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +checksum = "c9b6515d269224923b26b5febea2ed42b2d5f2ce37284a4dd670fedd6cb8347a" dependencies = [ "encode_unicode", "lazy_static", "libc", - "terminal_size", "unicode-width", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -1193,8 +1205,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e57ff02e8ad8e06ab9731d5dc72dc23bef9200778eae1a89d555d8c42e5d4a86" dependencies = [ - "prost 0.11.3", - "prost-types 0.11.2", + "prost 0.11.5", + "prost-types 0.11.5", "tonic", "tracing-core", ] @@ -1212,7 +1224,7 @@ dependencies = [ "hdrhistogram", "humantime", "parking_lot 0.11.2", - "prost-types 0.11.2", + "prost-types 0.11.5", "serde", "serde_json", "thread_local", @@ -1641,9 +1653,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" dependencies = [ "cc", "cxxbridge-flags", @@ -1653,9 +1665,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" dependencies = [ "cc", "codespan-reporting", @@ -1668,15 +1680,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" +checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" [[package]] name = "cxxbridge-macro" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" dependencies = [ "proc-macro2", "quote", @@ -1976,9 +1988,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dtoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a6eee2d5d0d113f015688310da018bd1d864d86bd567c8fca9c266889e1bfa" +checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313" [[package]] name = "ec-gpu" @@ -2114,9 +2126,9 @@ dependencies = [ [[package]] name = "erased-serde" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54558e0ba96fbe24280072642eceb9d7d442e32c7ec0ea9e7ecd7b4ea2cf4e11" +checksum = "e4ca605381c017ec7a5fef5e548f1cfaa419ed0f6df6367339300db74c92aa7d" dependencies = [ "serde", ] @@ -2307,7 +2319,7 @@ version = "8.0.0" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v8", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", @@ -2325,7 +2337,7 @@ version = "9.0.3" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", @@ -2343,7 +2355,7 @@ version = "8.0.0" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v8", "fvm_ipld_bitfield", "fvm_ipld_blockstore", @@ -2363,7 +2375,7 @@ version = "9.0.3" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "fvm_ipld_bitfield", "fvm_ipld_blockstore", @@ -2385,7 +2397,7 @@ source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f240005970 dependencies = [ "anyhow", "byteorder", - "cid", + "cid 0.8.6", "fil_actors_runtime_v8", "fvm_ipld_amt", "fvm_ipld_bitfield", @@ -2409,7 +2421,7 @@ source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f240005970 dependencies = [ "anyhow", "byteorder", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "fvm_ipld_amt", "fvm_ipld_bitfield", @@ -2421,7 +2433,7 @@ dependencies = [ "lazy_static", "libipld-core 0.14.0", "log", - "multihash", + "multihash 0.16.3", "num-derive", "num-traits", "rand 0.8.5", @@ -2434,7 +2446,7 @@ version = "9.0.3" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "frc42_dispatch", "fvm_ipld_blockstore", @@ -2455,7 +2467,7 @@ version = "8.0.0" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v8", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", @@ -2475,7 +2487,7 @@ version = "9.0.3" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", @@ -2529,7 +2541,7 @@ version = "9.0.3" source = "git+https://github.com/ChainSafe/fil-actor-states#942818b811f2400059707c77754ca02e8443b514" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", "fvm_shared", @@ -2547,7 +2559,7 @@ dependencies = [ "base64", "blake2b_simd", "byteorder", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "fvm_ipld_amt", "fvm_ipld_blockstore", @@ -2558,7 +2570,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multihash", + "multihash 0.16.3", "num-derive", "num-traits", "paste", @@ -2580,7 +2592,7 @@ dependencies = [ "base64", "blake2b_simd", "byteorder", - "cid", + "cid 0.8.6", "fvm_ipld_amt", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", @@ -2589,7 +2601,7 @@ dependencies = [ "getrandom 0.2.8", "itertools 0.10.5", "log", - "multihash", + "multihash 0.16.3", "num", "num-derive", "num-traits", @@ -2716,7 +2728,7 @@ dependencies = [ "anyhow", "assert_cmd", "base64", - "cid", + "cid 0.8.6", "directories", "fil_actor_miner_v8", "forest_actor_interface", @@ -2783,7 +2795,7 @@ dependencies = [ "atty", "base64", "chrono", - "cid", + "cid 0.8.6", "ctrlc", "daemonize-me", "dialoguer", @@ -2854,7 +2866,7 @@ name = "forest_actor_interface" version = "0.2.0" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fil_actor_account_v8", "fil_actor_account_v9", "fil_actor_cron_v8", @@ -2925,7 +2937,7 @@ version = "0.2.0" dependencies = [ "base64", "byteorder", - "cid", + "cid 0.8.6", "derive_builder", "forest_beacon", "forest_crypto", @@ -2959,7 +2971,7 @@ dependencies = [ "blake2b_simd", "bls-signatures", "byteorder", - "cid", + "cid 0.8.6", "digest 0.10.6", "flume", "forest_actor_interface", @@ -2982,8 +2994,8 @@ dependencies = [ "fvm_ipld_encoding 0.2.3", "fvm_shared", "log", - "lru", - "multihash", + "lru 0.9.0", + "multihash 0.16.3", "num-traits", "once_cell", "prometheus", @@ -3000,7 +3012,7 @@ dependencies = [ "anyhow", "async-trait", "base64", - "cid", + "cid 0.8.6", "flume", "forest_actor_interface", "forest_beacon", @@ -3030,7 +3042,7 @@ dependencies = [ "hex", "lazy_static", "log", - "lru", + "lru 0.9.0", "nonempty", "num-bigint", "num-traits", @@ -3056,7 +3068,7 @@ dependencies = [ "base64", "byte-unit", "chrono", - "cid", + "cid 0.8.6", "console-subscriber", "directories", "fil_actor_miner_v8", @@ -3146,15 +3158,17 @@ name = "forest_db" version = "0.2.0" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fvm_ipld_blockstore", "lazy_static", - "libipld", + "libipld 0.14.0", "libp2p-bitswap", + "multihash 0.16.3", "num_cpus", "parity-db", "parking_lot 0.12.1", "prometheus", + "rand 0.8.5", "rocksdb", "serde", "tempfile", @@ -3167,7 +3181,7 @@ version = "0.2.0" dependencies = [ "anyhow", "async-trait", - "cid", + "cid 0.8.6", "forest_actor_interface", "forest_blocks", "forest_chain", @@ -3210,7 +3224,7 @@ version = "0.2.0" dependencies = [ "anyhow", "async-trait", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "forest_actor_interface", "forest_beacon", @@ -3245,7 +3259,7 @@ version = "0.4.0" dependencies = [ "anyhow", "base64", - "cid", + "cid 0.8.6", "filecoin-proofs-api", "fvm_ipld_encoding 0.2.3", "fvm_shared", @@ -3261,7 +3275,7 @@ name = "forest_genesis" version = "0.2.0" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "forest_blocks", "forest_chain", "forest_db", @@ -3296,7 +3310,7 @@ dependencies = [ "ahash 0.8.2", "anyhow", "byteorder", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "forest_actor_interface", "forest_blocks", @@ -3326,18 +3340,18 @@ dependencies = [ "anyhow", "async-recursion", "async-trait", - "cid", + "cid 0.8.6", "forest_db", "forest_json", "forest_utils", "fvm_ipld_encoding 0.2.3", "fvm_shared", "indexmap", - "libipld", + "libipld 0.14.0", "libipld-core 0.14.0", - "libipld-macro", + "libipld-macro 0.14.0", "multibase", - "multihash", + "multihash 0.16.3", "quickcheck", "quickcheck_macros", "serde", @@ -3353,7 +3367,7 @@ dependencies = [ "anyhow", "arbitrary", "base64", - "cid", + "cid 0.8.6", "cs_serde_bytes", "data-encoding", "data-encoding-macro", @@ -3364,7 +3378,7 @@ dependencies = [ "fvm", "fvm_ipld_encoding 0.2.3", "fvm_shared", - "multihash", + "multihash 0.16.3", "num-bigint", "quickcheck", "quickcheck_macros", @@ -3403,7 +3417,7 @@ version = "0.2.0" dependencies = [ "ahash 0.8.2", "anyhow", - "cid", + "cid 0.8.6", "forest_db", "forest_encoding", "forest_utils", @@ -3422,7 +3436,7 @@ dependencies = [ "anyhow", "async-trait", "bytes 1.3.0", - "cid", + "cid 0.8.6", "flume", "fnv", "forest_blocks", @@ -3441,11 +3455,11 @@ dependencies = [ "fvm_ipld_car", "fvm_ipld_encoding 0.2.3", "fvm_shared", - "libipld", + "libipld 0.14.0", "libp2p", "libp2p-bitswap", "log", - "multihash", + "multihash 0.16.3", "pin-project-lite", "prometheus", "quickcheck", @@ -3465,7 +3479,7 @@ version = "0.8.0" dependencies = [ "anyhow", "base64", - "cid", + "cid 0.8.6", "forest_encoding", "fvm", "fvm_ipld_encoding 0.2.3", @@ -3484,7 +3498,7 @@ dependencies = [ "anyhow", "async-trait", "blake2b_simd", - "cid", + "cid 0.8.6", "flume", "forest_blocks", "forest_chain", @@ -3506,7 +3520,7 @@ dependencies = [ "fvm_shared", "libsecp256k1", "log", - "lru", + "lru 0.9.0", "num-rational", "num-traits", "rand 0.8.5", @@ -3572,7 +3586,7 @@ dependencies = [ "axum", "base64", "bls-signatures", - "cid", + "cid 0.8.6", "crossbeam", "fil_actor_miner_v8", "flume", @@ -3627,7 +3641,7 @@ version = "0.2.0" dependencies = [ "anyhow", "chrono", - "cid", + "cid 0.8.6", "flume", "forest_actor_interface", "forest_beacon", @@ -3685,7 +3699,7 @@ dependencies = [ "anyhow", "blake2b_simd", "byteorder", - "cid", + "cid 0.8.6", "fil_actors_runtime_v9", "filecoin-proofs-api", "forest_actor_interface", @@ -3710,7 +3724,7 @@ dependencies = [ "fvm_ipld_encoding 0.2.3", "fvm_shared", "lazy_static", - "lru", + "lru 0.9.0", "num-traits", "once_cell", "prometheus", @@ -3724,7 +3738,7 @@ dependencies = [ name = "forest_state_migration" version = "0.2.0" dependencies = [ - "cid", + "cid 0.8.6", "crossbeam-channel", "fvm", "fvm_ipld_blockstore", @@ -3741,7 +3755,7 @@ name = "forest_statediff" version = "0.2.0" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "colored", "directories", "fil_actor_account_v9", @@ -3776,7 +3790,7 @@ version = "0.2.0" dependencies = [ "anyhow", "base64", - "cid", + "cid 0.8.6", "forest_blocks", "forest_chain", "forest_crypto", @@ -3794,7 +3808,7 @@ dependencies = [ "anyhow", "async-trait", "atty", - "cid", + "cid 0.8.6", "const_format", "digest 0.10.6", "forest_encoding", @@ -4034,7 +4048,7 @@ dependencies = [ "anyhow", "blake2b_simd", "byteorder", - "cid", + "cid 0.8.6", "derive-getters", "derive_builder", "derive_more", @@ -4047,7 +4061,7 @@ dependencies = [ "fvm_shared", "lazy_static", "log", - "multihash", + "multihash 0.16.3", "num-derive", "num-traits", "num_cpus", @@ -4079,7 +4093,7 @@ checksum = "48d09e5aa7de45452676d18fcb70b750acd65faae7a4fe18fe784b4c85f869fb" dependencies = [ "ahash 0.7.6", "anyhow", - "cid", + "cid 0.8.6", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", "itertools 0.10.5", @@ -4094,7 +4108,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1950291f40d2d1047eb0a4568f7ef6d5b4973452dcef012dffb1957fe483ff7" dependencies = [ - "fvm_ipld_encoding 0.3.0", + "fvm_ipld_encoding 0.3.2", "serde", "thiserror", "unsigned-varint", @@ -4107,8 +4121,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688239a96199577f6705a3f9689abfd795f867f91f5847bc7e236017cc672df7" dependencies = [ "anyhow", - "cid", - "multihash", + "cid 0.8.6", + "multihash 0.16.3", ] [[package]] @@ -4117,7 +4131,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0af5e410b349533e8b1a2b46a7ca3d66cd68c53a477e2cf3d005845c1a346428" dependencies = [ - "cid", + "cid 0.8.6", "futures", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", @@ -4133,10 +4147,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa1ff5ba581625ab38cf2829fbd04ac232c6277466fdbe0270b42dcb976902d5" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "cs_serde_bytes", "fvm_ipld_blockstore", - "multihash", + "multihash 0.16.3", "serde", "serde_ipld_dagcbor", "serde_repr", @@ -4146,14 +4160,14 @@ dependencies = [ [[package]] name = "fvm_ipld_encoding" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf531c59e7c9a4c9044a34d1b44c9d544fab1eb0ba50aaa18121fe698d4fec35" +checksum = "189214585b1dc3c2a92682aa175cce1991c1a09542e5338c400d00c15b706142" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "fvm_ipld_blockstore", - "multihash", + "multihash 0.16.3", "serde", "serde_ipld_dagcbor", "serde_repr", @@ -4169,13 +4183,13 @@ checksum = "65b5c939897aa1bfd63e7cb9c458ba10689371af3278ff20d66c6f8ca152c6c0" dependencies = [ "anyhow", "byteorder", - "cid", + "cid 0.8.6", "cs_serde_bytes", "forest_hash_utils", "fvm_ipld_blockstore", "fvm_ipld_encoding 0.2.3", "libipld-core 0.13.1", - "multihash", + "multihash 0.16.3", "once_cell", "serde", "sha2 0.10.6", @@ -4188,7 +4202,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d6b29114b9cbdee7ccf7540bdda6657af7fa91666e2489c4d415a7f0706748" dependencies = [ - "cid", + "cid 0.8.6", "fvm_ipld_encoding 0.2.3", "fvm_shared", "lazy_static", @@ -4208,7 +4222,7 @@ dependencies = [ "blake2b_simd", "bls-signatures", "byteorder", - "cid", + "cid 0.8.6", "cs_serde_bytes", "data-encoding", "data-encoding-macro", @@ -4218,7 +4232,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "multihash", + "multihash 0.16.3", "num-bigint", "num-derive", "num-integer", @@ -4404,6 +4418,15 @@ dependencies = [ "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" +dependencies = [ + "ahash 0.8.2", +] + [[package]] name = "hdrhistogram" version = "7.5.2" @@ -4441,6 +4464,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -4748,9 +4780,9 @@ dependencies = [ [[package]] name = "interceptor" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffaa4d24f546a18eaeee91f7b2c52e080e20e285e43cd7c27a527b4712cfdad" +checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" dependencies = [ "async-trait", "bytes 1.3.0", @@ -4819,9 +4851,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" @@ -4905,9 +4937,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.138" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libipld" @@ -4922,13 +4954,27 @@ dependencies = [ "libipld-cbor-derive", "libipld-core 0.14.0", "libipld-json", - "libipld-macro", + "libipld-macro 0.14.0", "log", - "multihash", + "multihash 0.16.3", "parking_lot 0.12.1", "thiserror", ] +[[package]] +name = "libipld" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20e38e0ad9a2fd600476691fa0780421931a198279985e398a3a0851903e1b2" +dependencies = [ + "fnv", + "libipld-core 0.15.0", + "libipld-macro 0.15.0", + "log", + "multihash 0.17.0", + "thiserror", +] + [[package]] name = "libipld-cbor" version = "0.14.0" @@ -4960,10 +5006,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbdd758764f9680a818af33c31db733eb7c45224715d8816b9dcf0548c75f7c5" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "core2", "multibase", - "multihash", + "multihash 0.16.3", "serde", "thiserror", ] @@ -4975,14 +5021,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d44790246ec6b7314cba745992c23d479d018073e66d49ae40ae1b64e5dd8eb5" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "core2", "multibase", - "multihash", + "multihash 0.16.3", "serde", "thiserror", ] +[[package]] +name = "libipld-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a704ba3b25dee9e7a2361fae2c7c19defae2a92e69ae96ffb203996705cd7c" +dependencies = [ + "anyhow", + "cid 0.9.0", + "core2", + "multibase", + "multihash 0.17.0", + "thiserror", +] + [[package]] name = "libipld-json" version = "0.14.0" @@ -4990,7 +5050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18aa481a87f084d98473dd9ece253a9569c762b75f6bbba8217d54e48c9d63b3" dependencies = [ "libipld-core 0.14.0", - "multihash", + "multihash 0.16.3", "serde", "serde_json", ] @@ -5004,6 +5064,15 @@ dependencies = [ "libipld-core 0.14.0", ] +[[package]] +name = "libipld-macro" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c7ccd89e54f2796cf3f99aabeea7a7751d418df504926544f28348d3c890c7" +dependencies = [ + "libipld-core 0.15.0", +] + [[package]] name = "libloading" version = "0.7.4" @@ -5061,17 +5130,17 @@ dependencies = [ [[package]] name = "libp2p-bitswap" -version = "0.24.0" -source = "git+https://github.com/hanabi1224/libp2p-bitswap?branch=forest-libp2p@0.50#6f14bc98846abb4a7e1ee8739d199a55bcfcb441" +version = "0.25.0" +source = "git+https://github.com/ipfs-rust/libp2p-bitswap?rev=refs/pull/42/head#55ea687df0223acd97f81acc8992c9a97cf440eb" dependencies = [ "async-trait", "fnv", "futures", "lazy_static", - "libipld", + "libipld 0.15.0", "libp2p", "prometheus", - "prost 0.11.3", + "prost 0.11.5", "prost-build", "thiserror", "tracing", @@ -5094,12 +5163,12 @@ dependencies = [ "instant", "log", "multiaddr", - "multihash", + "multihash 0.16.3", "multistream-select", "once_cell", "parking_lot 0.12.1", "pin-project", - "prost 0.11.3", + "prost 0.11.5", "prost-build", "rand 0.8.5", "rw-stream-sink", @@ -5144,7 +5213,7 @@ dependencies = [ "libp2p-swarm", "log", "prometheus-client", - "prost 0.11.3", + "prost 0.11.5", "prost-build", "prost-codec", "rand 0.8.5", @@ -5158,9 +5227,9 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.41.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647d6a99f8d5b7366ee6bcc608ec186e2fb58b497cf914c8409b803bd0f594a2" +checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" dependencies = [ "asynchronous-codec", "futures", @@ -5168,8 +5237,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "lru", - "prost 0.11.3", + "lru 0.8.1", + "prost 0.11.5", "prost-build", "prost-codec", "smallvec", @@ -5179,9 +5248,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ee545eedf4f88502b2a4a2323405c3225d212d643212b0615856ca227fb9c3" +checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" dependencies = [ "arrayvec 0.7.2", "asynchronous-codec", @@ -5194,7 +5263,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.11.3", + "prost 0.11.5", "prost-build", "rand 0.8.5", "sha2 0.10.6", @@ -5270,7 +5339,7 @@ dependencies = [ "libp2p-core", "log", "once_cell", - "prost 0.11.3", + "prost 0.11.5", "prost-build", "rand 0.8.5", "sha2 0.10.6", @@ -5419,8 +5488,8 @@ dependencies = [ "libp2p-core", "libp2p-noise", "log", - "multihash", - "prost 0.11.3", + "multihash 0.16.3", + "prost 0.11.5", "prost-build", "prost-codec", "rand 0.8.5", @@ -5523,9 +5592,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] @@ -5587,6 +5656,15 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "lru" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.1", +] + [[package]] name = "lru-cache" version = "0.1.2" @@ -5819,7 +5897,7 @@ dependencies = [ "byteorder", "data-encoding", "multibase", - "multihash", + "multihash 0.16.3", "percent-encoding", "serde", "static_assertions", @@ -5858,6 +5936,17 @@ dependencies = [ "unsigned-varint", ] +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "multihash-derive", + "unsigned-varint", +] + [[package]] name = "multihash-derive" version = "0.8.1" @@ -6067,9 +6156,9 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "nom" -version = "7.1.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" dependencies = [ "memchr", "minimal-lexical", @@ -6185,11 +6274,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] @@ -6234,9 +6323,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "opaque-debug" @@ -6449,9 +6538,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "pathdiff" @@ -6641,9 +6730,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "2.1.4" +version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54fc5dc63ed3bbf19494623db4f3af16842c0d975818e469022d09e53f0aa05" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "itertools 0.10.5", @@ -6680,9 +6769,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51" +checksum = "2c8992a85d8e93a28bdf76137db888d3874e3b230dee5ed8bebac4c9f7617773" dependencies = [ "proc-macro2", "syn", @@ -6724,15 +6813,15 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.19" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] @@ -6747,7 +6836,7 @@ dependencies = [ "byteorder", "hex", "lazy_static", - "rustix 0.36.5", + "rustix 0.36.6", ] [[package]] @@ -6802,19 +6891,19 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b18e655c21ff5ac2084a5ad0611e827b3f92badf79f4910b5a5c58f4d87ff0" +checksum = "c01db6702aa05baa3f57dec92b8eeeeb4cb19e894e73996b32a4093289e54592" dependencies = [ "bytes 1.3.0", - "prost-derive 0.11.2", + "prost-derive 0.11.5", ] [[package]] name = "prost-build" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276470f7f281b0ed53d2ae42dd52b4a8d08853a3c70e7fe95882acbb98a6ae94" +checksum = "cb5320c680de74ba083512704acb90fe00f28f79207286a848e730c45dd73ed6" dependencies = [ "bytes 1.3.0", "heck 0.4.0", @@ -6824,8 +6913,8 @@ dependencies = [ "multimap", "petgraph", "prettyplease", - "prost 0.11.3", - "prost-types 0.11.2", + "prost 0.11.5", + "prost-types 0.11.5", "regex", "syn", "tempfile", @@ -6840,7 +6929,7 @@ checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" dependencies = [ "asynchronous-codec", "bytes 1.3.0", - "prost 0.11.3", + "prost 0.11.5", "thiserror", "unsigned-varint", ] @@ -6860,9 +6949,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" +checksum = "c8842bad1a5419bca14eac663ba798f6bc19c413c2fdceb5f3ba3b0932d96720" dependencies = [ "anyhow", "itertools 0.10.5", @@ -6883,12 +6972,12 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" +checksum = "017f79637768cde62820bc2d4fe0e45daaa027755c323ad077767c6c5f173091" dependencies = [ "bytes 1.3.0", - "prost 0.11.3", + "prost 0.11.5", ] [[package]] @@ -6954,9 +7043,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -7303,9 +7392,9 @@ dependencies = [ [[package]] name = "rtcp" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11171e7e37998dcf54a9e9d4a6e2e1932c994424c7d39bc6349fed1424c45c3" +checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" dependencies = [ "bytes 1.3.0", "thiserror", @@ -7468,9 +7557,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.5" +version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ "bitflags", "errno", @@ -7528,9 +7617,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "rw-stream-sink" @@ -7545,9 +7634,9 @@ dependencies = [ [[package]] name = "rxml" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c4cd1e0a04c48f953473383a60143884515b7a8eb7ca7d9b1baa9c05dee75" +checksum = "1a071866b8c681dc2cfffa77184adc32b57b0caad4e620b6292609703bceb804" dependencies = [ "bytes 1.3.0", "pin-project-lite", @@ -7558,15 +7647,15 @@ dependencies = [ [[package]] name = "rxml_validation" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8633dff4bb93061867c8411c6e99068c5f59d9f890c87384169004b0fbb929a" +checksum = "53bc79743f9a66c2fb1f951cd83735f275d46bfe466259fbc5897bb60a0d00ee" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safe_arch" @@ -7604,9 +7693,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "sct" @@ -7679,15 +7768,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" [[package]] name = "serde" -version = "1.0.150" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] @@ -7715,18 +7804,18 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" +checksum = "718dc5fff5b36f99093fc49b280cfc96ce6fc824317783bff5a1fed0c7a64819" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.150" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -7740,16 +7829,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1e23de7a4a18dff77ab9531f279a882500b8cf3549fde044d4e10481b411f1e" dependencies = [ "cbor4ii", - "cid", + "cid 0.8.6", "scopeguard", "serde", ] [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -7758,18 +7847,18 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184c643044780f7ceb59104cef98a5a6f12cb2288a7bc701ab93a362b49fd47d" +checksum = "26b04f22b563c91331a10074bda3dd5492e3cc39d56bd557e91c0af42b6c7341" dependencies = [ "serde", ] [[package]] name = "serde_repr" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" dependencies = [ "proc-macro2", "quote", @@ -7843,7 +7932,7 @@ version = "0.1.0" dependencies = [ "base64", "bls-signatures", - "cid", + "cid 0.8.6", "forest_blocks", "forest_encoding", "forest_json", @@ -8354,9 +8443,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -8446,16 +8535,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "termtree" version = "0.4.0" @@ -8473,18 +8552,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -8687,8 +8766,8 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.11.3", - "prost-derive 0.11.2", + "prost 0.11.5", + "prost-derive 0.11.5", "tokio", "tokio-stream", "tokio-util", @@ -8997,9 +9076,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" diff --git a/Cargo.toml b/Cargo.toml index 75a0a1a692aa..6b86b201d973 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,12 +100,13 @@ libipld = { version = "0.14", default-features = false, features = ["dag-cbor", libipld-core = "0.14" libipld-macro = "0.14" libp2p = { version = "0.50", default-features = false } -libp2p-bitswap.branch = "forest-libp2p@0.50" -libp2p-bitswap.features = ["compat"] -libp2p-bitswap.git = "https://github.com/hanabi1224/libp2p-bitswap" +# FIXME: use `crate.io` version once changes are merged and released +libp2p-bitswap = { git = "https://github.com/ipfs-rust/libp2p-bitswap", rev = "refs/pull/42/head", features = [ + "compat", +] } libsecp256k1 = "0.7" log = "0.4" -lru = "0.8" +lru = "0.9" multibase = "0.9" multihash = "0.16" nonempty = "0.8.0" diff --git a/node/db/Cargo.toml b/node/db/Cargo.toml index aab778b3d968..3649d030c219 100644 --- a/node/db/Cargo.toml +++ b/node/db/Cargo.toml @@ -37,4 +37,6 @@ serde = { workspace = true, features = ["derive"] } thiserror.workspace = true [dev-dependencies] +multihash.workspace = true +rand.workspace = true tempfile.workspace = true diff --git a/node/db/src/lib.rs b/node/db/src/lib.rs index 93c77dcf812e..a9076560ff48 100644 --- a/node/db/src/lib.rs +++ b/node/db/src/lib.rs @@ -134,3 +134,45 @@ pub trait DBStatistics { None } } + +// FIXME: We should propose `cid@0.9` upgrade to `fvm_ipld_blockstore` to match `libp2p_bitswap` +/// Temporary workaround for `cid` version mismatch in upstream `libp2p_bitswap` and `fvm_ipld_blockstore` crates +pub(crate) trait CidCompat { + fn compat(&self) -> libipld::Cid; +} + +impl CidCompat for libp2p_bitswap::libipld::Cid { + fn compat(&self) -> libipld::Cid { + libipld::Cid::read_bytes(self.to_bytes().as_slice()).expect("Infallible") + } +} + +/// Temporary workaround for `cid` version mismatch in upstream `libp2p_bitswap` and `fvm_ipld_blockstore` crates +pub trait CidCompatBitswap { + fn compat(&self) -> libp2p_bitswap::libipld::Cid; +} + +impl CidCompatBitswap for libipld::Cid { + fn compat(&self) -> libp2p_bitswap::libipld::Cid { + libp2p_bitswap::libipld::Cid::read_bytes(self.to_bytes().as_slice()).expect("Infallible") + } +} + +#[cfg(test)] +mod tests { + use super::*; + use multihash::MultihashDigest; + use rand::{rngs::OsRng, RngCore}; + + #[test] + fn test_cid_compat_roundtrip() { + const DAG_CBOR: u64 = 0x71; + + let mut bytes = [0; 1024]; + OsRng.fill_bytes(&mut bytes); + let cid = libipld::Cid::new_v1(DAG_CBOR, multihash::Code::Blake2b256.digest(&bytes)); + + assert_eq!(cid.to_string(), cid.compat().to_string()); + assert_eq!(cid.compat().to_string(), cid.compat().compat().to_string()); + } +} diff --git a/node/db/src/memory.rs b/node/db/src/memory.rs index d4056b417bee..d95204e9f7a4 100644 --- a/node/db/src/memory.rs +++ b/node/db/src/memory.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0, MIT use crate::utils::bitswap_missing_blocks; +use crate::CidCompat; use super::{Error, Store}; use anyhow::Result; @@ -76,21 +77,24 @@ impl Blockstore for MemoryDB { } impl BitswapStore for MemoryDB { - type Params = libipld::DefaultParams; + type Params = libp2p_bitswap::libipld::DefaultParams; - fn contains(&mut self, cid: &Cid) -> Result { + fn contains(&mut self, cid: &libp2p_bitswap::libipld::Cid) -> Result { Ok(self.exists(cid.to_bytes())?) } - fn get(&mut self, cid: &Cid) -> Result>> { - Blockstore::get(self, cid) + fn get(&mut self, cid: &libp2p_bitswap::libipld::Cid) -> Result>> { + Blockstore::get(self, &cid.compat()) } - fn insert(&mut self, block: &libipld::Block) -> Result<()> { - self.put_keyed(block.cid(), block.data()) + fn insert(&mut self, block: &libp2p_bitswap::libipld::Block) -> Result<()> { + self.put_keyed(&block.cid().compat(), block.data()) } - fn missing_blocks(&mut self, cid: &Cid) -> Result> { + fn missing_blocks( + &mut self, + cid: &libp2p_bitswap::libipld::Cid, + ) -> Result> { bitswap_missing_blocks::<_, Self::Params>(self, cid) } } diff --git a/node/db/src/parity_db.rs b/node/db/src/parity_db.rs index 3b96893fd1f1..a26144f8be54 100644 --- a/node/db/src/parity_db.rs +++ b/node/db/src/parity_db.rs @@ -4,7 +4,7 @@ use super::errors::Error; use crate::parity_db_config::ParityDbConfig; use crate::utils::bitswap_missing_blocks; -use crate::{DBStatistics, Store}; +use crate::{CidCompat, DBStatistics, Store}; use anyhow::anyhow; use cid::Cid; use fvm_ipld_blockstore::Blockstore; @@ -132,21 +132,27 @@ impl Blockstore for ParityDb { impl BitswapStore for ParityDb { /// `fvm_ipld_encoding::DAG_CBOR(0x71)` is covered by [`libipld::DefaultParams`] /// under feature `dag-cbor` - type Params = libipld::DefaultParams; + type Params = libp2p_bitswap::libipld::DefaultParams; - fn contains(&mut self, cid: &Cid) -> anyhow::Result { + fn contains(&mut self, cid: &libp2p_bitswap::libipld::Cid) -> anyhow::Result { Ok(self.exists(cid.to_bytes())?) } - fn get(&mut self, cid: &Cid) -> anyhow::Result>> { - Blockstore::get(self, cid) + fn get(&mut self, cid: &libp2p_bitswap::libipld::Cid) -> anyhow::Result>> { + Blockstore::get(self, &cid.compat()) } - fn insert(&mut self, block: &libipld::Block) -> anyhow::Result<()> { - self.put_keyed(block.cid(), block.data()) + fn insert( + &mut self, + block: &libp2p_bitswap::libipld::Block, + ) -> anyhow::Result<()> { + self.put_keyed(&block.cid().compat(), block.data()) } - fn missing_blocks(&mut self, cid: &Cid) -> anyhow::Result> { + fn missing_blocks( + &mut self, + cid: &libp2p_bitswap::libipld::Cid, + ) -> anyhow::Result> { bitswap_missing_blocks::<_, Self::Params>(self, cid) } } diff --git a/node/db/src/rocks.rs b/node/db/src/rocks.rs index c81bc01ca1e8..f964c7ad9070 100644 --- a/node/db/src/rocks.rs +++ b/node/db/src/rocks.rs @@ -4,6 +4,7 @@ use super::errors::Error; use super::Store; use crate::rocks_config::RocksDbConfig; +use crate::CidCompat; use crate::{metrics, utils::bitswap_missing_blocks, DBStatistics}; use anyhow::anyhow; use cid::Cid; @@ -300,21 +301,27 @@ impl Blockstore for RocksDb { impl BitswapStore for RocksDb { /// `fvm_ipld_encoding::DAG_CBOR(0x71)` is covered by [`libipld::DefaultParams`] /// under feature `dag-cbor` - type Params = libipld::DefaultParams; + type Params = libp2p_bitswap::libipld::DefaultParams; - fn contains(&mut self, cid: &Cid) -> anyhow::Result { + fn contains(&mut self, cid: &libp2p_bitswap::libipld::Cid) -> anyhow::Result { Ok(self.exists(cid.to_bytes())?) } - fn get(&mut self, cid: &Cid) -> anyhow::Result>> { - Blockstore::get(self, cid) + fn get(&mut self, cid: &libp2p_bitswap::libipld::Cid) -> anyhow::Result>> { + Blockstore::get(self, &cid.compat()) } - fn insert(&mut self, block: &libipld::Block) -> anyhow::Result<()> { - self.put_keyed(block.cid(), block.data()) + fn insert( + &mut self, + block: &libp2p_bitswap::libipld::Block, + ) -> anyhow::Result<()> { + self.put_keyed(&block.cid().compat(), block.data()) } - fn missing_blocks(&mut self, cid: &Cid) -> anyhow::Result> { + fn missing_blocks( + &mut self, + cid: &libp2p_bitswap::libipld::Cid, + ) -> anyhow::Result> { bitswap_missing_blocks::<_, Self::Params>(self, cid) } } diff --git a/node/db/src/utils.rs b/node/db/src/utils.rs index ab9307885fe0..a630ddb0d5e9 100644 --- a/node/db/src/utils.rs +++ b/node/db/src/utils.rs @@ -1,9 +1,9 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use cid::Cid; +use crate::*; use fvm_ipld_blockstore::Blockstore; -use libipld::{prelude::*, store::StoreParams, Ipld}; +use libp2p_bitswap::libipld::{prelude::*, store::StoreParams, Block, Cid, Ipld}; pub(super) fn bitswap_missing_blocks( bs: &mut BS, @@ -15,8 +15,8 @@ where let mut stack = vec![*cid]; let mut missing = vec![]; while let Some(cid) = stack.pop() { - if let Some(data) = bs.get(&cid)? { - let block = libipld::Block::

::new_unchecked(cid, data); + if let Some(data) = bs.get(&cid.compat())? { + let block = Block::

::new_unchecked(cid, data); block.references(&mut stack)?; } else { missing.push(cid); diff --git a/node/forest_libp2p/src/behaviour.rs b/node/forest_libp2p/src/behaviour.rs index 03393fd98bf3..fc80848a8ace 100644 --- a/node/forest_libp2p/src/behaviour.rs +++ b/node/forest_libp2p/src/behaviour.rs @@ -11,8 +11,8 @@ use crate::{ hello::{HelloCodec, HelloProtocolName}, }; use cid::Cid; +use forest_db::CidCompatBitswap; use forest_encoding::blake2b_256; -use libipld::store::StoreParams; use libp2p::swarm::NetworkBehaviour; use libp2p::{core::identity::Keypair, kad::QueryId}; use libp2p::{core::PeerId, gossipsub::GossipsubMessage}; @@ -28,6 +28,7 @@ use libp2p::{ metrics::{Metrics, Recorder}, request_response::{ProtocolSupport, RequestResponse, RequestResponseConfig}, }; +use libp2p_bitswap::libipld::store::StoreParams; use libp2p_bitswap::{Bitswap, BitswapConfig, BitswapStore}; use log::{debug, warn}; use std::collections::{HashMap, HashSet}; @@ -88,7 +89,13 @@ impl ForestBehaviour

{ ) .unwrap(); - let bitswap = Bitswap::new(BitswapConfig::new(), db); + let bitswap = Bitswap::new( + BitswapConfig { + compat_protocol_name: b"/chain/ipfs/bitswap/1.2.0", + ..Default::default() + }, + db, + ); if let Err(err) = bitswap.register_metrics(prometheus::default_registry()) { warn!("Fail to register prometheus metrics for libp2p_bitswap: {err}"); } @@ -155,7 +162,9 @@ impl ForestBehaviour

{ pub fn want_block(&mut self, cid: Cid) -> anyhow::Result { debug!("want {}", cid.to_string()); let peers = self.discovery.peers().iter().cloned().collect(); - let query_id = self.bitswap.sync(cid, peers, [cid].into_iter()); + let query_id = self + .bitswap + .sync(cid.compat(), peers, [cid.compat()].into_iter()); Ok(query_id) } } diff --git a/node/forest_libp2p/src/service.rs b/node/forest_libp2p/src/service.rs index b0dd58066001..fa0af5780b7c 100644 --- a/node/forest_libp2p/src/service.rs +++ b/node/forest_libp2p/src/service.rs @@ -22,7 +22,6 @@ use futures::select; use futures_util::stream::StreamExt; use fvm_ipld_blockstore::Blockstore; use fvm_ipld_encoding::from_slice; -use libipld::store::StoreParams; use libp2p::gossipsub::GossipsubEvent; pub use libp2p::gossipsub::IdentTopic; pub use libp2p::gossipsub::Topic; @@ -43,6 +42,7 @@ use libp2p::{ yamux, PeerId, Swarm, Transport, }; use libp2p::{core::Multiaddr, swarm::SwarmBuilder}; +use libp2p_bitswap::libipld::store::StoreParams; use libp2p_bitswap::{BitswapEvent, BitswapStore}; use log::{debug, error, info, trace, warn}; use std::collections::HashMap;