v2.1.0
Highlights
- NAT traversal support was expanded with UPnP, NAT-PMP, NATService, and tighter integration of AutoNAT and hole punching into the NAT service flow.
- DCUtR gained QUIC hole punching support, with follow-up fixes to enable hole punching and improve AutoNAT v2 address candidate selection.
- Service Discovery was hardened across registration maintenance, table/key bucketing, record filtering, record/service-data size limits, and invalid ticket handling.
- Peer IDs now support CIDv1.
LPProtocolgained metrics, tests for emitted metric values, and a fast path when stream limits are disabled.- GossipSub partial-message handling was fixed for requested partial topics and fanout regressions.
- Protocol serialization was modernized around
protobuf_serializationfor Identify, Noise, Relay, routing records, and AutoNAT v2, with protobuf decode APIs moving towardResult. - Internal dependencies were reduced by replacing
nim-jwtwith an internal JWS signer and replacing the unmaintaineddnsclientdependency with an internal DNS codec. - Builder, Dial, MultistreamSelect, and utility APIs were cleaned up to simplify switch construction and remove older Nim <2 compatibility leftovers.
Unified NAT traversal configuration
NAT traversal is now configured through withNAT(...), with separate helpers for port mapping, reachability probing, and hole punching.
let switch = SwitchBuilder
.new()
.withAddress(MultiAddress.init("/ip4/0.0.0.0/tcp/0").tryGet())
.withTcpTransport()
.withMplex()
.withNAT(upnpConfig())
.withNAT(autonatConfig(AutonatV2))
.build()Caution
When using KadDHT, we have noticed that the number of streams seems high when using tcp+(yamux|mplex). We are investigating this and will release a fix in new minor or patch version.
What's Changed
- fix(service-disco): skip double-hashing service ID in bucket index by @rlve in #2514
- chore(MultistreamSelect): handle cosmetics by @vladopajic in #2525
- test(tools): adding multiaddress tools by @vladopajic in #2530
- chore: remove Nim <2 leftovers (unsafeAddr, newSeqUninit shim) by @gmelodie in #2537
- chore(builders): avoid ref objects for SwitchBuilder configs by @gmelodie in #2535
- test(service-disco): closer peers by @rlve in #2528
- test(service-disco): improve flaky test
discoverer learns closer peers from GET_ADS replyby @rlve in #2532 - chore: more standard builders by @vladopajic in #2531
- chore: unify and dedup utilities by @gmelodie in #2538
- chore: replace nim-jwt with internal JWS signer by @gmelodie in #2539
- chore(future): add completeOnce template by @vladopajic in #2543
- chore(autotls): encapsulate broker interaction behind AutotlsBroker by @gmelodie in #2534
- chore: replace unmaintained dnsclient with internal DNS codec by @gmelodie in #2536
- chore: remove standard_switch.nim by @richard-ramos in #2552
- refactor(dial): keep low-level dial APIs off Dial interface by @richard-ramos in #2550
- fix(SwitchBuilder): initialization of services dependent of Rng by @richard-ramos in #2547
- fix(peerinfo): wrap peer ID initialization errors by @richard-ramos in #2545
- fix(multiaddress): onion size and DNS/IP consistency by @richard-ramos in #2546
- chore(autotls): remove libp2p_autotls_support flag by @gmelodie in #2556
- fix: avoid nim range-backed integer types by @richard-ramos in #2549
- fix(ping): keep inbound ping streams reusable by @richard-ramos in #2553
- fix(PartialMessage): handle messages if requested partial for topic by @vladopajic in #2569
- fix(hpservice): stop autorelay with hole punching service by @richard-ramos in #2562
- fix(quic): harden certificate parsing and peer verification by @richard-ramos in #2567
- chore: harden ZeroQueue edge cases by @richard-ramos in #2548
- fix(service-disco): general table usage by @SionoiS in #2533
- feat(nat): upnp, nat-pmp build infra by @gmelodie in #2570
- fix(service-disco): registration maintenance by @SionoiS in #2566
- refactor(kad): rewrite randomRecords around new lookOnce primitive by @gmelodie in #2559
- feat(LPProtocol): add metrics by @vladopajic in #2577
- test(service-disco): advertiser registration maintenance by @rlve in #2541
- fix(service-disco): enforce size on records and service data by @SionoiS in #2564
- fix: autonatv2 failed dial not reachable by @2-towns in #2582
- chore(LPProtocol): fast path when there are no limits by @vladopajic in #2584
- chore(kad): limits by @gmelodie in #2560
- feat(nat): upnp by @gmelodie in #2573
- feat(nat): nat-pmp by @gmelodie in #2574
- chore(MultistreamSelect): remove codecs from addHandler proc by @vladopajic in #2589
- chore: remove unnecessery transport argument by @vladopajic in #2593
- fix(multistream): flaky peer limit test by @gmelodie in #2594
- fix(gossipsub): Partial Messages - fanout regression by @rlve in #2597
- fix(tests): shard test_all to fix i386+orc OOM by @gmelodie in #2595
- feat(nat): NATService by @gmelodie in #2596
- chore(autonatv2): remove go-libp2p patch from tests by @gmelodie in #2558
- test(conn-manager): watermark/scoring component 1 by @rlve in #2590
- feat(peerid): support CIDv1 by @richard-ramos in #2598
- test(conn-manager): watermark/scoring component 2 by @rlve in #2591
- chore: remove explicit inline pragmas by @richard-ramos in #2551
- chore: add autonat v1 protobuf serialization powered by nim-protobuf-serialization by @moigagoo in #2581
- chore(Identify): cleanups by @vladopajic in #2599
- chore: add npeg to .pinned file by @jmgomez in #2583
- fix(service-disco): record addrs filtering by @SionoiS in #2588
- fix(service-disco): fix accepted time value for invalid ticket by @SionoiS in #2578
- chore(deps): bump metrics to v0.2.2 by @vladopajic in #2602
- fix(service-disco): service discovery key bucketing by @SionoiS in #2592
- chore(nat): mock tests by @gmelodie in #2576
- feat(dcutr): support QUIC hole punching by @richard-ramos in #2587
- test(LPProtocol): add tests asserting metrics values by @vladopajic in #2603
- chore(Identify): utilize protobuf_serialization by @vladopajic in #2601
- chore(deps): bump protobuf_serialization to v0.5.0 by @nitely in #2608
- refactor(Identify): remove peerId argument form IdentifyPushHandler by @vladopajic in #2606
- feat(nat): absorb autonat / hole-punching into NATService by @gmelodie in #2604
- chore(protobuf): decode procs to return result by @vladopajic in #2609
- chore(Noise): utilize protobuf_serialization by @vladopajic in #2610
- fix(service-disco): misc fixes by @SionoiS in #2613
- chore(routing-record): utilize protobuf_serialization by @vladopajic in #2614
- chore(autonatv2): utilize protobuf_serialization by @vladopajic in #2612
- chore(protobuf): add chronos/time extensions by @vladopajic in #2619
- fix: enable hole punching by @richard-ramos in #2618
- chore(relay): utilize protobuf_serialization by @vladopajic in #2616
- fix(autonatv2): include observed addresses in dial request candidates by @2-towns in #2600
- test(conn-manager): event ordering issue by @rlve in #2620
- fix(relay): restore v2 presence validation by @richard-ramos in #2626
- chore: handle der encoding by @richard-ramos in #2632
- chore(autonatv2): normalize response address selection by @richard-ramos in #2631
- chore: handle pending reads and writes in Quic by @richard-ramos in #2689
Full Changelog: v2.0.0...v2.1.0