Add supported versions to /health response#1348
Merged
arminsabouri merged 1 commit intopayjoin:masterfrom Feb 21, 2026
Merged
Conversation
Now that directory operators have the ability to opt out of v1 support, this addresses the requirement from payjoin#1198 that "The directory needs a way to declare its compatability with bip78." Instead of a new endpoint, it adds a "versions" array to the existing /health response. This is non-breaking.
Collaborator
Pull Request Test Coverage Report for Build 22244259109Details
💛 - Coveralls |
arminsabouri
approved these changes
Feb 21, 2026
Collaborator
arminsabouri
left a comment
There was a problem hiding this comment.
cAck & Approach Ack d1f1fb9
Clean. One comment but no reason to hold up the merge
| Ok(Response::new(empty())) | ||
| impl<D: Db> Service<D> { | ||
| async fn health_check(&self) -> Result<Response<BoxBody<Bytes, hyper::Error>>, HandlerError> { | ||
| let versions = if self.v1.is_some() { "[1,2]" } else { "[2]" }; |
Collaborator
There was a problem hiding this comment.
Would it be more descriptive if we had the bip numbers? if 1 and 2 are mentioned elsewhere in the docs and devs know what they means lets role with that.
Suggested change
| let versions = if self.v1.is_some() { "[1,2]" } else { "[2]" }; | |
| let versions = if self.v1.is_some() { "[bip78,bip77]" } else { "[bip77]" }; |
Collaborator
Author
There was a problem hiding this comment.
I followed the convention from the BIP78 error message for unsupported versions https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#optional-parameters
I think using bip numbers everywhere would be more descriptive but we may have too much lock in with version numbers already (pj uri parameter, error responses, payjoin-cli and mailroom config...)
This was referenced Feb 22, 2026
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.
Now that directory operators have the ability to opt out of v1 support, this addresses the requirement from #1198 that "The directory needs a way to declare its compatability with bip78."
Instead of a new endpoint, it adds a "versions" array to the existing /health response. This is non-breaking.
Written by Opus 4.6 and reviewed by me
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.