[0.8.0] - 2024-11-04
This release adds support for content provider advertisement and discovery to Kademlia protocol implementation (see libp2p spec).
Additionally, the release includes several improvements and memory leak fixes to enhance the stability and performance of the litep2p library.
Content Provider Advertisement and Discovery
Litep2p now supports content provider advertisement and discovery through the Kademlia protocol.
Content providers can publish their records to the network, and other nodes can discover and retrieve these records using the GET_PROVIDERS
query.
// Start providing a record to the network.
// This stores the record in the local provider store and starts advertising it to the network.
kad_handle.start_providing(key.clone());
// Wait for some condition to stop providing...
// Stop providing a record to the network.
// The record is removed from the local provider store and stops advertising it to the network.
// Please note that the record will be removed from the network after the TTL expires.
kad_provider.stop_providing(key.clone());
// Retrieve providers for a record from the network.
// This returns a query ID that is later producing the result when polling the `Kademlia` instance.
let query_id = kad_provider.get_providers(key.clone());
Added
- kad: Providers part 8: unit, e2e, and
libp2p
conformance tests (#258) - kad: Providers part 7: better types and public API, public addresses & known providers (#246)
- kad: Providers part 6: stop providing (#245)
- kad: Providers part 5:
GET_PROVIDERS
query (#236) - kad: Providers part 4: refresh local providers (#235)
- kad: Providers part 3: publish provider records (start providing) (#234)
Changed
- transport_service: Improve connection stability by downgrading connections on substream inactivity (#260)
- transport: Abort canceled dial attempts for TCP, WebSocket and Quic (#255)
- kad/executor: Add timeout for writting frames (#277)
- kad: Avoid cloning the
KademliaMessage
and use reference forRoutingTable::closest
(#233) - peer_state: Robust state machine transitions (#251)
- address_store: Improve address tracking and add eviction algorithm (#250)
- kad: Remove unused serde cfg (#262)
- req-resp: Refactor to move functionality to dedicated methods (#244)
- transport_service: Improve logs and move code from tokio::select macro (#254)