Skip to content

Ensure random relay selection with fixed ohttp-keys config#1390

Merged
benalleng merged 1 commit intopayjoin:masterfrom
benalleng:randomize-relay-selection-with-key-config
Mar 16, 2026
Merged

Ensure random relay selection with fixed ohttp-keys config#1390
benalleng merged 1 commit intopayjoin:masterfrom
benalleng:randomize-relay-selection-with-key-config

Conversation

@benalleng
Copy link
Copy Markdown
Collaborator

Closes #1384

This fixes a bug whereby the relay selection was skipped if the config set a fixed value for the ohttp-keys.

Pull Request Checklist

Please confirm the following before requesting review:

This fixes a bug whereby the relay selection was skipped if the config
set a fixed value for the ohttp-keys.
@coveralls
Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 22781790124

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.497%

Totals Coverage Status
Change from base Build 22741440695: 0.0%
Covered Lines: 10638
Relevant Lines: 12895

💛 - Coveralls

@bc1cindy
Copy link
Copy Markdown
Contributor

bc1cindy commented Mar 6, 2026

tested ACK 6097008

all tests passing locally

the fix is minimal and reuses fetch_ohttp_keys randomization, that also preserves the e2e relay validation, even when keys are hardcoded in config

Copy link
Copy Markdown
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

utACK 6097008, though this makes me wonder if there is any benefit at all of having ohttp_keys in the cli config? We could just return the ValidatedOhttpKeys from fetch_ohttp_keys for the same effect, making the if/else block irrelevant?

@spacebear21
Copy link
Copy Markdown
Collaborator

Also relevant is this open PR #1035 , which would bypass the "e2e health check" aspect of fetch_ohttp_keys that is introduced here. cc @zealsham

@bc1cindy
Copy link
Copy Markdown
Contributor

bc1cindy commented Mar 7, 2026

Also relevant is this open PR #1035 , which would bypass the "e2e health check" aspect of fetch_ohttp_keys that is introduced here. cc @zealsham

also related with #1391

@spacebear21 spacebear21 mentioned this pull request Mar 9, 2026
2 tasks
@benalleng
Copy link
Copy Markdown
Collaborator Author

this makes me wonder if there is any benefit at all of having ohttp_keys in the cli config? We could just return the ValidatedOhttpKeys from fetch_ohttp_keys for the same effect, making the if/else block irrelevant?

I guess I would like to have more consensus on #1385 before we rip out the ohttp-keys from the config all together. I am happy to move on that as I think it ultimately makes sense.

@DanGould
Copy link
Copy Markdown
Contributor

What makes you feel like there's non-consensus on #1385? Do you mean specific voices? looks like thumbs up & this pr and #1399 are all acked. Where do you think the second guessing comes from?

@benalleng
Copy link
Copy Markdown
Collaborator Author

benalleng commented Mar 16, 2026

I think I meant that the discussion there in #1385 and this comment specifically raises the question as to whether we should abandon the session approach all together and go towards a per-request approach. I do think that this PR and #1399 can and should be merged to address the specific issue this addresses and move away from the health checks all together in a separate PR

@benalleng benalleng merged commit 3d1681b into payjoin:master Mar 16, 2026
14 checks passed
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.

Ohttp-relay selection should still be randomized even when ohttp-keys is hard coded in the config.

5 participants