Skip to content

feat: use arkade-regtest for regtest environment#386

Open
Kukks wants to merge 57 commits intomasterfrom
feat/use-arkade-regtest
Open

feat: use arkade-regtest for regtest environment#386
Kukks wants to merge 57 commits intomasterfrom
feat/use-arkade-regtest

Conversation

@Kukks
Copy link
Copy Markdown
Contributor

@Kukks Kukks commented Mar 26, 2026

Summary

  • Replace custom docker-compose.yml, server.Dockerfile, wallet.Dockerfile with arkade-regtest submodule
  • Pin arkd to v0.9.0 via .env.regtest
  • Simplify CI: remove nigiri GH Action, use regtest/start-env.sh
  • Trim test/setup.mjs to SDK-specific setup only (wait for readiness)

Test plan

  • ./regtest/start-env.sh starts full environment
  • pnpm test:unit passes
  • pnpm test:integration-docker passes
  • CI workflow completes successfully

Summary by CodeRabbit

  • Chores
    • CI split into separate lint, unit, integration, and build jobs for clearer, faster runs.
    • Replaced the previous Docker-compose regtest workflow with a tracked regtest submodule and dedicated regtest start/stop/clean scripts; removed embedded container build artifacts.
    • Added a regtest-specific environment override that pins regtest images, adjusts consensus/timing flags, and forces all fee values to 0.0; bumped a minor dependency.
  • Tests
    • Simplified test setup to lightweight readiness checks and updated tests to target renamed containers and new local REST endpoints.

Kukks added 2 commits March 25, 2026 16:46
Fixes Vite browser builds broken by Node-only createRequire in 3.2.2.
The 3.2.3 release replaces createRequire with dynamic import() for
browser-compatible lazy loading of the optional miniscript dependency.
Replace bespoke docker-compose.yml, server.Dockerfile, wallet.Dockerfile
with shared arkade-regtest submodule. Pins arkd to v0.9.0 via .env.regtest.
Simplify CI by removing nigiri GH Action and docker build steps.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a regtest env file and regtest submodule, replaces compose/Dockerfile-based regtest with regtest scripts, refactors CI into separate jobs, simplifies test setup to poll Boltz readiness, and updates test utilities/endpoints and package scripts/dependency.

Changes

Cohort / File(s) Summary
Regtest env & submodule
\.env.regtest, .gitmodules, regtest
Adds .env.regtest with regtest-specific environment overrides (pins arkd/arkd-wallet images to ghcr.io/arkade-os:v0.9.0, sets ARKD_ALLOW_CSV_BLOCK_TYPE=true, tunes ARKD_VTXO_TREE_EXPIRY/ARKD_BOARDING_EXIT_DELAY, zeroes fee envs). Adds/updates regtest git submodule.
CI pipeline
.github/workflows/ci.yml
Refactors single test job into lint, unit, integration, and build; uses pnpm --frozen-lockfile and setup-node pnpm caching; integration job checks out submodules, installs Go 1.23, seeds regtest build cache, runs ./regtest/start-env.sh, adjusts PATH for local nigiri, runs dockerized test steps, captures container logs on failure, and always runs ./regtest/clean-env.sh.
Removed compose & Dockerfiles
docker-compose.yml, server.Dockerfile, wallet.Dockerfile
Removes docker-compose and per-service Dockerfiles and their service definitions; infrastructure lifecycle moved to regtest scripts.
Package scripts & dependency
package.json
Replaces compose-based scripts with regtest:start, regtest:stop, regtest:clean; updates regtest script to use shell scripts; removes compose build/up/down scripts; bumps @kukks/bitcoin-descriptors 3.2.2 → 3.2.3.
Test setup & e2e utilities
test/setup.mjs, test/e2e/utils.ts, test/e2e/*.ts
Removes many Docker/arkd-wallet/Fulmine setup helpers and replaces with waitForBoltzPairs() poll; changes exported arkdExec from docker exec -t arkddocker exec -t ark; updates RestDelegatorProvider endpoints from http://localhost:7002http://localhost:7012 across e2e tests.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant CI as "CI Runner (actions)"
    participant Submod as "regtest submodule\n(./regtest/start-env.sh)"
    participant Build as "Local Nigiri Build\n(binary)"
    participant Docker as "Docker Containers\n(ark, wallet, services)"
    participant Tests as "Test Runner\n(pnpm test:integration-docker)"

    CI->>Submod: checkout submodule, run ./regtest/start-env.sh
    Submod->>Build: seed/build nigiri binary
    Submod->>Docker: start containers (ark, wallet, services)
    CI->>Tests: run pnpm test:setup-docker / test:integration-docker (ARK_ENV=docker)
    Tests->>Docker: poll readiness (ark server, Boltz pairs)
    Docker-->>Tests: readiness OK
    Tests-->>CI: test results
    CI->>Submod: run ./regtest/clean-env.sh (always)
    Submod-->>Docker: stop & cleanup containers
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • louisinger
  • altafan
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: use arkade-regtest for regtest environment' clearly and directly describes the main change: replacing custom regtest artifacts with the arkade-regtest submodule, which is the primary focus of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/use-arkade-regtest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 Arkana PR Review — arkade-os/ts-sdk#386

Summary: Replaces custom Docker infrastructure (docker-compose.yml, server.Dockerfile, wallet.Dockerfile) with the shared arkade-regtest submodule. Splits CI into parallel jobs, dramatically simplifies test setup.

✅ What looks good

  1. Massive cleanup — removes ~508 lines of bespoke Docker/setup code in favor of the shared regtest submodule. This is exactly the right direction for cross-repo consistency.

  2. CI parallelization — splitting lint/unit/build to run independently while integration depends on lint+unit is a solid pattern. Should reduce feedback time on quick failures.

  3. Hardcoded keys removed — the old docker-compose had ARKD_WALLET_SIGNER_KEY and the Fulmine private key inline. Now handled by arkade-regtest defaults. Cleaner.

  4. setup.mjs simplification — from ~200 lines of manual wallet creation, faucet calls, and Fulmine bootstrapping down to just readiness polling. All infra setup is now the regtest submodule's responsibility.

  5. Dependency bump@kukks/bitcoin-descriptors 3.2.2 → 3.2.3, lockfile consistent.

⚠️ Notes / Questions

  1. Submodule branch: .gitmodules points to branch = feat/shared-regtest-env-discovery rather than main. This is fine while arkade-regtest#1 is in flight, but should be updated to main once that PR merges to avoid tracking a stale feature branch long-term.

  2. Container name change: Failure log capture changed from docker logs arkd to docker logs ark. Make sure arkade-regtest actually names the container ark — if it's still arkd, CI failure logs will silently miss the server output.

  3. Go toolchain in CI: The integration job installs go 1.23 via actions/setup-go. Is this needed by start-env.sh (e.g., building arkd from source), or does the pinned ARKD_IMAGE=ghcr.io/arkade-os/arkd:v0.9.0 mean it pulls a pre-built image? If the latter, the Go setup step can be dropped to speed up CI.

  4. ARK_ENV=docker: Added as env var for integration tests. Confirm this is picked up correctly by the test config to point at the regtest services.

  5. Boltz readiness check: New waitForBoltzPairs() polls localhost:9069/v2/swap/submarine for ARK pairs. Good addition — the old setup didn't have this and likely had race conditions with Boltz availability.

🔒 Security

  • No credential exposure in the diff
  • Regtest-only configuration (no mainnet/signet paths affected)
  • Pre-built images pinned to v0.9.0 — deterministic

Verdict

Clean infrastructure migration. The submodule approach is the right call for standardizing regtest across SDKs. The three notes above are minor — none are blocking.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (5)
.gitmodules (1)

4-4: Use a stable branch (e.g., master) instead of a feature branch for submodule tracking.

The configured feature branch feat/shared-regtest-env-discovery is temporary by design. Tracking it in .gitmodules risks maintenance issues if the branch is deleted, force-pushed, or rebased. The upstream repository defaults to master; prefer this stable branch for reliable CI workflows.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitmodules at line 4, Update the .gitmodules configuration to track a
stable upstream branch instead of the temporary feature branch: replace the
branch value "feat/shared-regtest-env-discovery" with a stable branch like
"master" in the .gitmodules entry (the "branch = ..." line) so submodule
tracking uses the upstream's default stable branch; commit the updated
.gitmodules change.
.github/workflows/ci.yml (2)

73-83: Build job runs independently — consider if this is intentional.

The build job has no needs clause, so it runs in parallel with lint/unit. This is fine if you want build verification regardless of test results. However, if build artifacts aren't useful when tests fail, adding needs: [lint, unit] would save CI minutes on failing PRs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 73 - 83, The build job currently runs
independently as "build" and has no needs clause; if you want it to wait for
lint and unit jobs and avoid running when they fail, add a needs: [lint, unit]
entry to the "build" job definition so the build job depends on those jobs
completing successfully.

44-47: Cache key may not capture all relevant changes.

The cache key only hashes regtest/.env.defaults and .env.regtest, but if the regtest submodule itself changes (e.g., different scripts, docker-compose files), the cache won't invalidate.

Consider including the submodule commit hash or a version file in the cache key:

💡 Alternative cache key with submodule revision
       - uses: actions/cache@v4
         with:
           path: regtest/_build
-          key: nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}
+          key: regtest-${{ hashFiles('regtest/.env.defaults', '.env.regtest', 'regtest/**/*.sh', 'regtest/docker-compose*.yml') }}

