Add local live sync harness: Bitcoin, Liquid, and Boltz chain-swaps#50
Open
tobomobo wants to merge 2 commits into
Open
Add local live sync harness: Bitcoin, Liquid, and Boltz chain-swaps#50tobomobo wants to merge 2 commits into
tobomobo wants to merge 2 commits into
Conversation
e48ab57 to
9476881
Compare
9476881 to
09c3d6a
Compare
… coverage Layers a senior-dev-grade live-sync test bed over the initial Bitcoin regtest work in PR #50: * tests/live_sync/ — session-scoped harness package. Bitcoin and Liquid stacks each start once per test module (setUpModule / tearDownModule); every test method gets a fresh Kassiber --data-root but reuses the chain. RPC creds are randomized per session, container ports bind to 127.0.0.1 only, and rpcallowip is scoped to the Docker bridge range (172.16.0.0/12) instead of 0.0.0.0/0. * tests/test_live_sync_bitcoin.py — refactored Bitcoin test on top of the new harness, with idempotency assertion folded in and docker logs auto-captured to stderr on failure. * tests/test_live_sync_liquid.py — new live Liquid test driving elementsd + electrs-liquid (Vulpem images by default, env-overridable) with a real ct(slip77(...), elwpkh(...)) descriptor wallet exported from elementsd. Handles both unified <0;1> and legacy split descriptors, and fetches the elementsregtest policy asset id at runtime so LBTC labeling does not depend on a hardcoded genesis. * tests/test_live_sync_regtest.py removed — superseded by the two split files above; the user-parameterized Liquid backend path goes away because the regtest harness is now seamless. * kassiber/cli/handlers.py — TRANSFER_PAIR_KINDS gains 'chain-swap' for Boltz-style BTC <-> LBTC atomic swaps (distinct from Liquid federation pegs and from Lightning submarine swaps). * tests/fixtures/fake_wallets/boltz_*.csv + scripts/seed-boltz-swaps.sh + tests/test_boltz_swap_fixture.py — deterministic fixture covering a full Boltz chain-swap round trip (forward BTC -> LBTC and reverse LBTC -> BTC) with the Boltz service-fee spread baked in, paired with --kind chain-swap --policy taxable, plus end-to-end CLI-level assertions on the resulting reports.summary and journals.transfers.list envelopes. * .github/workflows/live-sync.yml — daily cron (05:00 UTC) plus manual dispatch with a suite selector (bitcoin / liquid / all). Two parallel jobs so Bitcoin and Liquid failures stay independent. Concurrency group prevents pile-ups. * scripts/live-sync-tests.sh — gains --suite {bitcoin,liquid,all} and --require-liquid-regtest; runs the new split test modules. * scripts/quality-gate.sh — adds tests.test_boltz_swap_fixture and swaps the disabled-import check to the new module names. * docs/reference/testing.md — three-layer model (fixtures / live regtest / manual compat), Boltz section, privacy posture. * AGENTS.md, README.md, docs/reference/tax.md, skills/kassiber/* — cross-link testing.md and add chain-swap alongside the existing swap kinds wherever they are listed. * TODO.md — checks off completed items, adds tracked follow-ups for reorg/gap-limit/zero-conf live tests, descriptor-type matrix, digest-pinned images, and a future real Boltz backend integration. Verified locally with ./scripts/quality-gate.sh (full pass) and KASSIBER_LIVE_SYNC_TESTS=0 import-only checks for both new live modules. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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.
Summary
tests/live_sync/) so each test module reuses one bitcoind / one elementsd + electrs-liquid stack, with randomized RPC creds,rpcallowipscoped to the Docker bridge (172.16.0.0/12), loopback-only host port binds, anddocker logsauto-captured to stderr on failurechain-swapas a newTRANSFER_PAIR_KINDdistinct from federation pegs and Lightning submarine swaps; both legs paired via--kind chain-swap --policy taxableand asserted end-to-end through the CLI intests/test_boltz_swap_fixture.pydocs/reference/testing.md, link it fromAGENTS.md, and wire the sync + Boltz fixture checks into the quality gate--require-bitcoin-regtestand--require-liquid-regtestso local Docker runs can fail instead of silently skipping when the daemon/image is unavailablesuiteselector (bitcoin/liquid/all); two parallel jobs so failures stay independent, with a concurrency group to prevent pile-upsValidation
live-syncworkflow)