Skip to content

refactor(iroh): use combinator approach for address filtering#3987

Merged
Frando merged 5 commits intomainfrom
Frando/addr-filter-combinator
Mar 6, 2026
Merged

refactor(iroh): use combinator approach for address filtering#3987
Frando merged 5 commits intomainfrom
Frando/addr-filter-combinator

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Feb 28, 2026

Description

This changes the address filtering API added in #3960: Instead of having each service deal with the filtering, we layer this as a combinator on top. AddressLookupBuilder now has a with_addr_filter method with a default impl, and returns a FilteredBuilder which again impls AddressLookupBuilder itself. Through this, this all works transparently as currently, but the individual services don't need to care about the filtering at all.

Breaking Changes

Notes & open questions

Are there any downsides? This would save people who impl address lookup services from having to deal with the filtering themselves.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

@Frando Frando changed the title refactor: use combinator approach for address filtering refactor(iroh): use combinator approach for address filtering Feb 28, 2026
@Frando Frando force-pushed the Frando/addr-filter-combinator branch from f01c58c to 73a9657 Compare February 28, 2026 08:15
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 28, 2026

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: e8de9a5

@n0bot n0bot bot added this to iroh Feb 28, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Feb 28, 2026
Copy link
Copy Markdown
Member

@ramfox ramfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think this is a better way to think about/handle adding a filter.

I had half a thought in my head that said we should allow services to disregard user provided filters if they needed to, but I actually think that's wrong. If the user supplied a filter that filters out all of the addresses that can actually be published to a service, I'd rather assume they did it on purpose and not publish things they explicitly asked to keep private.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3987/docs/iroh/

Last updated: 2026-03-05T10:31:34Z

@Frando Frando marked this pull request as ready for review March 3, 2026 10:43
@Frando Frando requested review from ramfox and rklaehn March 3, 2026 10:54
@dignifiedquire dignifiedquire added this to the iroh: v0.97 milestone Mar 3, 2026
@dignifiedquire dignifiedquire moved this from 🚑 Needs Triage to 🏗 In progress in iroh Mar 3, 2026
@Frando Frando added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit a289f63 Mar 6, 2026
28 of 29 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Mar 6, 2026
matheus23 added a commit that referenced this pull request Mar 12, 2026
…#3987)"

This reverts commit a289f63.

But we *do* keep the `FilteredAddressLookup` utility.
github-merge-queue bot pushed a commit that referenced this pull request Mar 16, 2026
…lt (#4012)

## Description

Partially reverts #3987 so we have more control over the default
`AddrFilter` from within the `PkarrPublisherBuilder`, and because we
need it for pkarr, we keep this consistent across publishing services.

As a bonus, now pure resolvers don't suddently have a builder method for
address filtering that cannot apply to them (but they can still be
wrapped in `FilteredAddressLookup`, even though that's less
discoverable).

Fixes #4009 

## Breaking Changes

- **behavioral**: `PkarrPublisher` and `DhtPublisher` will now by
default publish *only* the relay URL, instead of detecting if
`RelayMode::Disabled` was set and in such cases publishing IP addresses.
We recommend users to explicitly set
`.addr_mode(AddrFilter::unfiltered())` if they set
`relay_mode(RelayMode::Disabled)`, to re-enable publishing IP addresses
publicly.

---------

Co-authored-by: Franz Heinzmann <frando@unbiskant.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants