2018-03-15 15:18:21 +01:00
|
|
|
[package]
|
|
|
|
name = "libp2p-kad"
|
2021-11-26 09:34:58 -07:00
|
|
|
edition = "2021"
|
2022-12-23 03:17:59 +11:00
|
|
|
rust-version = "1.65.0"
|
2018-12-06 19:22:06 +01:00
|
|
|
description = "Kademlia protocol for libp2p"
|
2022-12-12 12:30:23 +01:00
|
|
|
version = "0.43.0"
|
2018-03-15 15:18:21 +01:00
|
|
|
authors = ["Parity Technologies <admin@parity.io>"]
|
2018-07-21 12:15:42 +02:00
|
|
|
license = "MIT"
|
2018-12-06 19:22:06 +01:00
|
|
|
repository = "https://github.com/libp2p/rust-libp2p"
|
|
|
|
keywords = ["peer-to-peer", "libp2p", "networking"]
|
|
|
|
categories = ["network-programming", "asynchronous"]
|
2018-03-15 15:18:21 +01:00
|
|
|
|
|
|
|
[dependencies]
|
2022-05-16 18:52:19 +02:00
|
|
|
arrayvec = "0.7.2"
|
2021-01-12 12:48:37 +01:00
|
|
|
bytes = "1"
|
2019-07-03 16:16:25 +02:00
|
|
|
either = "1.5"
|
2018-03-15 15:18:21 +01:00
|
|
|
fnv = "1.0"
|
2021-02-13 20:15:14 +01:00
|
|
|
asynchronous-codec = "0.6"
|
2023-01-31 23:34:17 +00:00
|
|
|
futures = "0.3.26"
|
Kademlia: Somewhat complete the records implementation. (#1189)
* Somewhat complete the implementation of Kademlia records.
This commit relates to [libp2p-146] and [libp2p-1089].
* All records expire (by default, configurable).
* Provider records are also stored in the RecordStore, and the RecordStore
API extended.
* Background jobs for periodic (re-)replication and (re-)publication
of records. Regular (value-)records are subject to re-replication and
re-publication as per standard Kademlia. Provider records are only
subject to re-publication.
* For standard Kademlia value lookups (quorum = 1), the record is cached
at the closest peer to the key that did not return the value, as per
standard Kademlia.
* Expiration times of regular (value-)records is computed exponentially
inversely proportional to the number of nodes between the local node
and the closest node known to the key (beyond the k closest), as per
standard Kademlia.
The protobuf messages are extended with two fields: `ttl` and `publisher`
in order to implement the different semantics of re-replication (by any
of the k closest peers to the key, not affecting expiry) and re-publication
(by the original publisher, resetting the expiry). This is not done yet in
other libp2p Kademlia implementations, see e.g. [libp2p-go-323]. The new protobuf fields
have been given somewhat unique identifiers to prevent future collision.
Similarly, periodic re-publication of provider records does not seem to
be done yet in other implementations, see e.g. [libp2p-js-98].
[libp2p-146]: https://github.com/libp2p/rust-libp2p/issues/146
[libp2p-1089]: https://github.com/libp2p/rust-libp2p/issues/1089
[libp2p-go-323]: https://github.com/libp2p/go-libp2p-kad-dht/issues/323
[libp2p-js-98]: https://github.com/libp2p/js-libp2p-kad-dht/issues/98
* Tweak kad-ipfs example.
* Add missing files.
* Ensure new delays are polled immediately.
To ensure task notification, since `NotReady` is returned right after.
* Fix ipfs-kad example and use wasm_timer.
* Small cleanup.
* Incorporate some feedback.
* Adjustments after rebase.
* Distinguish events further.
In order for a user to easily distinguish the result of e.g.
a `put_record` operation from the result of a later republication,
different event constructors are used. Furthermore, for now,
re-replication and "caching" of records (at the closest peer to
the key that did not return a value during a successful lookup)
do not yield events for now as they are less interesting.
* Speed up tests for CI.
* Small refinements and more documentation.
* Guard a node against overriding records for which it considers
itself to be the publisher.
* Document the jobs module more extensively.
* More inline docs around removal of "unreachable" addresses.
* Remove wildcard re-exports.
* Use NonZeroUsize for the constants.
* Re-add method lost on merge.
* Add missing 'pub'.
* Further increase the timeout in the ipfs-kad example.
* Readd log dependency to libp2p-kad.
* Simplify RecordStore API slightly.
* Some more commentary.
* Change Addresses::remove to return Result<(),()>.
Change the semantics of `Addresses::remove` so that the error case
is unambiguous, instead of the success case. Use the `Result` for
clearer semantics to that effect.
* Add some documentation to .
2019-07-17 14:40:48 +02:00
|
|
|
log = "0.4"
|
2022-12-20 09:52:08 +01:00
|
|
|
libp2p-core = { version = "0.39.0", path = "../../core" }
|
2022-12-09 15:44:08 +01:00
|
|
|
libp2p-swarm = { version = "0.42.0", path = "../../swarm" }
|
2022-08-16 08:49:09 +02:00
|
|
|
prost = "0.11"
|
2022-09-22 12:48:32 +04:00
|
|
|
rand = "0.8"
|
2021-12-08 15:07:29 +01:00
|
|
|
sha2 = "0.10.0"
|
2021-03-15 12:31:21 +01:00
|
|
|
smallvec = "1.6.1"
|
2021-01-12 13:53:51 +01:00
|
|
|
uint = "0.9"
|
2021-02-13 20:15:14 +01:00
|
|
|
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
2018-11-29 12:11:35 +01:00
|
|
|
void = "1.0"
|
2021-10-30 12:41:30 +02:00
|
|
|
futures-timer = "3.0.2"
|
|
|
|
instant = "0.1.11"
|
2022-09-08 11:30:43 +03:00
|
|
|
serde = { version = "1.0", optional = true, features = ["derive"] }
|
2022-01-06 20:54:01 -05:00
|
|
|
thiserror = "1"
|
2018-03-15 15:18:21 +01:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2022-12-02 18:06:09 +01:00
|
|
|
env_logger = "0.10.0"
|
2020-06-19 12:22:26 +02:00
|
|
|
futures-timer = "3.0"
|
2022-12-13 07:58:01 +11:00
|
|
|
libp2p-noise = { path = "../../transports/noise" }
|
|
|
|
libp2p-yamux = { path = "../../muxers/yamux" }
|
2022-09-22 12:48:32 +04:00
|
|
|
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
2020-01-15 12:02:02 +01:00
|
|
|
|
|
|
|
[build-dependencies]
|
2022-08-16 08:49:09 +02:00
|
|
|
prost-build = "0.11"
|
2022-01-11 15:38:51 -05:00
|
|
|
|
|
|
|
[features]
|
2022-09-08 11:30:43 +03:00
|
|
|
serde = ["dep:serde", "bytes/serde"]
|
2022-10-24 04:00:20 +02:00
|
|
|
|
2022-12-09 15:44:08 +01:00
|
|
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
2022-10-24 04:00:20 +02:00
|
|
|
# More information: https://docs.rs/about/builds#cross-compiling
|
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
rustc-args = ["--cfg", "docsrs"]
|