Repository navigation
Conversation
bitcoinix only tests and supports Bitcoin Core. Knots lags behind Core (it is still based on Core 29), so services that need newer Core features can't support it. Drop the bitcoind-knots pin and the Knots example in the services.bitcoind.package description. Users who run Knots get a config version 0.1.3 notice explaining how to switch back to Bitcoin Core. services.bitcoind.package still accepts any package, but other implementations are unsupported. Only the pin is removed from pkgs/pinned.nix. Regenerating the file would also move electrs to nixpkgs-unstable, which is an unrelated update. Assisted-by: Claude Code (claude-opus-5-5)
Contributor
|
alternative PR that also drops the option: #145 |
Contributor
Author
|
Superseded by #145, which also removes |
prusnak
added a commit
that referenced
this pull request
Oct 24, 2026
Blocked by: - [x] bitcoin-knots removal - ~#143 - #145 - [x] Release of [v0.1.2](https://github.com/bitcoinix/bitcoinix/releases/tag/v0.1.2) --- Two commits: `electrs: 0.11.0 -> 0.12.0` and `electrs: refuse to start on an index of electrs < 0.12`. ## What changes electrs 0.12.0 switched to [bindex](https://github.com/romanz/bindex-rs): - **Reindex required**: a few hours up to about a day, depending on the hardware. The final index is ~7% of `blocks/*.dat`, up to ~14% during the sync. Meanwhile electrs, and mempool if it uses electrs, answers with incomplete history and balances. See "Old index" below. - **Bitcoin Core 31+ required**: bindex uses the `/rest/blockpart` endpoint. An eval-time assertion on `nix-bitcoin.pkgs.bitcoind` fails evaluation for an older Core ("electrs requires Bitcoin Core 31 or later."), e.g. with `useVersionLockedPkgs = false`. - **Reads blocks through bitcoind's REST interface**: the module enables `services.bitcoind.rest.enable`. REST is unauthenticated: if `rpc.allowip` has non-local sources, evaluation fails unless `rest.allowNonLocal` is set, which means accepting unauthenticated REST for those sources. Raw `rpcallowip`/`includeconf` in `extraConfig` need `rest.allowUncheckedConfig`. The versioning entry and docs say so. - `--daemon-p2p-addr` was removed upstream, so electrs no longer enables bitcoind's whitelisted p2p listener (btcpayserver still enables it for itself). - `pkgs/pinned.nix` is regenerated by `helper/update-flake.sh`, which moves electrs to unstable (the pin update held it on stable by hand until this lands). - Docs: "Upgrading to config version 0.1.3" (steps, disk, downtime, REST) and `rest=1` on the other node when using a remote bitcoind. ## Old index: manual reindex, no crash loop electrs 0.12.0 doesn't convert or delete the old index, which uses the same path (`<dataDir>/bitcoin`, or `regtest`). On it, bindex panics with `Unsupported DB format (0 < 1) - please reindex!`, and with `Restart=on-failure` the unit would restart every 10 s. The reindex stays **manual**: it takes up to a day on a big node, so the operator picks the moment, and nothing deletes user data from a start script. A 0.1.3 versioning entry gives the steps: `systemctl stop electrs`, `rm -r <dataDir>/<network>`, then deploy. If the old index is still there, the unit fails once with a clear message instead of crash-looping: - A marker `<dataDir>/<network>.bindex` identifies a 0.12 index. It is written when electrs starts and no index directory exists yet (fresh install, or after the `rm -r`). - If the index directory exists without the marker, the start wrapper prints the reindex steps and exits with status 78, which `RestartPreventExitStatus` excludes from restarts. Nothing is deleted. - The check runs in the main process (a wrapper that `exec`s electrs), not in `preStart`: a failing ExecStartPre still triggers `Restart=on-failure`, and `RestartPreventExitStatus` only applies to the main process. ## Tests - The `regtest` test now waits until electrs has indexed all blocks (0.12 serves requests while it is still indexing) and queries the history of the address that mined the regtest blocks over the Electrum protocol. That exercises bindex's REST block fetches end to end. - The `electrs` test removes the marker and checks that the unit ends `failed` (not auto-restarting) with exit status 78 and the reindex message, then restores the marker and checks that electrs starts again. - electrs now enables REST in all CI scenarios, so the "REST disabled ⇒ 404" path of the `bitcoind-rest` test only runs in scenarios without electrs (e.g. `lndPruned`). On the current head: `-s electrs` and `netnsRegtest` passed locally, `nix flake check` passed.
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.
Remove the
bitcoind-knotspackage. bitcoinix only tests and supports Bitcoin Core; Knots is still based on Core 29, so services that need newer Core features can't support it.bitcoind-knotspin and the Knots example inservices.bitcoind.package.services.bitcoind.packagestill accepts any package; other implementations are unsupported.Only the pin is removed from
pkgs/pinned.nix. Regenerating it would also move electrs to nixpkgs-unstable, which is out of scope here.