v0.33.0

n0-computer/irohv0.33.0Feb 24, 2025by github-actions[bot]

AI Summary

A major release removing global DNS resolvers, enabling 0-RTT connections, and adding subscription streams for discovery.

Key Highlights

  • Removed global DNS resolver (dns::resolver, dns::default_resolver).
  • Removed create_dns_resolver test utility.
  • Removed IrohAttr, TxtAttrs, node_id_from_hickory_name from public API.
  • Removed to_z32, from_z32 (use NodeIdExt).
  • Removed ResolverExt.
  • Discovery::publish now takes NodeData.
  • Added 0-RTT connections support.
  • Added subscription stream for discovery results.

Breaking Changes

  • Removed global DNS resolver.
  • Removed create_dns_resolver.
  • Removed IrohAttr, TxtAttrs, node_id_from_hickory_name.
  • Removed to_z32, from_z32.
  • Removed ResolverExt.
  • Discovery::publish signature changed.
  • Endpoint::connect_with removed.
  • Connection::into_0rtt return type changed.
  • DnsResolver is now a struct.

New Features

  • 0-RTT connections.
  • Discovery subscription stream.
  • Publish/resolve user-defined data.
  • WASM support.
  • Faster Endpoint::close.

Full Release Notes

## ⚠️ Breaking Changes

- iroh
    - removed
        - `iroh::test_utils::create_dns_resolver` is removed, use `iroh::dns::DnsResolver::new` instead
        - `iroh::dns::resolver` and `iroh::dns::default_resolver` are removed. There is no static, global DNS resolver anymore. If you want to share a DNS resolver between endpoints, create the resolver yourself with `iroh::dns::DnsResolver::new` and clone it into the endpoint builders (in `EndpointBuilder::dns_resolver`). If you want to reuse the DNS resolver from an endpoint, you can access it with `Endpoint::dns_resolver` and clone it to wherever you need it.
        - `iroh::dns::node_info::{IrohAttr, TxtAttrs, node_id_from_hickory_name}` are no longer public. Use `iroh::dns::DnsResolver::lookup_node_by_id` or `iroh::dns::DnsResolver::lookup_node_by_domain_name` to lookup node info from DNS.
        - `iroh::dns::node_info::{to_z32, from_z32}`are removed. Use the methods on `iroh::dns::node_info::NodeIdExt` trait instead.
        - `iroh::dns::ResolverExt` is removed. Use the methods on `iroh::dns::DnsResolver` instead.
        - `iroh::discovery::Discovery::publish` now takes `data: &NodeData` as its single argument. `iroh::discovery::NodeData` is a re-export of `iroh_relay::dns::node_info::NodeData`, and contains relay URL and direct addresses. See docs for `NodeData` for details.
        - `iroh::Endpoint::connect_with` was removed, use `iroh::Endpoint::connect_with_opts` instead
    - changed
        - `iroh::dns::DnsResolver` used to be a type alias and now is a reexport of `iroh_relay::dns::DnsResolver` struct
        - `iroh::dns::node_info` module is now a reexport of `iroh_relay::dns::node_info`
        - `iroh::discovery::dns::{N0_DNS_NODE_ORIGIN_PROD, N0_DNS_NODE_ORIGIN_STAGING}` are now reexports of `iroh_relay::dns::{N0_DNS_NODE_ORIGIN_PROD, N0_DNS_NODE_ORIGIN_STAGING}`
        - The methods in `iroh::dns::DnsResolver` now take an `impl ToString` instead of `impl hickory_proto::rr::domain::IntoName` for their `host` argument
        - `iroh::discovery::DiscoveryItem` no longer has any public fields. There are now getters for the contained data, and constructors for createing a `DiscoveryItem` from a `NodeInfo`.
        - `iroh_relay::dns::node_info::NodeInfo` is changed.
            - `NodeInfo::new` now has a single `NodeId` argument. Use `NodeInfo::with_direct_addresses` and `NodeInfo::with_relay_url` to set addresses and relay URL. Alternatively, use `NodeInfo::from_parts` and pass a `NodeData` struct.
            - `NodeInfo` now has two public fields `node_id: NodeId` and `data: NodeData`, and setter and getter methods for the relay URL and direct addresses.
        - `iroh::discovery::pkarr::PkarrPublisher::update_addr_info` now takes a `NodeData` argument
        - `iroh::endpoint::Connection::into_0rtt` now returns `iroh::endpoint::ZeroRttAccepted`, instead of `iroh_quinn::ZeroRttAccepted`

