fix(3.3.1:24): ask which indexer to use, and never run without one configured - #83
Merged
Merged
Conversation
…nfigured `store.json.indexer` has no default, and the select that sets it declared `default: 'fulcrum'` — so the form rendered as though Fulcrum were already chosen. Closing it without saving persisted nothing, and the task that would have forced the choice was gated on `kind === 'install'`, so an install that updated into the feature was never asked at all. With the choice unmade, `setupDependencies` declared no indexer and `watchHosts` omitted the `ELECTRUM` section, while `MEMPOOL.BACKEND` stayed pinned to `'electrum'`. Upstream's own defaults then applied — `127.0.0.1:3306` with TLS on, which is this package's MariaDB — and the backend reconnected to it once a second indefinitely. Both health checks stayed green throughout; address lookups were silently dead. A demo box had logged 578,380 aborted MariaDB connections this way. - The select offers `none` and preselects nothing, so a choice has to be made. - The task is raised whenever the choice is unmade, which reaches installs already in this state on their next start. - `watchHosts` writes `MEMPOOL.BACKEND` alongside `ELECTRUM` — `electrum` when an address resolved, `none` otherwise — so the backend is never left on upstream's defaults. `BACKEND` is relaxed from a literal to that pair. - `store.json.indexer` gains `'none'`: absent means unmade, `'none'` means declined. No migration — `watchHosts` repairs `BACKEND` on every init and the task reaches every affected install, so both halves heal on the next start. `default: null` needs the SDK signature widened (Start9Labs/start-technologies#3871); the cast goes when that ships. Verified on demo.local, upgrading 3.3.1:23 → 3.3.1:24 in the broken state: the task appeared on an *update* and blocked startup; `BACKEND` flipped to `none` with `POLL_RATE_MS` intact; selecting Fulcrum resolved `ELECTRUM 10.0.3.1:51537 TLS_ENABLED false`, added `fulcrum` to `currentDependencies`, and cleared the task; the service came up with both health checks green and logged `Connected to Electrum Server at 10.0.3.1:51537 (["Fulcrum 2.1.2","1.4"])`. Zero Electrum errors and zero aborted MariaDB connections since. An address lookup through the published port was not exercised — the port was not reachable from the test shell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
MattDHill
force-pushed
the
fix/indexer-selection-never-asked
branch
from
August 31, 2026 15:48
7be0f1f to
984e280
Compare
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.
What was broken
store.json.indexerhas no default, and the select that sets it declareddefault: 'fulcrum'— so the form rendered as though Fulcrum were already chosen. Closing it without saving persisted nothing, and the task that would have forced the choice was gated onkind === 'install', so an install that updated into the feature was never asked at all.With the choice unmade,
setupDependenciesdeclared no indexer andwatchHostsomitted theELECTRUMsection — whileMEMPOOL.BACKENDstayed pinned toz.literal('electrum'). Upstream's ownELECTRUMdefaults then applied:127.0.0.1:3306with TLS on, which is this package's own MariaDB. The backend reconnected to it once a second, indefinitely:Both health checks stayed green throughout. Address lookups were silently dead, and nothing surfaced it.
The fix
actions/selectIndexer.ts— offersnoneand preselects nothing, so a choice has to be made rather than inherited.init/taskSelectIndexer.ts— thecriticaltask is raised whenever the choice is unmade, which reaches installs already in this state on their next start.init/watchHosts.ts— writesMEMPOOL.BACKENDalongsideELECTRUM:electrumwhen an address resolved,noneotherwise. The backend is never left on upstream's defaults.file-models/mempool-config.json.ts—BACKENDrelaxed fromz.literal('electrum')toz.enum(['none','electrum']).file-models/store.json.ts—indexergains'none': absent means the choice is unmade,'none'means declined.No migration.
watchHostsrepairsBACKENDon every init and the task reaches every affected install, so both halves heal on the next start.default: nullneeds the SDK signature widened — Start9Labs/start-technologies#3871. Theas anygoes when that ships.Verified on demo.local
Upgrading
3.3.1:23→3.3.1:24on a box in the broken state (ELECTRUM: {},BACKEND: "electrum", 578,380 aborted MariaDB connections):mempool:select-indexerpresent,active: true,criticalInvalid Request: Service mempool has an unresolved critical taskBACKENDwhile unmadenone;POLL_RATE_MS: 8000intact, so the merge doesn't clobber siblings"default": null,"value": {}over the wire on SDK 2.0.9ELECTRUM {HOST: 10.0.3.1, PORT: 51537, TLS_ENABLED: false},BACKEND: electrumcurrentDependenciesgainedfulcrumrunning,apiandwebuibothsuccessINFO: Connected to Electrum Server at 10.0.3.1:51537 (["Fulcrum 2.1.2","1.4"])Not exercised: an address lookup through the published port — it wasn't reachable from the test shell. The Electrum handshake above is what the lookup depends on.