Skip to content

v2.2.0

Latest

Choose a tag to compare

@richard-ramos richard-ramos released this 13 Jul 14:27
0e76328

Highlights

  • Removed minprotobuf usage, replacing it instead by nim-protobuf-serialization.
  • Protobuf metrics are now protocol-wide, with byte and message counters for sent/received protobuf traffic, and C bindings can expose metrics through libp2p_collect_metrics.
  • PubSub and GossipSub were hardened with a default per-peer topic cap, bounded partial-message group state, duplicate IHAVE fixes, better validation ordering, and safer extension subscription handling.
  • Kademlia gained a bounded local value store, improved routing-table peer admission, and cancellation of timed-out lookup RPCs so RPC slots are not leaked during bootstrap.
  • Peerstore and connection-manager behavior was tightened: dial addresses are normalized, signed peer record updates are validated, connected peer addresses no longer expire while the peer is connected, and peer lifecycle event ordering is more consistent around trimming and drops.
  • QUIC, yamux, and teardown paths were made more robust by tracking spawned futures, improving muxer close behavior, cleaning flushed-stream tracking, and updating lsquic for pending read/write cancellation.
  • C bindings gained libp2p_decode_xpr for decoding and verifying signed Extended Peer Records, plus stricter handling of invalid configured private keys.
  • Test coverage were expanded across priority queues, peerstore address TTLs, dual-stack transports, workflow caching, and parallel test execution.

Breaking changes

  • PubSub protobuf/RPC structs now use Opt[T] for fields that are optional on the wire. Code that directly constructs or reads Message, SubOpts, PeerInfoMsg, ControlIHave, ControlGraft, ControlPrune, PartialMessageExtensionRPC, PingPongExtensionRPC, Preamble, or IMReceiving may need to wrap values with Opt.some(...) and unwrap with .isSome, .get(), or .valueOr(...).
  • PubSub protobuf metrics changed. The old libp2p_pubsub_rpc_bytes_read and libp2p_pubsub_rpc_bytes_write counters were replaced by libp2p_protobuf_bytes_received, libp2p_protobuf_bytes_sent, libp2p_protobuf_messages_received, and libp2p_protobuf_messages_sent.
  • topicsHigh now defaults to 1024 instead of being effectively unlimited. Applications that legitimately expect a peer to subscribe to more than 1024 topics should set topicsHigh explicitly.
  • Kademlia local value storage is now bounded by configuration, with a default aligned to the provider-store capacity. Applications relying on unbounded local PUT_VALUE retention should configure the limit explicitly.

PubSub Opt migration example

# before
let sub = SubOpts(subscribe: true, topic: topic)
if msg.signature.len > 0:
  discard msg.verify()

# after
let sub = SubOpts(subscribe: Opt.some(true), topic: Opt.some(topic))
if msg.signature.isSome:
  discard msg.verify()

What's Changed

New Contributors

Full Changelog: v2.1.0...v2.2.0