Skip to content

fix: gate mempool_api on Fulcrum being healthy - #78

Merged
Kukks merged 2 commits into
ArkLabsHQ:masterfrom
d4rp4t:fix/mempool-wait-for-fulcrum
Oct 1, 2026
Merged

Kukks merged 2 commits into
ArkLabsHQ:masterfrom
d4rp4t:fix/mempool-wait-for-fulcrum

Conversation

@d4rp4t

@d4rp4t d4rp4t commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Fulcrum opens its Electrum listener only after syncing to bitcoind (~40s). mempool_api depended on it with plain depends_on (started), hit ECONNREFUSED, and intermittently never recovered, so the mempool Esplora API wait in start timed out (~10% of runs).

Add a TCP healthcheck to fulcrum and make mempool_api wait on service_healthy.

d4rp4t added 2 commits October 1, 2026 10:48
Fulcrum opens its Electrum listener only after syncing to bitcoind (~40s).
mempool_api depended on it with plain depends_on (started), hit
ECONNREFUSED, and intermittently never recovered, so the mempool Esplora
API wait in `start` timed out (~10% of runs).

Add a TCP healthcheck to fulcrum and make mempool_api wait on service_healthy.
…alth

A healthcheck-gated depends_on deadlocks `compose up`: Fulcrum listens only
once bitcoind has blocks, and the orchestrator mines them after `up`.

@arkana-ai-bot arkana-ai-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arkana review — docker/compose.base.yml

Small infra fix for a documented ~10% startup failure. No protocol-critical paths touched.

Approach is sound

Chaining wait-for-it.sh fulcrum:50001 --timeout=720 --strict before ./start.sh is the right call here. The inline comment explains the design choice well: Fulcrum's Electrum listener only opens after bitcoind has blocks, and blocks are mined by the orchestrator after compose up returns — so a Docker healthcheck + condition: service_healthy on depends_on would keep mempool_api unstarted at that moment and force a restart cycle anyway. The in-container wait absorbs the delay without extra container restarts.

--strict + --timeout=720 is consistent with the existing mariadb wait and appropriate for a slow first-boot.

One observation: PR body doesn't match the implementation

docker/compose.base.yml line 147-171 (fulcrum service block): no healthcheck: stanza was added to fulcrum, and mempool_api's depends_on still uses plain service_started for fulcrum (lines 197-199). The PR body says "Add a TCP healthcheck to fulcrum and make mempool_api wait on service_healthy" — that describes a different approach that wasn't implemented. The YAML comment correctly reflects what was actually done; the PR description should be updated (or a note added) so future readers aren't confused about why there's no Compose healthcheck on fulcrum.

Not a blocker — the code itself is clear and correct — but worth a squash-message or description edit before merge.

No cross-repo impact

This file is purely the regtest compose stack. No public API, type, proto, or SDK interface changes. Grepping other repo clones for consumers of fulcrum/mempool_api endpoints would find only test harnesses that benefit from this fix.

No changes required.

@Kukks
Kukks merged commit 681f08c into ArkLabsHQ:master Oct 1, 2026
1 check passed
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