Repository navigation
mempool: wait for the secrets and keep the RPC password out of the store - #216
Conversation
seberm
left a comment
There was a problem hiding this comment.
Looks good to me. The secrets ordering matches the other units, the assertion catches the only way a literal password could be set (mkForce), and the versioning entry and upgrade notes are scoped right. module-config passes locally on 28d2e72.
Optional: the upgrade note says "change the password" but doesn't say how. Maybe add: with a local bitcoind, delete bitcoin-rpcpassword-public and redeploy (setup-secrets regenerates the password and its HMAC). With a remote bitcoind, change it on the other node.
viberaven
left a comment
There was a problem hiding this comment.
Reviewed 28d2e72; no blocking findings.
The explicit secrets dependency covers mempool's own preStart read. The assertion and runtime substitution agree on the password source, and the 0.1.5 migration notice is scoped to affected configurations with matching upgrade documentation.
Validation on this commit: module-config and test-runner checks pass; ./test/run-tests.sh -s regtest build passes locally with KVM, including the mempool checks.
Reviewed with Codex (GPT-6 Astra).
The mempool unit reads the public RPC password in preStart, but it was ordered after nix-bitcoin-secrets.target only through electrs or fulcrum. Now it wants the target and starts after it, like bitcoind. An explicit `settings.CORE_RPC.PASSWORD` was copied into the world-readable store, so an assertion and a 0.1.5 migration notice now reject it. Fixes bitcoinix#133. Assisted-by: Claude Code (Claude Opus 5.5)
28d2e72 to
c7aaa3d
Compare
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [bitcoinix/bitcoinix](https://github.com/bitcoinix/bitcoinix) | patch | `v0.1.4` → `v0.1.5` | --- ### Release Notes <details> <summary>bitcoinix/bitcoinix</summary> ### [`v0.1.5`](https://github.com/bitcoinix/bitcoinix/releases/tag/v0.1.5): bitcoinix 0.1.5 [Compare Source](bitcoinix/bitcoinix@v0.1.4...v0.1.5) **Security release with breaking changes.** Updates BTCPay Server to 2.4.7 and Core Lightning to 26.06.10. All users should upgrade. If you run BTCPay Server with `services.backups`, start a backup right after upgrading. Evaluation fails with a message for each breaking change that affects your config; act on it, then set `nix-bitcoin.configVersion = "0.1.5";`. #### Security - **BTCPay Server [2.4.7](https://github.com/btcpayserver/btcpayserver/releases/tag/v2.4.7)** fixes 85 security findings (1 critical, 13 high). Upstream highly recommends it, especially for servers shared by multiple merchants. It was left out of 0.1.4 ([#​203](bitcoinix/bitcoinix#203)). - **Core Lightning [26.06.10](https://github.com/ElementsProject/lightning/releases/tag/v26.06.10)** fixes vulnerabilities in dual funding, splicing, onchaind, gossip, connectd, runes and commando, among others. Upstream recommends reviewing your runes: bind runes used over commando to the app's node ID and blacklist any you can't account for ([#​226](bitcoinix/bitcoinix#226)). - **Backups now include the NBXplorer database,** which holds the BTCPay hot-wallet keys. Backups made before this release lack them, so run `systemctl start duplicity` after upgrading, or make sure you have each hot wallet's recovery phrase ([#​223](bitcoinix/bitcoinix#223)). - **Not included: database dump checks ([#​225](bitcoinix/bitcoinix#225 duplicity still succeeds when a database dump fails, and with `services.postgresqlBackup.compression` set to `"zstd"` or `"none"`, backups leave out the BTCPay and NBXplorer databases. Until the next release, keep the default `"gzip"` and check `journalctl -u postgresqlBackup-btcpaydb -u postgresqlBackup-nbxplorer` after a backup. - **The mempool RPC password no longer ends up in the Nix store** when set through `services.mempool.settings.CORE_RPC.PASSWORD` ([#​216](bitcoinix/bitcoinix#216)). - **Multipath TCP:** lnd now also runs with `GODEBUG=multipathtcp=0`, and `hardened-extended` sets `net.mptcp.enabled = 0` ([#​187](bitcoinix/bitcoinix#187)). That sysctl, like the one the 0.1.4 notes advised, covers only the host namespace: services that netns-isolation runs in their own namespace can still open MPTCP listeners (fix not included, [#​206](bitcoinix/bitcoinix#206)). The fix for CVE-2026-98432 is kernel 6.18.56 or later; check with `uname -r`. - **Harder to fingerprint:** mempool no longer shows stack traces with store paths, store-derived ETags, the hostname or the kernel version, and new self-signed certs only carry `CN=localhost`. The SSH onion shares its host keys with clearnet SSH, so publishing both links them: keep SSH off clearnet or use Tor client authorization for the onion ([#​229](bitcoinix/bitcoinix#229)). - `clightning-replication` warns when SSH host key checking is disabled ([#​222](bitcoinix/bitcoinix#222)). - Core Lightning, clboss and Fulcrum still link brotli 1.2.0 from nixpkgs-unstable. #### Breaking changes - **mempool:** `services.mempool.settings.CORE_RPC.PASSWORD` now fails evaluation. Put the password in `<secretsDir>/bitcoin-rpcpassword-public`, and change it if untrusted users or services run on the node, since the old value stays in the store until garbage collection ([#​216](bitcoinix/bitcoinix#216)). - **currencyrate:** the Python plugin is replaced by Core Lightning's Rust `cln-currencyrate`. Use `listcurrencyrates` instead of `currencyrates`; `add-source`/`disable-source` are now `currencyrate-add-source`/`currencyrate-disable-source` ([#​202](bitcoinix/bitcoinix#202)). - **rebalance:** now routes with askrene. Drop `getroute_method` from `rebalance` calls and `rebalance-getroute`, `rebalance-maxhops`, `rebalance-msatfactor` from your config; `rebalancereport` loses the matching fields ([#​202](bitcoinix/bitcoinix#202), [#​207](bitcoinix/bitcoinix#207)). - **clnrest:** the package moved from `nix-bitcoin.pkgs.clnrest` to `nix-bitcoin.pkgs.clightning-plugins.clnrest` ([#​202](bitcoinix/bitcoinix#202)). - **Core Lightning 26.06.10, for scripts:** `bkpr-dumpincomecsv` only accepts a plain `.csv` filename and writes it to the network directory. Opens from peers with `dust_limit_satoshis` above 5000 sat are refused. See the [operator notes](https://github.com/ElementsProject/lightning/releases/tag/v26.06.10). - **BTCPay Server 2.4.7, for integrators:** the legacy `/invoices/create` routes are removed (use `/stores/{storeId}/invoices/create`), and reading single invoices through the BitPay API requires authentication. See [Upgrading to config version 0.1.5](https://docs.bitcoinix.net/upgrading.html#upgrading-to-config-version-015). #### Updates | Package | 0.1.4 | 0.1.5 | | ------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | BTCPay Server | 2.4.6 | [2.4.7](https://github.com/btcpayserver/btcpayserver/releases/tag/v2.4.7) | | Core Lightning | 26.06.9 | [26.06.10](https://github.com/ElementsProject/lightning/releases/tag/v26.06.10) | | currencyrate plugin | Python ([`c0ba9dc`](bitcoinix/bitcoinix@c0ba9dc)) | [cln-currencyrate 0.1.0](https://github.com/ElementsProject/lightning/tree/v26.06.10/plugins/currencyrate-plugin) | | lightningd/plugins | [`c0ba9dc`](bitcoinix/bitcoinix@c0ba9dc) | [f0d33fd](https://github.com/lightningd/plugins/tree/f0d33fd) | Also: the docs list the release and package versions ([#​205](bitcoinix/bitcoinix#205)); the services page is reworked ([#​201](bitcoinix/bitcoinix#201)). Contributors: [@​ostermayer](https://github.com/ostermayer), [@​prusnak](https://github.com/prusnak), [@​seberm](https://github.com/seberm), [@​viberaven](https://github.com/viberaven). Full changes: <bitcoinix/bitcoinix@v0.1.4...v0.1.5> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjIuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjIyMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: agent <[email protected]> Reviewed-on: https://git.home.unbeholden.dev/unbeholden/infra/pulls/97
Fixes #133.
preStartreads the public RPC password, but the unit was only ordered afternix-bitcoin-secrets.targetindirectly, through electrs or fulcrum. It now wants the target and starts after it, like bitcoind.settings.CORE_RPC.PASSWORD(it takes anmkForceover the module'snull) was serialized into the world-readable store config. An assertion now rejects it and points to the secrets dir, andpreStartalways fills the password from the secret file. OnlyCORE_RPC.PASSWORDis filled at runtime, so that's the only field the assertion covers.docs/upgrading.md. A config that set the password used to evaluate and now fails, so AGENTS.md calls for one. The notice says to move the password to the secret file and to change it, since the old value stays in the store until garbage collection.CORE_RPC.USERNAMEis still the public RPC user, so a separate mempool RPC account was never a supported setup. This PR doesn't add one.Tested
On my KVM host:
regtest,default,netns,netnsRegtestandnix flake checkpass.Opus 5.5 wrote this. Codex GPT-6 Astra and Claude Fable 5.1 reviewed it. They found the missing versioning entry, the docs intro and the migration test cases, and their last round found nothing more. Kimi K3.1 Pro and DeepSeek V4.1 Flash ran over 28d2e72, and Astra checked their report. Nothing came up in the files this PR touches.