- Removed the
topology
module and everything it contained, including theTopology
trait. - Added
libp2p-noise
that supports Noise handshakes, as an alternative tolibp2p-secio
. - Updated
ring
to version 0.14. - Creating a
Swarm
now expects thePeerId
of the local node, instead of aTopology
. - Added
NetworkBehaviour::addresses_of_peer
that returns the addresses aNetworkBehaviour
knows about a given peer. This exists as a replacement for the topology. - The
Kademlia
andMdns
behaviours now report and store the list of addresses they discover. - You must now call
Floodsub::add_node_to_partial_view()
andFloodsub::remove_node_from_partial_view
to add/remove nodes from the list of nodes that floodsub must send messages to. - Added
NetworkBehaviour::inject_dial_failure
that is called when we fail to dial an address. ProtocolsHandler::connection_keep_alive()
now returns aKeepAlive
enum that provides more fine grained control.- The
NodeHandlerWrapper
no longer has a 5 seconds inactivity timeout. This is now handled entirely byProtocolsHandler::connection_keep_alive()
. - Now properly denying connections incoming from the same
PeerId
as ours. - Added a
SwarmBuilder
. Theincoming_limit
method lets you configure the number of simultaneous incoming connections. - Removed
FloodsubHandler
,PingListenHandler
andPeriodicPingHandler
. - The structs in
core::nodes
are now generic over thePeerId
. - Added
SecioKeypair::ed25519_raw_key()
. - Fix improper connection shutdown in
ProtocolsHandler
.
- Fixed improper dependencies versions causing deriving
NetworkBehaviour
to generate an error.
- Added the
IntoNodeHandler
andIntoProtocolsHandler
traits, allowing node handlers and protocol handlers to know thePeerId
of the node they are interacting with.
- The
Transport
trait now has anError
associated type instead of always usingstd::io::Error
. - Merged
PeriodicPing
andPingListen
into onePing
behaviour. Floodsub
now generatesFloodsubEvent
s instead of direct floodsub messages.- Added
ProtocolsHandler::connection_keep_alive
. If all the handlers returnfalse
, then the connection to the remote node will automatically be gracefully closed after a few seconds. - The crate now successfuly compiles for the
wasm32-unknown-unknown
target. - Updated
ring
to version 0.13. - Updated
secp256k1
to version 0.12. - The enum returned by
RawSwarm::peer()
can now returnLocalNode
. This makes it impossible to accidentally attempt to dial the local node. - Removed
Transport::map_err_dial
. - Removed the
Result
from some connection-related methods in theRawSwarm
, as they could never error. - If a node doesn't respond to pings, we now generate an error on the connection instead of trying to gracefully close it.