All notable changes to mainline dht will be documented in this file.
5.0.0 - 2025-02-11
- Add
Id::from_ipv4()
. - Add
Id::is_valid_for_ipv4
. - Add
RoutingTable::nodes()
iterator. - Add
DhtBuilder::server_mode
to force server mode. - Add
DhtBuilder::public_ip
for manually setting the node's public ip to generate secure nodeId
from. - Add adaptive mode.
- Add
DhtBuilder::extra_bootstrap()
to add more bootstrapping nodes from previous sessions. - Add
Dht::bootstrapped()
andAsyncDht::bootstrapped()
to wait for the routing table to be bootstrapped. - Add
RoutingTable::to_bootstrap()
,Dht::to_bootstrap()
, andAsyncDht::to_bootstrap()
to export the addresses nodes in the routing table. - Add
Info::public_address()
which returns the best estimate for this node's public address. - Add
Info::firewalled()
which returns whether or not this node is firewalled, or publicly accessible. - Add
Info::server_mode()
which returns whether or not this node is running in server mode. - Add
DhtBuilder::info()
to export a thread safe and lightweight summary of the node's information and statistics. - Add
cache_bootstrap.rs
example to show how you can store your routing table to disk and use it for subsequent bootstrapping. - Add
Dht::get_mutable_most_recent()
andAsyncDht::get_mutable_most_recent()
to get the most recent mutable item from the network. - Add
PutQueryError::Timeout
in case put query is terminated unsuccessfully, but no error responses. - Add
PutMutableError::Concurrrency(ConcurrrencyError)
for all cases where aLost Update Problem
may occur (readDht::put_mutable
documentation for more details). - Add
Dht::get_closest_nodes()
andAsyncDht::get_closest_nodes()
to return the closest nodes (that support BEP_0044) with valid tokens. - Add
Dht::put()
andAsyncDht::put()
to put a request to the closest nodes, and optionally to extra arbitrary nodes with valid tokens. - Add
Testnet::leak()
to keep the dht network running as a'static
- Add
MutableError
. - Add
DecodeIdError
- Export
Dhtbuilder
. - Export
RoutingTable
. - Support
BEP_0042 DHT Security extension
when running in server mode.
- Remove
bytes
dependency. - Remove
ipv6
optionality and commit toipv4
. - Remove
Id::to_vec()
. - Exported
ClosestNodes
, you have to use it frommainline::rpc
. - Removed
Node::unique()
,Node::with_id()
,Node::with_address()
, andNode::with_token()
. - Removed
RoutingTable::default()
. - Removed exporting
rpc
module, andRpc
struct. - Removed
Dht::shutdown()
andAsyncDht::shutdown()
. - Removed
DhtWasShutdown
- Removed
DefaultServer
export.
- Rename
Settings
toClientBuilder
. Dht
, andAsyncDht
is now behind a feature flagnode
, so you can include theRpc
only and build your own node.- All methods that were returning
Result<T, DhtWasShutdown>
now returnT
. - Enable calling
Dht::announce_peer()
andDht::put_immutable()
multiple times concurrently. - Return
PutMutableError::Concurrrency(ConcurrrencyError)
fromDht::put_mutable()
. Info::local_addr()
is infallible.MutableItem::seq()
returnsi64
instead of a reference.Dht::put_immutable()
andAsyncDh::put_immutable()
take&[u8]
instead ofbytes::Bytes
.Dht::get_immutable()
andAsyncDh::get_immutable()
return boxed sliceBox<[u8]>
instead ofbytes::Bytes
.Dht::put_immutable()
andAsyncDh::put_immutable()
returnPutImmutableError
.Dht::announce_peer()
andAsyncDh::announce_peer()
returnAnnouncePeerError
.Dht::put_mutable()
andAsyncDh::put_mutable()
returnPutMutableError
.- All tracing logs are either
TRACE
(for krpcsocket),DEBUG
, orINFO
only for rare and singular events, like starting the node, updating the node Id, or switching to server mode (from adaptive mode). - Change
PutError
to contain transparent elements for genericPutQueryError
, and more specializedConcurrrencyError
. - Remove
MutableItem::cas
field, and add optionalCAS
parameter toDht::put_mutable
andAsyncDht::put_mutable
. Dht::find_node()
andAsyncDht::find_node()
returnBox<[Node]>
instead ofVec<Node>
.Node
isSend
andSync
, and cheap to clone using an internalArc
.Node::new()
takeId
andSocketAddrV4
.RoutingTable::new()
takes anId
.- Return
GetIterator<T>
andGetStream<T>
fromget_
methods fromDht
andAsyncDht
instead of exposingflume
. - Remove
Server
trait and replace it withRequestFilter
trait. DhtBuilder
is not consuming, thanks toConfig
beingClone
.
4.2.0 - 2024-12-13
- Make MutableItem de/serializable (mikedilger)
4.1.0 - 2024-11-29
- Export
errors
module containingPutError
as a part of the response ofRpc::put
. Dht::find_node()
andAsyncDht::find_node()
to find the closest nodes to a certain target.Dht::info()
andAsyncDht::info()
some internal information about the node from one method.Info::dht_size_estimate
to get the ongoing dht size estimate resulting from watching results of all queries.Info::id
to get the Id of the node.measure_dht
example to estimate the DHT size.
- Removed all internal panic
#![deny(clippy::unwrap_used)]
. Testnet::new(size)
returns aResult<Testnet>
.Dht::local_addr()
andAsyncDht::local_addr()
replaced with::info()
.Dht::shutdown()
andAsyncDht::shutdown()
are now idempotent, and returns()
.Rpc::drop
usestracing::debug!()
to log dropping the Rpc.Id::as_bytes()
instead of exposing internalbytes
property.- Replace crate
Error
with more granular errors. - Replace Flume's
RecvError
withexpect()
message, since the sender should never be dropped to soon. DhtWasShutdown
error is a standalone error.InvalidIdSize
error is a standalone error.- Rename
DhtSettings
toSettings
- Rename
DhtServer
toDefaultServer
Dht::get_immutable()
andAsyncDht::get_immutable()
returnResult<Option<bytes::Bytes>, DhtWasShutdown>
Node
fields are now all private, withid()
andaddress()
getters.- Changed
Settings
to be a the Builder, and make fields private. - Replaced
Rpc::new()
withSettings::build_rpc()
. - Update the client version from
RS01
toRS04
- Removed
mainline::error::Error
andmainline::error::Result
.