[WIP] Add AS-aware relay selection#1514
Draft
Mshehu5 wants to merge 5 commits into
Draft
Conversation
Collaborator
Coverage Report for CI Build 26173671454Coverage decreased (-0.9%) to 84.348%Details
Uncovered Changes
Coverage Regressions7 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
5a6c956 to
d927140
Compare
6f1528c to
4547e8e
Compare
Collaborator
|
cc @nothingmuch to approach Ack/Nack |
Replace the singular v2 directory setting with a trusted directory list while preserving the CLI override behavior.
Load ASMap settings behind an optional feature and reject ASMap configuration when the binary was built without support.
Choose relay order from the receiver key, request kind, time window and relay bucket
Route key fetching and protocol requests through selected relay candidates with failover for retryable network errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a proof of concept for AS-aware, stateless relay selection in payjoin-cli and is meant to move the discussion in #919 forward. Reviewers will probably want to read #919 for the full context behind the design and tradeoffs.
The implementation adds optional ASMap-based filtering for trusted directories and OHTTP relays then demonstrates relay selection that separates POST and POLL traffic without storing a selected relay or relay index. Relay ordering is derived from the receiver key, request/message type and short time windows with polling avoiding POST-reserved AS buckets for nearby windows.
I also added comments around parts of the implementation that may be candidates for moving into the
payjoincrate or possibly into a reusable external crate. These comments are suggestions not final API proposals and reviewer feedback would be very welcome. One reason for calling these pieces out is the concern raised in #919: asking every downstream wallet to reimplement this behavior could create extra work and consistency problems.Disclosure: co-authored by Codex
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.