Skip to content

feat: allow async selectors and adding validators/selectors#3506

Open
achingbrain wants to merge 1 commit into
mainfrom
feat/allow-async-selectors
Open

feat: allow async selectors and adding validators/selectors#3506
achingbrain wants to merge 1 commit into
mainfrom
feat/allow-async-selectors

Conversation

@achingbrain
Copy link
Copy Markdown
Member

@achingbrain achingbrain commented May 15, 2026

  • Allows selector functions to be async similar to validators
  • Allows adding additional selectors/validators after construction

This is to allow extending functionality after setup of other components that have a different lifecycle.

Specifically Helia has a libp2p property, but IPNS usage needs setup of Helia before it can add DHT selectors/validators - by that point it's too late to add DHT selectors/validators as libp2p has already been constructed.

Selectors need to be async to allow for more types of work to be done during record selection, here Helia needs to be able to load esoteric encryption schemes that it may not be initially configured with.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

- Allows selector functions to be async similar to validators
- Allows adding additional selectors/validators after construction

This is to allow extending functionality after setup of other components
that have a different lifecycle.

Specifically Helia has a libp2p property, but IPNS usage needs setup
of Helia before it can add DHT selectors/validators - by that point it's
too late to add DHT selectors/validators as libp2p has already been constructed.
@achingbrain achingbrain requested a review from a team as a code owner May 15, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant