Repository navigation
feat: local pubky swaps provider - #39
Conversation
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: full review of the whole PR diff against its merge base (96b597c), at 7afbeff. No earlier QA baseline exists. Covered: the pubky-swap compose service, the Dockerfile, the entrypoint, the keygen crate, and the README/CHANGELOG recipe.
1 actionable finding — resolve or provide an evidence-backed rebuttal.
The provider wiring matches its dependencies. I checked it against coreyphillips/pubky-swap@f45e204:
- Every
swap-providerflag inentrypoint.shexists. PUBKY_SWAP_RECOVERY_PHRASE__FILEis read and the first line is trimmed.--no-homeservertogether with the default iroh rendezvous is a supported combination.- The provider opens no TCP listener in LND's network namespace (the status API is off).
- bitkit-core v0.8.0-rc15 pins the same
swap-commonrevision. - The LND cert and macaroon paths match the
./lnd:/home/lnd/.lndmount and the LND 0.18 regtest layout. - The README ports, the
./bitcoin-cli send … -musage and the fixture service names match the repo.
The one finding: the Dockerfile's cache mounts need BuildKit. The repo's own scripts say the QA boxes don't have BuildKit, and the README builds the image straight through compose.
Validation: source analysis only. The PR reports no CI checks. Limits:
- I could not build the keygen crate locally: the sandbox denied network access to crates.io.
- I did not run a Docker build or start the stack.
- J1/J2 journey results are still pending from the author.
Suggested additional test cases
- Host with Docker but no buildx/BuildKit (the QA-box setup): run the README recipe through
docker compose --profile pubky-swaps up -d --build pubky-swap. Expected: the image builds and the provider logs its pubky. If it fails with a--mount/ BuildKit error, the finding is confirmed. - Running stack:
docker compose --profile pubky-swaps restart pubky-swap, then comparedocker compose logs pubky-swap | grep "Provider pubky"before and after. Expected: the pubky is the same. Afterdocker compose rm -sf pubky-swap && docker volume rm <project>_pubky_swap_dataand a freshup, the pubky should change. - Fresh
./lnddirectory (no macaroon yet): startpubky-swaptogether withlnd. Expected: it logswaiting for LND's macaroonuntil LND writes it, thenConnected to LND node, with no crash loop.
Findings
- [MEDIUM] Provider image can't build on the QA boxes' Docker (no BuildKit) — inline at
pubky-swap/Dockerfile:10.
Reviewer model: claude-opus-5-5
Reasoning effort: high
|
1 finding (P3). Adds a README.md:57-65 The What I checked, and 8 candidates I ruled outRead in full: Ruled out
Not verified: the image build and the journeys. The build rests on the QA note; the runtime log lines quoted there are what the code emits ( Merge confidence: 4/5, the image build was not run in this review. |
|
@talosmachina added in 491a491: the Services list now has a "Pubky Swaps provider" bullet beside the other opt-in profiles. |
|
@ovitrif confirmed in 491a491: the Services list in |
|
J1 (
In each J1, the provider's claim spends only its HTLC and pays exactly 0.0002 BTC to the |
|
80ebc3d adds an "Issuer contact" step to the README's Pubky Swaps recipe. J1 pays the With main merged in (the rc8 issuer from #38), J1 via the saved contact now passes on both apps: |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: Re-reviewed the full PR at 80ebc3d after the comparison base changed to 54e7def and no coverage baseline was supplied. This pass covered the full diff from that merge base.
1 actionable finding — resolve or provide an evidence-backed rebuttal.
The pubky-swaps service matches pubky-swap f45e204, the swap-common revision pinned by bitkit-core v0.8.0-rc15. --wallet lnd overrides the BDK wallet default, the Lightning backend already defaults to LND, and the TLS cert and admin macaroon paths match this stack's ./lnd layout. Electrum tcp://electrs:60001 is reachable through LND's network namespace. The recovery phrase is written once into pubky_swap_data, and that revision trims the file's first line, so the logged pubky stays stable across provider restarts. The offer flags, startup log text, and issuer /link, /sync, and /endpoints steps match the provider and the payment-request fixture.
Validation: cargo build --locked for pubky-swap/keygen succeeded with rustc 1.83.0. Docker is not available in this environment, so docker compose config, the provider image build, and a running stack were not executed. The author's reported compose build and manual startup were not re-run.
Suggested additional test cases
- Docker, fresh volumes, with Electrum not already accepting connections. Run
docker compose --profile pubky-swaps up -das the first command. Expected:pubky-swaplogsProvider is execution-capable. It does not logchain watcher unavailableor stay up asnegotiation-only. The entrypoint waits only for LND's macaroon, and this provider revision connects to Electrum once at startup.
Earlier findings reconciled at this revision: 2 verified fixed.
Findings
- [LOW] Swap journey links point at master, where the files are absent — inline at
README.md:732.
Reviewer model: grok-4.7
Reasoning effort: high
|
@piotr-iohk 7ae2cec also takes the suggested fresh-volume case. The entrypoint now waits for Electrum on |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: Follow-up of 7ae2cec since 80ebc3d, merge base 54e7def. Baseline: pullrequestreview-5891318225. This pass inspected the Electrum wait and the README journey-location sentence. Inherited coverage: the pubky-swaps compose service (profile, LND network namespace, read-only ./lnd mount, pubky_swap_data volume); the f45e204 image build with feature full and the keygen crate; entrypoint flags, recovery-phrase file, and LND macaroon wait; the README Pubky Swaps recipe against this stack's LND, Electrum, lnurl-pay channel fixture, and fixture-issuer /link /sync /endpoints; and the bitkit-core v0.8.0-rc15 swap-common pin with paykit-swap-route.xml on app master versus the open app PR heads.
No new actionable code findings.
At pubky-swap f45e204, build_chain connects once during run. A failed connect leaves the process up and rejecting swap requests for the rest of that process. The new loop waits for TCP electrs:60001, the same endpoint as --electrum-url, inside the LND network namespace the service already uses. Debian Bookworm bash 5.2.15, the bash shipped in debian:bookworm-slim, implements /dev/tcp; a refused connection exits non-zero and the loop retries. The README sentence matches the apps: journeys/paykit-swap-route.xml and journeys/paykit-swap-restore.xml are on bitkit-ios#1170 at 58139bc5 and bitkit-android#1732 at a786e349. Both app masters' journeys/ listings have neither file.
Validation: sh -n pubky-swap/entrypoint.sh passed at 7ae2cec. Bookworm package bash_5.2.15-2+b13 was executed here: opening /dev/tcp/127.0.0.1/1 exited 1 with Connection refused. Provider startup was read at f45e204. An issue search on synonymdev/bitkit-docker for this wait found no match. The compose stack was not started (code-only; Docker is not installed). Pinned digest 3783cc01769c is the official bookworm-slim image index; its rootfs was not extracted layer by layer.
Suggested additional test cases
- Platform: Docker host running this stack. Setup:
docker compose up -d, thendocker compose stop electrs, with LND already past its macaroon. Action:docker compose --profile pubky-swaps up -d pubky-swap, watchdocker compose logs -f pubky-swap, thendocker compose start electrs. Expected: logs printwaiting for Electrumuntil Electrum acceptselectrs:60001, thenProvider is execution-capable (LND + chain watcher + funding wallet present).
Earlier findings reconciled at this revision: 2 verified fixed.
Reviewer model: grok-4.7
Reasoning effort: high
|
Merging: approved at 7ae2cec, no open threads, and main has nothing this PR lacks. The swap journeys on synonymdev/bitkit-android#1732 and synonymdev/bitkit-ios#1170 point their QA setup at this recipe. |
Refs:
Description
pubky-swapservice (profilepubky-swaps), so the apps' swap route journeys (paykit-swap-route.xml, J1, andpaykit-swap-restore.xml, J2) run on this stack. Until now they needed the provider built and run by hand next to the stack.f45e204with thefullfeature set. That's the commit bitkit-core's Pubky Swaps client pins (swap-commonin itsCargo.tomlat v0.8.0-rc15).PUBKY_SWAP_REVmoves it.127.0.0.1:10009with the TLS cert and admin macaroon LND writes to./lnd, mounted read-only. It reads the chain fromelectrs:60001, and waits for LND's macaroon on a fresh stack.pubky-swap-keygenbinary writes it to thepubky_swap_datavolume on first start. No phrase is in the repository, and the pubky stays the same across restarts, so the contact a wallet saved keeps working.Out of Scope
--no-homeserver../bitcoin-clihelpers for the provider: the recipe funds LND withlncli newaddressand./bitcoin-cli send.QA Notes
Automated Checks
docker compose config -q: passes.docker compose --profile pubky-swaps build pubky-swap: buildsswap-provideratf45e204and the keygen.DOCKER_BUILDKIT=0 docker build pubky-swap: builds with the classic builder, as on the QA boxes.Manual Tests
docker compose --profile pubky-swaps up -d pubky-swapon a running stack: the provider logs its pubky,Connected to LND node … (alias lnd),Provider is execution-capable (LND + chain watcher + funding wallet present), its offer (10,000 to 1,000,000 sats, both directions) andiroh rendezvous online.