Or use a restore-keys pattern for partial cache hits:

          key: regtest-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}-${{ github.sha }}
          restore-keys: |
            regtest-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}-
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 44 - 47, Update the actions/cache step
that uses actions/cache@v4 (the key currently hashing 'regtest/.env.defaults'
and '.env.regtest') so the cache key also reflects changes to the regtest
submodule or repo revision; for example, append the regtest submodule commit or
use github.sha (or a regtest version file) to the key and add a restore-keys
pattern for partial hits to ensure the cache invalidates when regtest content
changes.
test/setup.mjs (2)

49-62: The docker argument passed to this script is unused.

The test:setup-docker script passes "docker" as an argument (node test/setup.mjs docker), but this script never references process.argv. If the parameter is intentionally unused after simplification, consider either:

  1. Removing the parameter from test:setup-docker in package.json, or
  2. Adding a comment explaining that arkade-regtest handles all environment differences internally.

This is a minor cleanup to avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/setup.mjs` around lines 49 - 62, The package.json script
test:setup-docker currently calls node test/setup.mjs with a "docker" argument
that the setup() script ignores; either remove the extra argument from the
test:setup-docker script, or make the intent explicit in setup.mjs by reading
process.argv (e.g., check for "docker") or adding a clarifying comment near the
top of the file explaining that arkade-regtest handles environment differences
and the CLI argument is intentionally unused; update the test:setup-docker entry
or the top of the setup.mjs file and keep references to the setup() function and
process.argv to locate the change.

51-54: Add esplora readiness check to setup.

Integration tests use EsploraProvider("http://localhost:3000") for on-chain queries. The current setup only verifies ark server (7070) and Boltz (9069) are ready, but doesn't confirm esplora is responsive. If esplora takes longer to initialize than ark/Boltz, tests may fail intermittently on first blockchain query.

💡 Proposed addition
 async function setup() {
     try {
         await waitForArkServer();
         await waitForBoltzPairs();
+        await waitForEsplora();
         console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");

Add a similar polling function:

async function waitForEsplora(maxRetries = 30, retryDelay = 2000) {
    console.log("Waiting for Esplora...");
    for (let i = 0; i < maxRetries; i++) {
        try {
            execSync("curl -s http://localhost:3000/blocks/tip/height", {
                stdio: "pipe",
            });
            console.log("  ✔ Esplora ready");
            return true;
        } catch {
            if (i < maxRetries - 1) {
                console.log(`  Waiting... (${i + 1}/${maxRetries})`);
            }
            await sleep(retryDelay);
        }
    }
    throw new Error("Esplora failed to be ready after maximum retries");
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/setup.mjs` around lines 51 - 54, Add an esplora readiness poll to ensure
Esplora is responsive before tests: implement a new helper function
waitForEsplora(maxRetries = 30, retryDelay = 2000) that repeatedly curl-requests
http://localhost:3000/blocks/tip/height (or equivalent HTTP GET) with retries
and sleep, logs progress and throws if exhausted, then call await
waitForEsplora() inside setup() alongside waitForArkServer() and
waitForBoltzPairs(); reference EsploraProvider("http://localhost:3000") in
comments/tests to show why this check is required.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 73-83: The build job currently runs independently as "build" and
has no needs clause; if you want it to wait for lint and unit jobs and avoid
running when they fail, add a needs: [lint, unit] entry to the "build" job
definition so the build job depends on those jobs completing successfully.
- Around line 44-47: Update the actions/cache step that uses actions/cache@v4
(the key currently hashing 'regtest/.env.defaults' and '.env.regtest') so the
cache key also reflects changes to the regtest submodule or repo revision; for
example, append the regtest submodule commit or use github.sha (or a regtest
version file) to the key and add a restore-keys pattern for partial hits to
ensure the cache invalidates when regtest content changes.

In @.gitmodules:
- Line 4: Update the .gitmodules configuration to track a stable upstream branch
instead of the temporary feature branch: replace the branch value
"feat/shared-regtest-env-discovery" with a stable branch like "master" in the
.gitmodules entry (the "branch = ..." line) so submodule tracking uses the
upstream's default stable branch; commit the updated .gitmodules change.