## ⛰️  Features

- *(iroh)* Enable applications to establish 0-RTT connections ([#3163](https://github.com/n0-computer/iroh/issues/3163)) - ([f0abede](https://github.com/n0-computer/iroh/commit/f0abede7be34a850a420648b43ba92174d623eff))
- *(iroh)* Add subscription stream to watch all discovery results ([#3181](https://github.com/n0-computer/iroh/issues/3181)) - ([695f7c1](https://github.com/n0-computer/iroh/commit/695f7c15966366397a4c20c5149a8cfcce36da37))
- *(iroh)* Publish and resolve user-defined data in discovery ([#3176](https://github.com/n0-computer/iroh/issues/3176)) - ([ac78cf2](https://github.com/n0-computer/iroh/commit/ac78cf2c77a605ec17834d465cda7f1635514279))
- *(iroh)* Make `iroh` compile to `wasm32-unknown-unknown` ([#3189](https://github.com/n0-computer/iroh/issues/3189)) - ([247b891](https://github.com/n0-computer/iroh/commit/247b89191da6d2f46fb25859c9bf83edef44337d))
- *(iroh-net-report)* Support wasm32 building & running ([#3139](https://github.com/n0-computer/iroh/issues/3139)) - ([6f923a3](https://github.com/n0-computer/iroh/commit/6f923a34cd3bab2b7a996f0bc4c5b0dcac6399fc))
- *(iroh-relay)* Make `Endpoint::close` faster by aborting QAD connections faster ([#3182](https://github.com/n0-computer/iroh/issues/3182)) - ([f640e83](https://github.com/n0-computer/iroh/commit/f640e835494c36b7715a275fd154b86272235bcb))

## 🐛 Bug Fixes

- *(iroh)* Allow gracefully closing connections ([#3170](https://github.com/n0-computer/iroh/issues/3170)) - ([d9a5b8e](https://github.com/n0-computer/iroh/commit/d9a5b8e7f277204242af43fb658a384e54fdc942))
- *(iroh-relay)* Fix the number of active relay connections ([#3194](https://github.com/n0-computer/iroh/issues/3194)) - ([397d08d](https://github.com/n0-computer/iroh/commit/397d08d6d5ac64ba4c19792dc07da4dffdbd09d4))
- *(iroh-relay)* Bring back unique node counts ([#3197](https://github.com/n0-computer/iroh/issues/3197)) - ([892c767](https://github.com/n0-computer/iroh/commit/892c767970d8f2e0ff96e437f8c8a7695801ddf3))
- Update hickory resolver to 0.25.0-.alpha.5 ([#3178](https://github.com/n0-computer/iroh/issues/3178)) - ([a4fcaaa](https://github.com/n0-computer/iroh/commit/a4fcaaa1cb28f5017566a4858b32b14865c4a875))

## 🚜 Refactor

- *(iroh)* Store quic config, instead of recreating ([#3171](https://github.com/n0-computer/iroh/issues/3171)) - ([9eccb05](https://github.com/n0-computer/iroh/commit/9eccb0540a6759bfea0b1d2b263a1506b1e70fea))
- [**breaking**] Use a single DNS resolver ([#3167](https://github.com/n0-computer/iroh/issues/3167)) - ([c39b998](https://github.com/n0-computer/iroh/commit/c39b998309efc942edc6f26894ba5b46cf489156))
- [**breaking**] Streamline discovery and node info types ([#3175](https://github.com/n0-computer/iroh/issues/3175)) - ([3e3798f](https://github.com/n0-computer/iroh/commit/3e3798f7e95fe7442dfa319e7f0943cfa96b0080))

## 🧪 Testing

- *(iroh-net-report)* Do not ping hosts on the internet ([#3172](https://github.com/n0-computer/iroh/issues/3172)) - ([d43d474](https://github.com/n0-computer/iroh/commit/d43d47411a952087d50847f0fe61e0a14bceb30b))

## ⚙️ Miscellaneous Tasks

- Add additional todos in the "change checklist" ([#3180](https://github.com/n0-computer/iroh/issues/3180)) - ([31efead](https://github.com/n0-computer/iroh/commit/31efead8e8de8fc24af0594d80148d9281eee995))