Skip to content

Conversation

@nothingmuch
Copy link
Collaborator

@nothingmuch nothingmuch commented Aug 29, 2025

With #915 we no longer require docker to run integration tests. This lets us run the integration tests in the nix sandbox.

This PR makes nix flake check work again, and enables the integration tests.

Currently marked draft due to dependency on that PR, and because this should also add a github workflow job to actually run nix flake check (with caching, see #457)

Depends on #915

TODO:

Pull Request Checklist

Please confirm the following before requesting review:

This is a refactoring of the existing redis DbPool, simplifying it a
bit and renaming the various methods for clarity.

The trait is async, with its futures also satisfying `Send` in order to
allow its use in the `hyper::Service` trait.

DbPool was renamed to db::redis::Db (reexported as RedisDB) in
anticipation of additional impls of the trait.
v2 payloads are saved to disk.

v1 requests and responses are not, because they only make sense to keep
around so long as the sender's connection is still active, and because
they are not encrypted.

In flight requests (long polls) are tracked waitmaps for notifying
waiting readers of new payloads or v1 responses.

Mailbox contents are retained for up to a week by default, or up to 24
hours at capacity. Read mailboxes have a grace period of 10 minutes
before they are expired.

For simplicity no concurrent hashmap is used, and the mutex is held
during writes to disk. This is because concurrency is implicitly bound
by bitcoin's transaction throughput limits, for the retention times
described above a very generous upper bound is 25 writes per second.
Because only mutual exclusion for the entire structure is used, pruning
is done on a per need basis by the locking thread and not in a
background task.
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 17333460960

Details

  • 536 of 642 (83.49%) changed or added relevant lines in 6 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.1%) to 86.041%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-test-utils/src/lib.rs 6 7 85.71%
payjoin-directory/src/config.rs 0 3 0.0%
payjoin-directory/src/main.rs 0 3 0.0%
payjoin-directory/src/db/mod.rs 0 14 0.0%
payjoin-directory/src/lib.rs 12 31 38.71%
payjoin-directory/src/db/files.rs 518 584 88.7%
Files with Coverage Reduction New Missed Lines %
payjoin-directory/src/config.rs 1 0.0%
payjoin-directory/src/lib.rs 1 61.32%
payjoin-directory/src/main.rs 1 0.0%
Totals Coverage Status
Change from base Build 17332008623: 0.1%
Covered Lines: 8617
Relevant Lines: 10015

💛 - Coveralls

@benalleng
Copy link
Collaborator

with the redis stuff merged in what commits remain from this PR?

@benalleng benalleng mentioned this pull request Dec 1, 2025
2 tasks
@benalleng
Copy link
Collaborator

Closed as rebased into #1210

@benalleng benalleng closed this Dec 10, 2025
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