In `@test/setup.mjs`:
- Around line 49-62: The package.json script test:setup-docker currently calls
node test/setup.mjs with a "docker" argument that the setup() script ignores;
either remove the extra argument from the test:setup-docker script, or make the
intent explicit in setup.mjs by reading process.argv (e.g., check for "docker")
or adding a clarifying comment near the top of the file explaining that
arkade-regtest handles environment differences and the CLI argument is
intentionally unused; update the test:setup-docker entry or the top of the
setup.mjs file and keep references to the setup() function and process.argv to
locate the change.
- Around line 51-54: Add an esplora readiness poll to ensure Esplora is
responsive before tests: implement a new helper function
waitForEsplora(maxRetries = 30, retryDelay = 2000) that repeatedly curl-requests
http://localhost:3000/blocks/tip/height (or equivalent HTTP GET) with retries
and sleep, logs progress and throws if exhausted, then call await
waitForEsplora() inside setup() alongside waitForArkServer() and
waitForBoltzPairs(); reference EsploraProvider("http://localhost:3000") in
comments/tests to show why this check is required.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 985d410d-fce9-43ec-9f34-f5d16ac90370

📥 Commits

Reviewing files that changed from the base of the PR and between 449bdb5 and fac2994.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .env.regtest
  • .github/workflows/ci.yml
  • .gitmodules
  • docker-compose.yml
  • package.json
  • regtest
  • server.Dockerfile
  • test/setup.mjs
  • wallet.Dockerfile
💤 Files with no reviewable changes (3)
  • server.Dockerfile
  • wallet.Dockerfile
  • docker-compose.yml

Git submodules on Windows lose execute permissions. Ensure
scripts are executable before running in CI.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 PR Review — ts-sdk#386

Sibling PR: boltz-swap#106 (same pattern, same submodule commit)

Summary

Replaces the bespoke Docker infrastructure (docker-compose.yml, server.Dockerfile, wallet.Dockerfile) with the shared arkade-regtest submodule. CI is split into 4 parallel jobs (lint → unit → integration → build). Test setup slimmed from ~250 lines of imperative provisioning to just readiness polling. Also bumps @kukks/bitcoin-descriptors 3.2.2 → 3.2.3.

Key Observations

Architecture — good:

  • Net -508 lines. Massive reduction in per-repo maintenance burden.
  • CI parallelism (lint + unit run independently; integration gates on both) should cut wall-clock time.
  • pnpm install --frozen-lockfile in CI is the correct lockfile discipline.
  • actions/cache@v4 for regtest/_build avoids re-downloading nigiri images on every run.

Submodule branch pinning:

  • .gitmodules tracks feat/shared-regtest-env-discovery, not main. If that branch gets rebased or force-pushed, CI will break for any fresh clone. Worth merging arkade-regtest#1 first, then switching this to track main.

Test setup (test/setup.mjs):

  • Now just polls waitForArkServer and waitForBoltzPairs. The old wallet-create/unlock/fund/note-redeem logic is gone — presumably arkade-regtest handles that internally. If any test relies on the ark-cli VTXO that the old setup redeemed, it will fail silently. Worth confirming integration tests still pass end-to-end with the new flow.

CI log capture:

  • Logs capture docker logs ark (not arkd). Container names presumably changed in arkade-regtest. Consistent with the submodule design, but verify the names match what start-env.sh creates.

Dep bump:

  • @kukks/bitcoin-descriptors 3.2.2 → 3.2.3. Changelog/diff not visible here but low risk given it's a patch bump on a first-party package.

Security

  • No secrets in .env.regtest (just image tags). ✅
  • Old hardcoded signer key (afcd3fa1...) and test passwords removed with the Dockerfiles. ✅
  • submodules: true in CI checkout is required and present. ✅

Verdict

Clean infra consolidation. Main risk is the feature-branch submodule reference — recommend merging arkade-regtest#1 and updating .gitmodules to track main before or shortly after this merges.

- Change arkdExec container from 'arkd' to 'ark' (arkade-regtest name)
- Add nigiri build dir to GITHUB_PATH so tests can find the binary
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 Review: arkade-regtest submodule migration

Substantial cleanup — removes 510 lines including docker-compose.yml, server.Dockerfile, wallet.Dockerfile, and most of test/setup.mjs. Replaces with the shared regtest submodule. Also bumps @kukks/bitcoin-descriptors 3.2.2→3.2.3 (Vite browser fix).

Observations:

  1. Container name change: arkdExec in test/e2e/utils.ts changed from docker exec -t arkd to docker exec -t ark — matches arkade-regtest naming. Good catch in the latest commit.
  2. CI structure: Parallel lint/unit/build → integration (gated on lint+unit). Build job runs independently — could gate integration on build too for consistency (boltz-swap does needs: [lint, unit, build]).
  3. nigiri PATH: echo "${{ github.workspace }}/regtest/_build/nigiri/build" >> $GITHUB_PATH — ensures nigiri binary is available for test commands. Not present in boltz-swap CI — verify if boltz-swap tests need it too.
  4. ARK_ENV=docker: Set on integration step — drives the arkdExec path in utils.ts. With the hardcoded change to docker exec -t ark, the ARK_ENV guard is gone from utils.ts. The env var still controls vitest config via test:integration-docker script, so this is fine.
  5. Setup simplification: test/setup.mjs now just waits for arkd readiness + Boltz ARK/BTC pairs. All wallet creation/funding/fulmine setup delegated to arkade-regtest. Much cleaner.
  6. Submodule branch: feat/shared-regtest-env-discovery — update to main after ArkLabsHQ/arkade-regtest#1 merges.
  7. Image pins: .env.regtest pins arkd/arkd-wallet to v0.9.0. Note boltz-swap pins v0.8.11 — intentional per-SDK version targeting.
  8. bitcoin-descriptors bump: 3.2.2→3.2.3 fixes Vite browser builds by replacing createRequire with dynamic import() for optional miniscript dep. Good fix included here.

Cross-repo: Coordinated with arkade-os/boltz-swap#106, arkade-os/dotnet-sdk#56, and ArkLabsHQ/arkade-regtest#1.

Clean migration. Minor: consider aligning the needs array for integration job with boltz-swap (add build dependency).

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 Arkana Review — ts-sdk#386

Clean migration from bespoke docker-compose to arkade-regtest submodule. Net -510 lines of duplicated infra is the right direction.

Highlights

  • CI split into 4 parallel jobs (lint, unit, integration, build) — better feedback loop
  • Dockerfiles removed — no more building arkd from source in ts-sdk CI. Pins to ghcr.io/arkade-os/arkd:v0.9.0 via .env.regtest
  • Container name fix arkdark in test/e2e/utils.ts — matches nigiri's naming convention
  • test/setup.mjs trimmed from ~230 lines of infra setup to just readiness checks — correct separation of concerns

