Skip to content

Add core RelaySelector#1696

Open
bc1cindy wants to merge 3 commits into
payjoin:masterfrom
bc1cindy:relay-selector
Open

Add core RelaySelector#1696
bc1cindy wants to merge 3 commits into
payjoin:masterfrom
bc1cindy:relay-selector

Conversation

@bc1cindy

@bc1cindy bc1cindy commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

centralize OHTTP relay selection in payjoin::relay::RelaySelector so integrators share one policy instead of each diverging.

breaking: io::fetch_ohttp_keys(relay, dir) -> OhttpKeys becomes (relays, dir) -> (OhttpKeys, Url)

this is the follow-up referenced in #1695 (review) by @DanGould; directory selection stays in the manager; durable tracking is #1697

part of #1694 / part of #1586

disclosure: co-authored by Claude

@coveralls

coveralls commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28468711613

Coverage increased (+0.2%) to 85.988%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 19 uncovered changes across 3 files (123 of 142 lines covered, 86.62%).
  • 2 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
payjoin-cli/src/app/v2/ohttp.rs 16 1 6.25%
payjoin/src/core/io.rs 57 54 94.74%
payjoin-cli/src/app/v2/mod.rs 6 5 83.33%
Total (5 files) 142 123 86.62%

Coverage Regressions

2 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
payjoin-cli/src/app/v2/ohttp.rs 1 48.94%
payjoin/src/core/io.rs 1 77.07%

Coverage Stats

Coverage Status
Relevant Lines: 15372
Covered Lines: 13218
Line Coverage: 85.99%
Coverage Strength: 356.86 hits per line

💛 - Coveralls

@bc1cindy bc1cindy marked this pull request as ready for review June 29, 2026 22:10
@DanGould DanGould mentioned this pull request Jun 30, 2026
2 tasks

@zealsham zealsham left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cack

one question, once a relay is marked as failed, its impossible to unfail except a total restart, Should we have time window for retryability ?

Comment thread payjoin/src/core/io.rs
@bc1cindy

Copy link
Copy Markdown
Contributor Author

thanks for the review! @zealsham

one question, once a relay is marked as failed, its impossible to unfail except a total restart, Should we have time window for retryability ?

RelaySelector only tracks failures in memory per operation. I opened #1697 for the failure-lifecycle policy, which covers exactly this "path back (re-test recovery)" question

keeping it out of this PR to stay focused on the selection refactor

bc1cindy added 3 commits June 30, 2026 15:17
One canonical relay-selection policy so integrators stop diverging.
Consumers inherit one selection and failover policy instead of each
diverging.
Add a SelectContext argument to select() and pass an empty, random
context at each call site.
@bc1cindy

Copy link
Copy Markdown
Contributor Author

rebased onto master, integrated with #1695: relay selection moved out of MailroomManager into the lib RelaySelector

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.

3 participants