-
Introduce
StreamMuxerEvent::map_inbound_stream
. See PR 2691. -
Remove
{read,write,flush,shutdown,destroy}_substream
functions fromStreamMuxer
trait in favor of forcingStreamMuxer::Substream
to implementAsyncRead + AsyncWrite
. See PR 2707. -
Replace
Into<std::io::Error>
bound onStreamMuxer::Error
withstd::error::Error
. See PR 2710. -
Remove the concept of individual
Transport::Listener
streams fromTransport
. Instead theTransport
is polled directly viaTransport::poll
. TheTransport
is now responsible for driving its listeners. See PR 2652.
- Have methods on
Transport
take&mut self
instead ofself
. See PR 2529. - Remove
StreamMuxer::flush_all
. See PR 2669. - Rename
StreamMuxer::close
toStreamMuxer::poll_close
. See PR 2666. - Remove deprecated function
StreamMuxer::is_remote_acknowledged
. See PR 2665.
- Add
PeerId::try_from_multiaddr
to extract aPeerId
from aMultiaddr
that ends in/p2p/<peer-id>
.
-
Remove
Network
.libp2p-core
is from now on an auxiliary crate only. Users that have previously usedNetwork
only, will need to useSwarm
instead. See PR 2492. -
Update to
multiaddr
v0.14.0
. -
Update to
multihash
v0.16.0
. -
Implement
Display
onDialError
. See PR 2456. -
Update to
parking_lot
v0.12.0
. See PR 2463. -
Validate PeerRecord signature matching peer ID. See RUSTSEC-2022-0009.
-
Don't take ownership of key in
PeerRecord::new
andSignedEnvelope::new
. See PR 2516. -
Remove
SignedEnvelope::payload
in favor ofSignedEnvelope::payload_and_signing_key
. The caller is expected to check that the returned signing key makes sense in the payload's context. See PR 2522.
-
Update dependencies.
-
Report concrete connection IDs in
NetworkEvent::ConnectionEstablished
andNetworkEvent::ConnectionClosed
(see PR 2350). -
Migrate to Rust edition 2021 (see PR 2339).
-
Add support for ECDSA identities (see PR 2352).
-
Add
ConnectedPoint::is_relayed
(see PR 2392). -
Enable overriding dial concurrency factor per dial via
DialOpts::override_dial_concurrency_factor
.- Introduces
libp2p_core::DialOpts
mirroringlibp2p_swarm::DialOpts
. Passed as an argument toNetwork::dial
. - Removes
Peer::dial
in favor ofNetwork::dial
.
See PR 2404.
- Introduces
-
Implement
Serialize
andDeserialize
forPeerId
(see PR 2408) -
Report negotiated and expected
PeerId
as well as remote address inDialError::WrongPeerId
(see PR 2428). -
Allow overriding role when dialing. This option is needed for NAT and firewall hole punching.
-
Add
Transport::dial_as_listener
. AsTransport::dial
but overrides the role of the local node on the connection . I.e. has the local node act as a listener on the outgoing connection. -
Add
override_role
option toDialOpts
.
See PR 2363.
-
- Use
instant
instead ofwasm-timer
(see PR 2245).
-
Add
ConnectionLimit::with_max_established
(see PR 2137). -
Add
Keypair::to_protobuf_encoding
(see PR 2142). -
Change
PublicKey::into_protobuf_encoding
toPublicKey::to_protobuf_encoding
(see PR 2145). -
Change
PublicKey::into_peer_id
toPublicKey::to_peer_id
(see PR 2145). -
Change
PeerId::from_public_key(PublicKey)
toPeerId::from_public_key(&PublicKey)
(see PR 2145). -
Add
From<&PublicKey> for PeerId
(see PR 2145). -
Remove
TInEvent
andTOutEvent
trait paramters on most public types.TInEvent
andTOutEvent
are implied throughTHandler
and thus superflucious. Both are removed in favor of a derivation throughTHandler
(see PR 2183). -
Require
ConnectionHandler::{InEvent,OutEvent,Error}
to implementDebug
(see PR 2183). -
Remove
DisconnectedPeer::set_connected
andPool::add
(see PR 2195). -
Report
ConnectionLimit
error throughConnectionError
and thus throughNetworkEvent::ConnectionClosed
instead of previously throughPendingConnectionError
and thusNetworkEvent::{IncomingConnectionError, DialError}
(see PR 2191). -
Report abortion of pending connection through
DialError
,UnknownPeerDialError
orIncomingConnectionError
(see PR 2191). -
Remove deprecated functions
upgrade::write_one
,upgrade::write_with_len_prefix
andupgrade::read_one
(see PR 2213). -
Add
SignedEnvelope
andPeerRecord
according to RFC0002 and RFC0003 (see PR 2107). -
Report
ListenersEvent::Closed
when dropping a listener inListenersStream::remove_listener
, returnbool
instead ofResult<(), ()>
(see PR 2261). -
Concurrently dial address candidates within a single dial attempt (see PR 2248) configured via
Network::with_dial_concurrency_factor
.-
On success of a single address, provide errors of the thus far failed dials via
NetworkEvent::ConnectionEstablished::outgoing
. -
On failure of all addresses, provide the errors via
NetworkEvent::DialError
.
-
-
Switch from
parity-multiaddr
to upstreammultiaddr
. -
Update dependencies.
-
Implement
Keypair::from_protobuf_encoding
for ed25519 keys (see PR 2090). -
Deprecate
upgrade::write_one
. Deprecateupgrade::write_with_len_prefix
. Deprecateupgrade::read_one
. Introduceupgrade::read_length_prefixed
andupgrade::write_length_prefixed
. See PR 2111.
- Fix build with secp256k1 disabled PR 2057.
- Update dependencies.
- Update
paritytech-multiaddr
to>=v0.11.2
.
-
Network::dial()
understands/p2p
addresses andTransport::dial
gets a "fully qualified"/p2p
address when dialing a specific peer, whether through theNetwork::peer()
API or viaNetwork::dial()
with a/p2p
address. -
Network::dial()
andnetwork::Peer::dial()
return aDialError
on error. -
Shorten and unify
Debug
impls of public keys.
- Update dependencies.
-
(Re)add
Transport::address_translation
to permit transport-specific translations of observed addresses onto listening addresses. PR 1887 -
Update dependencies.
- Make
PeerId
beCopy
, including smallPeerId
API changes. PR 1874.
- Require
multistream-select-0.9.1
.
- Add missing multiaddr upgrade.
-
The
NetworkConfig
API is now a builder that movesself
. PR 1848. -
New configurable connection limits for established connections and dedicated connection counters. Removed the connection limit dedicated to outgoing pending connection per peer. Connection limits are now represented by
u32
intead ofusize
types. PR 1848. -
Update
multihash
. -
Update
multistream-select
.
- Remove
ConnectionInfo
trait and replace it withPeerId
everywhere. This was already effectively the case becauseConnectionInfo
was implemented onPeerId
.
- Update dependencies.
-
Rework transport boxing and move timeout configuration to the transport builder. PR 1794.
-
Update dependencies.
- Require at least parity-multiaddr v0.9.2 in order to fulfill
Ord
bound onMultiaddr
. PR 1742.
-
Simplify incoming connection handling. The
IncomingConnectionEvent
has been removed. Instead, pass theIncomingConnection
obtained fromNetworkEvent::IncomingConnection
toNetwork::accept()
. PR 1732. -
Allow any closure to be passed as an executor. PR 1686
-
Remove
PeerId
compatibility mode for "identity" and SHA2 hashes. Historically, before 0.12,PeerId
s were incorrectly always hashed with SHA2. Starting from version 0.13, rust-libp2p accepted both hashed and non-hashed keys as input. Starting from version 0.16 rust-libp2p comparedPeerId
s of "identity" and SHA2 hashes equal, which made it possible to connect through secio or noise to nodes with an identity hash for the same peer ID. Starting from version 0.17, rust-libp2p switched to not hashing the key (i.e. the correct behaviour) while retaining equality between peer IDs using the "identity" hash and SHA2. Finally, with this release, that will no longer be the case and it is assumed that peer IDs whose length is less or equal to 42 bytes always use the "identity" hash so two peer IDs are equal if and only if they use the same hash algorithm and have the same hash digest. PR 1608. -
Return dialer address instead of listener address as
remote_addr
inMemoryTransport
Listener
ListenerEvent::Upgrade
PR 1724.
-
Remove duplicates when performing address translation PR 1697.
-
Add
transport::Builder::multiplex_ext
for further customisation duringStreamMuxer
creation. PR 1691. -
Refactoring of connection close and disconnect behaviour. In particular, the former
NetworkEvent::ConnectionError
is nowNetworkEvent::ConnectionClosed
with theerror
field being anOption
andNone
indicating an active (but not necessarily orderly) close. This guarantees thatConnectionEstablished
events are always eventually paired withConnectionClosed
events, regardless of how connections are closed. Correspondingly,EstablishedConnection::close
is nowEstablishedConnection::start_close
to reflect that an orderly close completes asynchronously in the background, with the outcome observed by continued polling of theNetwork
. In contrast,disconnect
ing a peer takes effect immediately without an orderly connection shutdown. See PR 1619 for further details. -
Add
ConnectedPoint::get_remote_address
(PR 1649).
- Update ed25519-dalek dependency.
-
Conditional compilation fixes for the
wasm32-wasi
target (PR 1633). -
Rename
StreamMuxer::poll_inbound
topoll_event
and change the return value toStreamMuxerEvent
. This newStreamMuxerEvent
makes it possible for the multiplexing layer to notify the upper layers of a change in the address of the underlying connection. -
Add
ConnectionHandler::inject_address_change
.