Observations

1. Submodule branch should point to master post-merge
.gitmodules currently tracks feat/shared-regtest-env-discovery:

[submodule "regtest"]
	branch = feat/shared-regtest-env-discovery

This is fine for coordinated development, but must be updated to master (or removed — git defaults to remote HEAD) before this PR merges. Otherwise CI will track a stale feature branch.

2. Dependency bump sneaked in
@kukks/bitcoin-descriptors bumped 3.2.2 → 3.2.3. Not related to the regtest migration — consider splitting into a separate commit for clean bisection.

3. chmod +x in CI is a workaround

run: chmod +x regtest/*.sh regtest/helpers/*.sh && ./regtest/start-env.sh

Git should preserve execute bits if the files are committed with them. If they're losing perms, check .gitattributes in arkade-regtest. The chmod is fine as a safety net but shouldn't be needed long-term.

4. ARK_ENV: docker env var in integration step — good, ensures tests use docker-based URLs.

Cross-Repo

In arkade-regtest, boltz-fulmine uses 7002 and the dedicated
fulmine-delegator uses 7012. Update all test references.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

Followup review (commit 2137f09)

Port fix: delegator 70027012 across all test files (ark.test.ts, settlement.test.ts, utils.ts). Correct — in arkade-regtest, boltz-fulmine occupies port 7002 and the dedicated fulmine-delegator uses 7012. All 8 occurrences updated consistently.

Cross-repo note: arkade-os/dotnet-sdk#56 and arkade-os/boltz-swap#106 are the sibling PRs for this same regtest migration.

LGTM ✅

Kukks added 2 commits March 26, 2026 12:45
- Enable ARKD_ALLOW_CSV_BLOCK_TYPE (needed for VHTLC tests)
- Set ARKD_VTXO_TREE_EXPIRY=20 and ARKD_BOARDING_EXIT_DELAY=1024
- Set zero fees (tests manage fees via setFees()/clearFees())
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 Arkana Review — Updated Commits

Scope: Replace bespoke docker-compose + Dockerfiles with arkade-regtest submodule, restructure CI into parallel jobs.

What Changed (vs. previous review)

New commits update the submodule pointer to 16d9940 which includes .env auto-discovery, ARKD_IMAGE override, and delegator service support.

Architecture

Net deletion of 518 lines (128 added, 518 removed). The docker-compose.yml, server.Dockerfile, wallet.Dockerfile are all gone — replaced by the submodule. Clean migration.

.env.regtest — ts-sdk Specific Config

ARKD_IMAGE=ghcr.io/arkade-os/arkd:v0.9.0
ARKD_WALLET_IMAGE=ghcr.io/arkade-os/arkd-wallet:v0.9.0
ARKD_ALLOW_CSV_BLOCK_TYPE=true
ARKD_VTXO_TREE_EXPIRY=20
ARKD_BOARDING_EXIT_DELAY=1024
ARK_OFFCHAIN_INPUT_FEE="0.0"
...

This preserves the exact arkd config that was in the old docker-compose.yml — good. The zero-fee config is important since ts-sdk tests manage fees via setFees()/clearFees().

CI Restructure

Split monolithic test job into lint, unit, integration, build running in parallel where possible. integration depends on [lint, unit] — fast-fail pattern. The submodules: true checkout and Go setup (for nigiri build) are correctly placed.

Test File Changes

  • test/e2e/ark.test.ts: Container name arkdark (6 occurrences). Matches arkade-regtest's naming.
  • test/e2e/settlement.test.ts: Same container rename.
  • test/e2e/utils.ts: REST endpoint updated to match new container setup.
  • test/setup.mjs: Massively simplified — 230 lines deleted, 16 added. Now just waits for service readiness instead of orchestrating infrastructure.

Cross-Repo

Depends on ArkLabsHQ/arkade-regtest#1 (submodule source). Sibling PRs: arkade-os/boltz-swap#106, arkade-os/dotnet-sdk#56.

Potential Issue

The ARK_OFFCHAIN_INPUT_FEE / ARK_ONCHAIN_INPUT_FEE etc. variables — verify these are actually consumed by the arkd-override compose file in arkade-regtest. The current docker-compose.arkd-override.yml doesn't pass these through. If they're needed, the override compose needs additional env vars, or they need to be set via the arkd config mechanism rather than docker env.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

Followup review (commit df75647): Bumps arkade-regtest submodule to pick up the env vars export fix (delegator ports + arkd config vars). No SDK-side changes. LGTM.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.env.regtest:
- Around line 11-14: The fee environment variables ARK_OFFCHAIN_INPUT_FEE,
ARK_ONCHAIN_INPUT_FEE, ARK_OFFCHAIN_OUTPUT_FEE, and ARK_ONCHAIN_OUTPUT_FEE are
quoted which is inconsistent with other numeric env values and may be parsed as
strings; remove the surrounding quotes so each is set as an unquoted numeric
literal (e.g., ARK_OFFCHAIN_INPUT_FEE=0.0) to match ARKD's numeric formatting
and other vars like ARKD_VTXO_TREE_EXPIRY and ARKD_BOARDING_EXIT_DELAY.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2cdcd6a-dc69-4f7b-8647-009d12318f5a

📥 Commits

Reviewing files that changed from the base of the PR and between 6f87195 and a479f49.

📒 Files selected for processing (2)
  • .env.regtest
  • regtest
✅ Files skipped from review due to trivial changes (1)
  • regtest

Comment on lines +11 to +14
ARK_OFFCHAIN_INPUT_FEE="0.0"
ARK_ONCHAIN_INPUT_FEE="0.0"
ARK_OFFCHAIN_OUTPUT_FEE="0.0"
ARK_ONCHAIN_OUTPUT_FEE="0.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if other .env files in arkade-regtest use quotes for numeric values

# Search for numeric environment variable assignments in the regtest submodule
fd -e env -e env.example . regtest/ --exec cat {} \; | grep -E '(FEE|DELAY|EXPIRY).*=' | head -20

Repository: arkade-os/ts-sdk

Length of output: 42


🏁 Script executed:

# Check repository structure and locate env files
ls -la
find . -name ".env*" -type f 2>/dev/null | head -20

Repository: arkade-os/ts-sdk

Length of output: 1787


🏁 Script executed:

# Check if regtest is a submodule and explore its contents
git config --file=.gitmodules --name-only --get-regexp path 2>/dev/null || echo "No submodules or .gitmodules not found"
ls -la | grep regtest

Repository: arkade-os/ts-sdk

Length of output: 207


🏁 Script executed:

# Read the actual .env.regtest file to get full context
cat .env.regtest

Repository: arkade-os/ts-sdk

Length of output: 517


🏁 Script executed:

# Search for how FEE variables are referenced in the codebase
rg "ARK_(?:OFFCHAIN|ONCHAIN)_(?:INPUT|OUTPUT)_FEE" -t json -t ts -t js --max-count=10

Repository: arkade-os/ts-sdk

Length of output: 42


🏁 Script executed:

# Check contents of regtest directory
ls -la regtest/

Repository: arkade-os/ts-sdk

Length of output: 170


🏁 Script executed:

# Search for setFees and clearFees implementations
rg "setFees|clearFees" --max-count=20

Repository: arkade-os/ts-sdk

Length of output: 388


🏁 Script executed:

# Search for .env pattern usage in source files
rg "process\.env|import.*env" src/ --max-count=15

Repository: arkade-os/ts-sdk

Length of output: 166


🏁 Script executed:

# Check if there's any documentation about arkd or fee configuration
find . -name "README*" -o -name "*.md" | xargs grep -l "fee\|FEE" 2>/dev/null | head -5

Repository: arkade-os/ts-sdk

Length of output: 71


🏁 Script executed:

# Read the setFees/clearFees implementation
sed -n '1,100p' test/e2e/utils.ts | cat -n

Repository: arkade-os/ts-sdk

Length of output: 3541


🏁 Script executed:

# Search for the actual implementation of setFees/clearFees function
rg "function setFees|export.*setFees" -A 10

Repository: arkade-os/ts-sdk

Length of output: 640


🏁 Script executed:

# Check README for fee-related documentation
grep -i "fee\|ARK_" README.md | head -30

Repository: arkade-os/ts-sdk

Length of output: 845


Remove quotes from fee environment variables for consistency with other numeric values.

The fee variables use quoted values ("0.0") while other numeric environment variables in the same file (ARKD_VTXO_TREE_EXPIRY=20, ARKD_BOARDING_EXIT_DELAY=1024) are unquoted. This inconsistency could potentially cause arkd's parser to treat fees as strings rather than numbers, even if the actual value is the same. Standardize by removing the quotes:

ARK_OFFCHAIN_INPUT_FEE=0.0
ARK_ONCHAIN_INPUT_FEE=0.0
ARK_OFFCHAIN_OUTPUT_FEE=0.0
ARK_ONCHAIN_OUTPUT_FEE=0.0
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 11-11: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 12-12: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 13-13: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 13-13: [UnorderedKey] The ARK_OFFCHAIN_OUTPUT_FEE key should go before the ARK_ONCHAIN_INPUT_FEE key

(UnorderedKey)


[warning] 14-14: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.regtest around lines 11 - 14, The fee environment variables
ARK_OFFCHAIN_INPUT_FEE, ARK_ONCHAIN_INPUT_FEE, ARK_OFFCHAIN_OUTPUT_FEE, and
ARK_ONCHAIN_OUTPUT_FEE are quoted which is inconsistent with other numeric env
values and may be parsed as strings; remove the surrounding quotes so each is
set as an unquoted numeric literal (e.g., ARK_OFFCHAIN_INPUT_FEE=0.0) to match
ARKD's numeric formatting and other vars like ARKD_VTXO_TREE_EXPIRY and
ARKD_BOARDING_EXIT_DELAY.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

Iterative review (commit a479f49)

Three new commits since last review:

  1. 3bef99c — Adds ts-sdk-specific arkd config to .env.regtest: ARKD_ALLOW_CSV_BLOCK_TYPE=true (needed for VHTLC tests), tree expiry=20, boarding delay=1024, and zero-fee overrides for test isolation
  2. df75647 — Bumps regtest submodule for env vars export fix
  3. a479f49 — Bumps regtest submodule to always recreate arkd (ensures env var changes apply)

The .env.regtest now fully reproduces the old docker-compose.yml arkd config. The quoted fee values ("0.0") are cosmetic — bash sources them as strings but arkd parses them as numbers either way.

All four coordinated PRs are aligned on the latest arkade-regtest commit. LGTM ✅

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 Arkana PR Review — ts-sdk#386 (iterative)

feat: use arkade-regtest for regtest environment

Changes Since Last Review

New commit f774d10 — continued refinement of the arkade-regtest migration.

.env.regtest

  • ✅ Pins arkd to v0.9.0 (correct for ts-sdk which tests against latest)
  • ARKD_ALLOW_CSV_BLOCK_TYPE=true — preserved from old docker-compose
  • ✅ Zero fee overrides (ARK_OFFCHAIN_INPUT_FEE, ARK_ONCHAIN_INPUT_FEE, etc.) — ts-sdk tests manage fees individually via setFees()/clearFees(), so zero defaults are correct

CI Workflow

  • ✅ Split into lint, unit, integration, build jobs
  • ✅ Integration depends on [lint, unit] — gates on fast jobs first
  • submodules: true in checkout for integration job
  • ARK_ENV=docker set correctly for integration tests
  • ✅ Go 1.23 + nigiri cache pattern matches other SDKs

Test Port Updates

  • Delegator REST endpoint updated from localhost:7002localhost:7012 across 6 test locations — this aligns with the shared regtest environment's fulmine-delegator port mapping

Dependency Bump

  • @kukks/bitcoin-descriptors 3.2.2 → 3.2.3

Removed

  • docker-compose.yml (128 lines), server.Dockerfile, wallet.Dockerfile — all replaced by submodule

Security

  • ✅ No credentials in .env.regtest
  • ✅ Signer key handled by shared regtest defaults only
  • ✅ No protocol-sensitive changes in test modifications — port remapping only

Cross-Repo

Submodule at 45a3b0f — aligned with boltz-swap#106 and dotnet-sdk#56. All three SDK repos now use identical arkade-regtest infrastructure.

No blocking issues.


Review by Arkana 🤖

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

Iterative review0b6c0e2 (bump arkade-regtest submodule)

Submodule pointer update to e368a88 — picks up the ARKD_WALLET_NETWORK and ARKD_UNLOCKER_TYPE fixes in the override compose. Consistent with boltz-swap#106 and dotnet-sdk#56. LGTM ✅

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 26, 2026

🔍 Arkana PR Review

Overall: Comprehensive migration to shared arkade-regtest. Largest of the three regtest migration PRs but well-structured.

CI refactor ✅

  • Split into lint, unit, integration, buildintegration depends on [lint, unit]
  • Submodules checked out, Go 1.23 for nigiri, cache key based on regtest defaults + overrides
  • ARK_ENV=docker correctly set for integration tests

.env.regtest overrides ✅

  • Pins arkd/arkd-wallet to v0.9.0 (matches old docker-compose)
  • ARKD_ALLOW_CSV_BLOCK_TYPE=true preserved — important for ts-sdk tests
  • All fee overrides set to "0.0" — tests manage fees individually via setFees()/clearFees()

Test updates ✅

  • Container ref arkdark updated across utils.ts, ark.test.ts, settlement.test.ts, and setup scripts
  • Delegator port 70027012 updated in 7 locations — consistent with arkade-regtest's delegator port mapping
  • Setup scripts simplified to just readiness checks (ark server + Boltz pairs)

Dependency bump

  • @kukks/bitcoin-descriptors 3.2.2 → 3.2.3 — lockfile updated, looks clean

Removed files ✅

  • docker-compose.yml, server.Dockerfile, wallet.Dockerfile all removed
  • No orphaned references

Submodule branch note

Same as the other PRs — tracks feat/shared-regtest-env-discovery. Update after arkade-regtest#1 merges.

No security concerns. No blocking issues.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review

Overall: Clean migration to shared regtest infrastructure. Massive reduction in duplicated infra code (-512 lines).

✅ What looks good

  • Deleted docker-compose.yml, server.Dockerfile, wallet.Dockerfile — removes ~300 lines of duplicated container definitions.
  • CI split into lint/unit/integration/build jobs — much better structure. integration depends on lint and unit, failing fast on cheaper checks.
  • .env.regtest overrides are well-considered: ARKD_SCHEDULER_TYPE=block and ARKD_VTXO_TREE_EXPIRY=20 match the old config exactly.
  • Zero-fee overrides (ARK_OFFCHAIN_INPUT_FEE="0.0" etc.) — correctly preserves existing test behavior where tests manage fees via setFees()/clearFees().
  • Delegator port update (7002 → 7012) across all test files — consistent with arkade-regtest's new dedicated delegator ports.
  • test/setup.mjs simplified from ~250 lines of infra orchestration to ~40 lines of readiness checks. Clean.
  • Container name change (arkdark) properly reflected in utils.ts.

⚠️ Observations

  1. .gitmodules points to branch feat/shared-regtest-env-discovery — this needs updating to main/master once arkade-regtest#1 merges. Leaving a feature branch reference in .gitmodules is fragile.

  2. Submodule pinned at 310abac7 (old commit) — the regtest PR has new commits (150fe38b). May need a submodule update before merging.

  3. chmod +x regtest/*.sh regtest/helpers/*.sh in CI — this suggests the submodule doesn't preserve execute bits. Consider adding *.sh text eol=lf and ensuring +x in the regtest repo itself, so consumers don't all need this workaround.

  4. ARK_OFFCHAIN_INPUT_FEE etc. — these variables appear to be new additions not yet present in arkade-regtest's .env.defaults. Verify these are actually consumed by the arkd-override compose file, or they may be silently ignored.

  5. pnpm test:setup-docker is now just readiness checks, but the npm script name still includes "docker" which is slightly misleading. Minor nit.

🔒 Security

  • No concerns. Regtest-only configuration, no production credentials.
  • Deterministic signer key inherited from arkade-regtest defaults.

Cross-repo impact

  • Depends on arkade-regtest#1 landing first.
  • Port changes (delegator 7002→7012) align with arkade-regtest's new port scheme. Other SDKs using delegator features will need similar updates.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — ts-sdk#386

Scope: Replace custom docker-compose, Dockerfiles, and CI setup with arkade-regtest submodule.

Infrastructure Cleanup — Excellent ✅

Deletes 512 lines of bespoke infrastructure (docker-compose.yml, server.Dockerfile, wallet.Dockerfile) and replaces with 125 lines of config + submodule pointer. Net -387 lines of infrastructure debt.

Security Review ✅

  • No credential changes beyond what's in arkade-regtest
  • .env.regtest pins to arkd:v0.9.0 — appropriate version for ts-sdk test suite
  • Zero-fee overrides (ARK_OFFCHAIN_INPUT_FEE="0.0" etc.) are test-specific and clearly documented

Findings

1. Port change: delegator at 7012 instead of 7002 ✅ Correct
All RestDelegatorProvider references updated from http://localhost:7002 to http://localhost:7012 across ark.test.ts, settlement.test.ts, and utils.ts. This aligns with arkade-regtest's new dedicated delegator service ports.

2. Container name change: arkdark ✅ Correct
utils.ts updates arkdExec from docker exec -t arkd to docker exec -t ark. Matches arkade-regtest's docker-compose.arkd-override.yml container naming.

3. CI restructured into 4 parallel jobs ✅ Good improvement
Split into lint, unit, integration, build with integration depending on lint + unit. Faster feedback on lint/unit failures before spinning up docker infra.

4. test/setup.mjs drastically simplified
From ~300 lines of server/fulmine/LND setup to a lightweight readiness check (waitForArkServer + waitForBoltzPairs). All infrastructure responsibility correctly delegated to arkade-regtest.

5. Submodule points to feature branch ⚠️ Important
.gitmodules references branch = feat/shared-regtest-env-discovery. The submodule commit is 150fe38b but arkade-regtest#1 has new commits (0e637a57). Before merge:

  • Update submodule to latest arkade-regtest commit
  • After arkade-regtest#1 merges, update branch reference to main

6. Missing --frozen-lockfile in old CI, added in new
The new CI uses pnpm install --frozen-lockfile — better reproducibility.

Cross-Repo Dependencies

  • Depends on: ArkLabsHQ/arkade-regtest#1 (must merge first)
  • Related: arkade-os/wallet#492 (parallel migration)

Verdict

Clean migration. The test setup simplification is the highlight — removing hundreds of lines of duplicated Docker orchestration in favor of a single submodule call. Update the submodule ref before merge.

Set BITCOIN_LOW_FEE=false to avoid restarting bitcoind, which breaks
nbxplorer's connection and causes arkd to have zero balance.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

Iterative review — new commit f23c2606 (skip Bitcoin Core restart)

Same fix as wallet#492: BITCOIN_LOW_FEE=false prevents the bitcoind restart that was breaking nbxplorer. Good.

CI status: lint ✅, unit ✅, build ✅, integration ⏳ (still running). The integration job is the key one since it exercises the full regtest stack.

Note: ts-sdk has ARK_OFFCHAIN_INPUT_FEE="0.0" etc. in .env.regtest for zero fees. These are set via setup_arkd_fees in arkade-regtest and should work regardless of BITCOIN_LOW_FEE — they're Ark protocol-level fees, not Bitcoin Core relay fees.

Same submodule pin note as wallet: still at 0e637a57, may want to bump to 1ae32d87 for the server wallet funding fix.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Review — arkade-regtest migration (ts-sdk)

Net: +128 / −512 — removes custom docker-compose.yml, server.Dockerfile, wallet.Dockerfile in favor of the shared arkade-regtest submodule. Major cleanup.

✅ What works well

  • CI split into parallel jobs (lint, unit, build run independently; integration gates on lint+unit) — good structure
  • Setup script reduced to readiness checkswaitForArkServer() + waitForBoltzPairs(), all orchestration delegated to arkade-regtest
  • Delegator port updated 7002 → 7012 consistently across all 7 test references (ark.test.ts, settlement.test.ts, utils.ts)
  • arkdExec updated from docker exec -t arkd to docker exec -t ark
  • BITCOIN_LOW_FEE=false — prevents nbxplorer disconnection from bitcoind restart
  • ARKD_ALLOW_CSV_BLOCK_TYPE correctly configured for VHTLC tests
  • Merge conflict resolution with master (dependency rename) handled cleanly

⚠️ Notes

  1. Submodule tracks feature branch.gitmodules points to feat/shared-regtest-env-discovery. Update to main after ArkLabsHQ/arkade-regtest#1 merges.

  2. Pins v0.9.0 while boltz-swap pins v0.8.11 — intentional version difference. Both correctly set ARKD_SCHEDULER_TYPE=block for their respective versions.

  3. 50 commits — iterative submodule bumps. Squash-merge recommended.

  4. build job has no needs — runs fully parallel. Fine, but means integration can start before build succeeds. Not blocking since integration does its own install+build.

Cross-repo context

Parallel PR: arkade-os/boltz-swap#106 (same migration, pins v0.8.11). Both depend on ArkLabsHQ/arkade-regtest#1.

No security concerns — test infrastructure only.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — ts-sdk#386

Scope: Replace custom docker-compose + Dockerfiles with arkade-regtest submodule. Pin arkd v0.9.0.

Changes — Clean Migration ✅

Infrastructure removal: Deletes docker-compose.yml (128 lines), server.Dockerfile (39 lines), wallet.Dockerfile (32 lines). All infrastructure now delegated to arkade-regtest.

CI restructured into parallel lint / unit / build jobs with integration gated on lint+unit. Good CI hygiene — faster feedback on simple failures.

Key Observations

1. Delegator port change: 70027012
Multiple test files updated (ark.test.ts, settlement.test.ts, utils.ts). This aligns with arkade-regtest#1 adding the fulmine-delegator service on ports 7010-7012. The original fulmine on 7002 is the non-delegator instance. Correct separation.

2. arkdExec changed from docker exec -t arkddocker exec -t ark
Container name change reflects arkade-regtest's naming (ark instead of arkd). All references updated consistently.

3. test/setup.mjs reduced from ~230+ lines to ~35 lines
Now just waitForArkServer() + waitForBoltzPairs() readiness checks. All wallet creation, funding, fulmine setup delegated to arkade-regtest. Clean.

4. Submodule tracks feature branch
.gitmodules tracks branch = feat/shared-regtest-env-discovery. Expected since arkade-regtest#1 isn't merged yet. Will need to update to master/main post-merge.

5. .env.regtest sets zero fees

ARK_OFFCHAIN_INPUT_FEE="0.0"
...

With comment: "ts-sdk tests manage fees individually via setFees()/clearFees()". Makes sense — tests control fee state explicitly.

Potential Issue

test/setup.mjswaitForBoltzPairs checks localhost:9069
This assumes the nginx CORS proxy is running. The old setup had a custom cors.nginx.conf in the repo. Now it's provided by arkade-regtest's nginx-boltz service. Should work, but if the nginx-boltz startup is slow, this could be flaky. The 30-retry loop should handle it.

Verdict

Straightforward migration. Port changes are correct. Test setup simplification is a big win. 👍

Kukks added 2 commits March 29, 2026 20:43
- ARKD_VTXO_TREE_EXPIRY 20 -> 512 (prevents expiry during setup)
- Update regtest submodule to eecb40e (passes zero-fee config to arkd,
  fixing "Insufficient funds" in asset issuance tests)
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

Follow-up review (new commits: 5842c35..0949f5d)

Two submodule bumps tracking arkade-regtest fixes:

  1. Fund Boltz Bitcoin Core wallet for on-chain swap operations
  2. Increase server funding to 21 BTC + ARK fee env var passthrough (eecb40e)

The fee passthrough fix is important for ts-sdk — the zero fees in .env.regtest were previously not reaching the arkd container. Tests that call setFees()/clearFees() via the admin API would not be affected, but any test relying on the default fee config would see unexpected 1% input fees.

LGTM.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — ts-sdk#386

Summary: Migrates ts-sdk regtest infra to shared arkade-regtest submodule. Removes docker-compose.yml (~128 lines), server.Dockerfile, wallet.Dockerfile. Pins arkd to v0.9.0. Updates test port references for new container naming.

✅ Looks Good

  • CI split into 4 jobs (lint, unit, integration, build) — integration depends on lint+unit, clean parallel execution.
  • Port migration done correctly7002 → 7012 for delegator REST endpoint across all test files (ark.test.ts, settlement.test.ts, utils.ts). Container name arkd → ark updated in arkdExec.
  • .env.regtest zero fees — documented that ts-sdk tests manage fees via setFees()/clearFees(), so regtest defaults to zero. Clean.
  • setup.mjs reduced from ~250 lines to just waitForArkServer() + waitForBoltzPairs().

📝 Notes

  1. Container name change arkd → ark — this is a breaking change for anyone running regtest locally with the old setup. The migration path is clear (just use regtest:clean && regtest:start), but worth mentioning in the PR description for contributors.
  2. waitForBoltzPairs() checks for ARK in the submarine swap response — simple but effective. If the response format changes, this will silently fail with a timeout. A JSON parse + key check would be more robust, but fine for test infra.
  3. Same submodule branch tracking notefeat/shared-regtest-env-discovery should merge before these PRs or be updated to track main.
  4. ARK_ENV=docker env var in CI integration step — good, ensures tests use the correct container endpoints.
  5. Removed test:build-docker, test:up-docker, test:down-docker scripts — clean removal, no dead references left.

🔒 Security

  • No credential exposure. Hardcoded test keys removed along with the deleted Dockerfiles.
  • No production paths affected.

Verdict: Clean migration. No blockers.

ARKD_ALLOW_CSV_BLOCK_TYPE=true is required when SCHEDULER_TYPE=block,
otherwise VTXO_TREE_EXPIRY=512 is interpreted as seconds and arkd
refuses to start.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

Iterative review — new commit: 4807dff7 (fix: enable CSV block type for block-based scheduler)

Correct fix. When ARKD_SCHEDULER_TYPE=block, arkd interprets ARKD_VTXO_TREE_EXPIRY as blocks, but without ARKD_ALLOW_CSV_BLOCK_TYPE=true, the value 512 gets treated as seconds and arkd rejects it. This aligns with the same pattern used in wallet#492 (.env.regtest has ARKD_ALLOW_CSV_BLOCK_TYPE already).

The .env.regtest config is now internally consistent:

  • ARKD_SCHEDULER_TYPE=block + ARKD_ALLOW_CSV_BLOCK_TYPE=true + ARKD_VTXO_TREE_EXPIRY=512

LGTM.

Kukks added 2 commits March 29, 2026 22:50
arkd interprets values >= 512 as seconds (BIP 112 threshold). Set to
200 blocks which survives the ~30 block setup while staying in the
block-interpretation range. Also enable ALLOW_CSV_BLOCK_TYPE=true.
200 blocks caused timeout in recovery/settleable VTXO tests that need
to mine blocks to trigger expiry. The original 20-block value works
because ts-sdk tests don't mine enough blocks to expire test VTXOs.
The "Insufficient funds" fix is the env var export, not the expiry.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Iterative review — changes since 4807dff

Two new commits:

  1. d650973: set VTXO expiry to 200 (< 512 BIP 112 threshold)
  2. 0e9ce7a: reverted back to 20 blocks — ts-sdk tests that mine blocks to trigger VTXO expiry (recovery/settleable tests) timed out at 200 blocks

The revert reasoning is sound: ts-sdk tests actively mine blocks to trigger expiry, so a low value (20) is intentional. The "Insufficient funds" fix came from the env var export in the submodule, not from changing the expiry value. Good root cause analysis.

Note: This means ts-sdk uses VTXO_TREE_EXPIRY=20 while boltz-swap uses 200. Both are correct for their test profiles — ts-sdk needs fast expiry for recovery tests, boltz-swap needs longer expiry to survive setup.

Cross-repo alignment: All three repos (wallet#492, boltz-swap#106, ts-sdk#386) now share the same submodule commit 1a86cf5. The .env.regtest files correctly diverge per-repo for version-specific needs (v0.9.1/gocron for wallet, v0.8.11/block for boltz-swap, v0.9.0/block for ts-sdk).

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — ts-sdk#386

Summary: Replaces custom docker-compose.yml, server.Dockerfile, and wallet.Dockerfile with shared arkade-regtest submodule. Pins arkd to v0.9.0 with block scheduler.

✅ Looks Good

  • Clean removal of inline Docker build infrastructure — server.Dockerfile was building from golang:1.25.7 with git clone, replaced by pinned GHCR images
  • Delegator port migration (70027012) correctly applied across all 7 references in ark.test.ts, settlement.test.ts, and utils.ts — arkade-regtest uses dedicated port 7012 for the fulmine-delegator
  • CI split into lint/unit/integration/build jobs with proper dependency chain
  • Zero-fee config correct — ts-sdk tests manage fees individually via setFees()/clearFees()
  • VTXO expiry reverted to 20 blocks — final commit correctly explains that 200-block expiry caused timeouts in recovery/settleable VTXO tests that need to mine through expiry. The "Insufficient funds" fix was the env var export, not the expiry value

⚠️ Notes

  • Submodule on feature branch (feat/shared-regtest-env-discovery) — should track main after merge
  • ALLOW_CSV_BLOCK_TYPE=true with VTXO_TREE_EXPIRY=20 — safe since 20 < 512 (BIP 112 threshold), but the flag is needed for VHTLC tests per commit message
  • arkdExec hardcoded to docker exec -t ark in utils.ts (removed the commented-out conditional) — clean simplification since all test paths now use the same container name

🔒 Security

  • No protocol code changes. Test infrastructure only
  • Removed signer key (afcd3fa...) from inline docker-compose is a well-known regtest key — no concern, but good to centralize
  • ARK_ENV=docker passed to integration tests ensures correct endpoint resolution

No blocking issues.

Add [DIAG] logging to "should issue an asset with existing control asset",
"should reissue an asset", and "should get vtxo chain" tests to capture:
- VTXO count, values, and details before/after each issue() call
- Balance state at each step
- dustAmount value
- 2-second wait between sequential issue() calls (matching passing tests)
- Guard against undefined vtxos[0] in indexer test waitFor

Also add CI diagnostic step to dump arkd env, fees, and container state.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 29, 2026

🔍 Arkana — Followup Review (new commit)

New commit: e632b9f6 — adds [DIAG] logging to failing asset issuance + indexer tests.

What changed

  • Extensive console.log("[DIAG]") statements added to:
    • issue-with-existing-control-asset test: logs VTXO counts, balances, dustAmount before/after issuance, adds 2s waits between sequential issues
    • reissue-asset test: same pattern — logs + 2s waits between issues
    • indexer vtxo-chain test: logs poll iterations, adds early-return guard for empty VTXOs
  • 2 second setTimeout waits added between first and second assetManager.issue() calls — round completion timing fix

Assessment

This is diagnostic/debugging code — no protocol, security, or functional changes. The 2s waits suggest a race condition where the second issuance fires before the first round's VTXO is indexed. These waits are a reasonable short-term fix; if the issue persists, a proper waitFor() poll on VTXO availability would be more robust than fixed timeouts.

Note: The [DIAG] logging should be cleaned up before merge — it's noisy for CI output.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 30, 2026

Iterative review (commit ba65ba2)

Single submodule bump: picks up conditional nbxplorer restart from arkade-regtest. Same fix as wallet#492 and boltz-swap#106.

No concerns.

Keep the 2s waits between sequential issue() calls (needed for VTXO
indexing) but strip verbose [DIAG] console.log statements.
@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 30, 2026

Iterative review (commit fef492d4)

Removes all [DIAG] diagnostic logging from ark.test.ts and indexer.test.ts (-82 lines). The functional fixes remain:

  • 2s waits between sequential asset issues (round completion)
  • vtxos[0] guard in indexer chain test

Clean cleanup. LGTM ✅

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 30, 2026

Follow-up review (new commits since last review)

Latest: diagnostic logging removed from e2e tests (kept the 2s waits between sequential issue() calls needed for VTXO indexing), regtest submodule pointed to master.

Config (.env.regtest)

  • arkd v0.9.0, block scheduler with ALLOW_CSV_BLOCK_TYPE=true, VTXO_TREE_EXPIRY=20
  • The 20-block expiry is correct for ts-sdk — tests need to trigger expiry by mining blocks (recovery/settleable VTXO tests)
  • Zero fees + delegator port updated to 7012

Notable learnings from the commit history (valuable for future reference):

  • BIP 112: values ≥ 512 interpreted as seconds, not blocks — the 512 → 200 → 20 revert trail documents this well
  • ROUND_INTERVAL=3 for faster test rounds

CI — Same pattern as sibling PRs: lint/unit/build parallel, integration gated. workflow_dispatch added.

Cross-repo — Aligned with boltz-swap#106, wallet#492, dotnet-sdk#56 on same submodule commit.

No security concerns. Looks good pending integration CI green.

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.

1 participant