Repository navigation
Conversation
a19da5c to
1c01905
Compare
1c01905 to
9496839
Compare
b0f864b to
d93ba9f
Compare
|
Pushed e02b8ec: |
ostermayer
left a comment
There was a problem hiding this comment.
I reviewed the six commits on top of #70 (c3b8428..e02b8ec) against the rbitcoin.space 0.4.0 and rbitcoin 0.9.2 sources, and checked whether the points from my #70 review carry over. The root cookie script and the ExecStart escaping are fine here, the cookie's admin rights are in the docs, and the netns id clash is back in a new form (inline). GPT-6 Astra (max, two passes), Kimi K3.1 Pro (max, two passes), DeepSeek V4.1 Flash (max) and Gemini 4 Carbon (High) reviewed the change, and I checked every finding against the code and upstream's source before keeping it.
|
0.2.0 is released, so this now targets v0.2.1. Please rebase on master and move Assisted-by: Claude Code (claude-opus-5-5) |
e02b8ec to
db7e4a7
Compare
db7e4a7 to
39e4ec3
Compare
39e4ec3 to
9089f68
Compare
|
Rebased onto #70's new head (524b775, on master 5a8d756) and pushed 9089f68. Changes since 39e4ec3:
Tested locally at 9089f68:
The PR description is updated (netns id, 0.5.0, docs path, tests). Assisted-by: Claude Code (claude-opus-5-5) |
|
This is no longer a draft and is ready for review. It is still stacked on #70, which is green in CI and mergeable. Review the commits from Assisted-by: Claude Code (claude-opus-5-5) |
9089f68 to
166d9c4
Compare
Nothing checked that the ids were unique, so rbitcoin and unbeholden-lnurl both evaluated with id 34 after a rebase and got the same address. Check all entries, enabled or not, so a clash in the modules shows up in the module-config check rather than only on a node running both. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
`services.rbitcoin` runs rbitcoin 0.9.2 from nixpkgs, with its own data
directory:
- P2P, optionally through Tor (`tor.proxy`, set by secure-node.nix via
enable-tor.nix; seed lookups go to the proxy too).
- A Core-compatible JSON-RPC over TCP (`rpc.enable`), authenticated by a
cookie. rbitcoin writes a new one on every start, readable only by
itself (`--rpc-cookie-perms owner`).
- The unit `rbitcoin-rpc-cookie` publishes that cookie for clients at
/run/rbitcoin-rpc/rpc.cookie, group `rbitcoinrpc`. rbitcoin binds its RPC
port only after catch-up, hours or days after the start on mainnet, and
until then any local user could listen on the port without netns
isolation and receive the cookie from a client. So the unit publishes it
only while every listener that would take a client's connection is a
socket of rbitcoin's main process, matched by inode against
/proc/<pid>/fd, not by process name, which any user can fake in `ss -p`
output. It keeps watching, removes the cookie if rbitcoin loses the
port, and the cookie goes away with its runtime directory when rbitcoin
stops. It runs as root because clients run with PrivateUsers.
- The unix socket at {dataDir}/rpc.sock, always on, used by the operator's
`rbitcoin-cli` wrapper.
- Electrum (`electrum.enable`) with the scripthash index and its
`maxShCreates` query cap.
- nbLib.defaultHardening, except ProcSubset=all: the store sizes its caches
from /proc/meminfo.
- Assertions against data directories nested with bitcoind's, and against
listeners that collide with bitcoind, electrs or fulcrum (all default to
127.0.0.1 and Core's ports without netns isolation).
`services.mempool.electrumServer = "rbitcoin"` makes rbitcoin mempool's node
and Electrum server. mempool joins `rbitcoinrpc`, waits for the published
cookie in ExecStart (so no start job blocks during the sync) and reads it
from COOKIE_PATH, so it picks up a new cookie after an HTTP 401. It gets no
bitcoind RPC user, and bitcoind's txindex is only forced for the
electrs/fulcrum backends.
netns-isolation gets an rbitcoin namespace (id 35); mempool's connections
follow its backend. nodeinfo lists rbitcoin. versions.json and the docs
versions table list it.
Tests:
- `regtest` (and `netnsRegtest`): rbitcoin syncs from bitcoind as its only
peer and must report the same tip hash; socket-only RPC.
- New `rbitcoinMempool` scenario, added to the basic/CI set: cookie mode and
group, cookie auth accepted and wrong credentials rejected over TCP RPC,
Electrum tip height, an Electrum-backed scripthash lookup through mempool,
mempool following a new block after rbitcoin restarts with a new cookie,
and no bitcoind RPC user for mempool. A process named `pid=1,` holds the
RPC port as `nobody`: the cookie stays unpublished, neither cookie reaches
it, and a crash removes the cookie until the next instance holds the port.
- Test VMs get a 4 GiB disk when rbitcoin is enabled (~900 MB at 100
regtest blocks).
Assisted-by: Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A page at docs/service/rbitcoin.md, listed in services.md and SUMMARY.md, covers ports, the admin cookie, the data directory, one-way upgrades, the address index, RPC readiness, Tor, the large-address cap and netns isolation. It also says that without netns isolation the Electrum port opens hours after mempool starts, so a local user could take it first. README, the example config and a 0.2.1 release note link to it. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
166d9c4 to
4625db6
Compare
nixpkgs still has 0.9.2, so pkgs/default.nix overrides its package with the v0.10.0 source and cargoHash until it catches up; versions.json lists it as local again. 0.10.0 rewrites a 0.9 data directory to store schema 31 in place, with no reindex, and 0.9 refuses it afterwards. Its peers file also has a header 0.9 doesn't read. No bitcoinix release has shipped rbitcoin yet, so no migration notice; the service page says so for later rollbacks. Every flag the module passes is unchanged (https://github.com/rbitcoin-org/rbitcoin/blob/v0.10.0/CHANGELOG.md). Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add rbitcoin.space 0.2.0, a block explorer for rbitcoin, as a package and a services.rbitcoin-space module. The module enables rbitcoin's RPC, Electrum and new Esplora servers, reads the RPC cookie at every start and follows rbitcoin's lifecycle (BindsTo, PartOf, WantedBy rbitcoin.service). services.rbitcoin gains esplora options (default port 3002; 3000 is RTL's) with collision assertions. Tests: rbitcoinSpace and rbitcoinSpaceNetns scenarios, the latter in CI. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Regenerated with `helper/update-flake.sh --refresh` (no input bumps; flake.lock is unchanged) and added the rbitcoin-space release link that helper/gen-docs-versions.sh needs to build the docs table. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
https://github.com/smolcars/rbitcoin-space/releases/tag/v0.3.0 The new settings, MCP_ENABLED and ONION_LOCATION, are off or unset by default, so the module needs no changes. Either one can be set through services.rbitcoin-space.settings. The web node_modules hash is unchanged. versions.json and the docs versions table are regenerated, and the release notes and the CONFIG.md link now name 0.3.0. Tested with ./test/run-tests.sh -s rbitcoinSpaceNetns. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
https://github.com/smolcars/rbitcoin-space/releases/tag/v0.4.0 Built and tested upstream against rbitcoin v0.9.2, the version pinned here. The new setting, SITE_URL, is unset by default, so the module needs no changes; it can be set through services.rbitcoin-space.settings. The web node_modules hash is unchanged (bun.lock did not change). 0.4.0 adds store migration 0021 (replacement outputs), which is one-way: 0.3.0 refuses a store 0.4.0 migrated. rbitcoin.space is not in a release yet, so no upgrade note; docs/services.md now says how to downgrade. versions.json and the docs versions table are regenerated, and the release notes and the CONFIG.md link now name 0.4.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Assisted-by: Claude Code (claude-opus-5-5)
The 0.2.0 release note now says rbitcoin.space runs only on rbitcoin, enables it with its RPC, Electrum and Esplora servers, and is separate from mempool's backend choice. Evaluated with mempool on rbitcoin and on electrs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Assisted-by: Claude Code (claude-opus-5-5)
LISTEN_ADDR went through `nbLib.address`, which maps a wildcard listen address to loopback for clients. With `address = "0.0.0.0"` the explorer listened on 127.0.0.1 only. Keep that mapping for the addresses of rbitcoin's servers, and use the configured address for the listener. Co-Authored-By: Claude Opus 5.5 <[email protected]> Assisted-by: Claude Code (claude-opus-5-5)
…e docs `After=rbitcoin.service` only waited for rbitcoin's process. rbitcoin opens its RPC port only after catch-up, so the explorer started against a port that wasn't there yet, and sent the cookie to whoever listened on it. It now waits in its start script for the cookie that `rbitcoin-rpc-cookie` publishes once rbitcoin holds the port. The docs said the explorer serves while rbitcoin syncs. It serves nothing until rbitcoin's RPC is up and its Esplora server, which waits for the address index, has opened. They also said the store is rebuilt when lost. Only the block rows are: the block audits, mempool history and replacement record are recorded live and lost for good. Say so in the docs and the `dataDir` description, show how to back the store up with SQLite's backup command, and downgrade by restoring a backup instead of emptying dataDir. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
https://github.com/smolcars/rbitcoin-space/releases/tag/v0.5.0 Built upstream against rbitcoin v0.9.2, the version pinned here. 0.5.0 adds no settings (deploy/.env.example and CONFIG.md only change the version), so the module needs no changes. SOURCE_REVISION is the commit of tag v0.5.0. versions.json and the docs versions table are regenerated, and the release note and the CONFIG.md and DEPLOY.md links now name 0.5.0. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Master's docs split moved the service guides to docs/service/, so the rbitcoin.space section is now docs/service/rbitcoin-space.md. Point the release note and the example config at it, and turn the page's links to the rbitcoin and backups sections, which were anchors on the same page before, into links to their pages. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
4625db6 to
5583032
Compare
|
Rebased onto #70's rbitcoin 0.10.0 bump (59b8234) and pushed 5583032. The only conflicts were rbitcoin.space 0.5.0 works with rbitcoin 0.10.0. Locally, rbitcoin 0.10.0 adds the Assisted-by: Claude Code (claude-opus-5-5) |
This reverts commit 59b8234, as bitcoinix#70 does: track nixpkgs' rbitcoin (0.9.2 at the locked rev) instead of overriding its source. rbitcoin.space 0.5.0 is built and tested upstream against rbitcoin 0.9.2, so the module needs no change. The conflicts are the adjacent rbitcoin-space entries in pkgs/default.nix and docs/versions-table.md; the table is regenerated from versions.json. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ready for review, stacked on #70. This branch contains #70's four commits (through 59b8234); the new work is the commits from
rbitcoin-space: add package and moduleon. The last commit, b4d0806, reverts 59b8234's 0.10.0 bump, as #70 now does, so rbitcoin tracks nixpkgs' 0.9.2. It will be rebased onto master once #70 lands.This proposes rbitcoin.space as a new service, per the "New services" policy. rbitcoin.space is a block explorer built for rbitcoin by its contributors: blocks, transactions, addresses, the live mempool with projected blocks and fee recommendations, mining pools and block audits, and an Esplora-compatible API. Like rbitcoin, it is experimental.
What it adds
pkgs/rbitcoin-space(0.5.0, released beside rbitcoin 0.9.2; tested here with nixpkgs' 0.9.2)LIBSQLITE3_SYS_USE_PKG_CONFIGand overrides upstream'sbundledfeature.node_modules, the same on x86_64 and aarch64.SOURCE_REVISIONis set to the tag's commit, so/healthzreports it.WEB_DIRto the packaged frontend.services.rbitcoin-spaceservices.rbitcoinwith RPC, Electrum, Esplora and the address index, on rbitcoin's network: mainnet, signet or regtest. An assertion rejectstestnet, which is testnet3, because the explorer doesn't support it.rbitcoinrpc) and exports it. It is never in argv, the unit or the store.BindsToandPartOf(stop and restart), plusWantedBy=rbitcoin.service, which also starts it after an automatic restart.Upholds: it would undosystemctl stop rbitcoin-spaceand the stop half of anixos-rebuild switch.mempool,broadcastanddataDiroptions.settingstakes the rest of upstream's environment variables, with an assertion that it doesn't override the managed ones (including the RPC password, which would land in the store).nbLib.defaultHardening, plustor.enforce, whichenable-tor.nixsets.rbitcoin; 35 is rbitcoin's and 36 is cdk-mintd's on master), nodeinfo, onion services (port 80), README, a docs page (docs/service/rbitcoin-space.md), release notes and the example config.services.rbitcoin.esplora(on #70's module)Tests
New scenarios
rbitcoinSpaceandrbitcoinSpaceNetns. The netns one is added to the CI matrix.rbitcoin-space:/readyzis ready, with RPCok, the address indexonand the storeok;/regtest/api/blocks/tip/heightmatches the node;rbitcoin-space-follows-node(post-restart phase):regtest;systemctl restart rbitcoinand after a SIGKILL of rbitcoin, the explorer runs with a new PID and its RPC check passes with the new cookie;systemctl stop rbitcoin-spacestays stopped while rbitcoin runs.Tested locally at b4d0806 (#70's 0.10.0 bump reverted; rbitcoin 0.9.2 from nixpkgs):
./test/run-tests.sh -srbitcoinSpaceandrbitcoinSpaceNetns: passed, each testclosure with rbitcoin 0.9.2;
checks.x86_64-linux.module-configandtest/ci/check-versions.sh: passed.Tested locally at 5583032, on #70 at 59b8234 (rbitcoin 0.10.0, master 7a6dc3b):
./test/run-tests.sh -srbitcoinSpace,rbitcoinSpaceNetnsandrbitcoinMempool: passed,each test closure with rbitcoin 0.10.0;
checks.x86_64-linux,./test/shellcheck.sh,test/ci/check-versions.shandnix eval .#ciTestInfo: passed.Tested locally at 9089f68 on 0.5.0:
./test/run-tests.sh -srbitcoinSpace,rbitcoinSpaceNetnsandrbitcoinMempool: passed;nix eval .#ciTestInfo(whatbuild_test_driversevaluates): passed;checks.x86_64-linux(includingtestRbitcoinSpaceListenAddress),./test/shellcheck.shandtest/ci/check-versions.sh: passed.Earlier, on 0.4.0, rebased on master after #290 (release notes per version):
./test/run-tests.sh -s rbitcoinSpace: passed (rbitcoin,rbitcoin-space,rbitcoin-space-follows-node,regtest);rbitcoinSpacetogether with mempool onelectrumServer = "rbitcoin", and on thedefault electrs: both evaluate;
helper/check-release-notes.shandtest/ci/check-versions.sh: passed.Tested locally, on master after #224 (unstable nixpkgs):
./test/run-tests.sh -srbitcoinSpace,rbitcoinSpaceNetns,rbitcoinMempoolandregtest: passed;checks.x86_64-linuxand./test/shellcheck.sh: passed.A fresh-context review of the diff found that
Upholdsundid manual stops and nixos-rebuild's stop. It also found two test asserts that could pass while checking nothing, and a missing warning that onion visitors share one rate limit. All four are fixed here.Known limitations
nix-bitcoin.onionServices.rbitcoin-space.public = truefails evaluation, because the module has nogetPublicAddressCmd. RTL and mempool-frontend have the same gap today./internal/*routes let the explorer add up very large addresses, is not used yet. They need rbitcoin 0.10.0, which comes in with a nixpkgs update; wiring the socket in is a follow-up after that.settings) connect to the internet, so they fail undertor.enforce.🤖 Generated with Claude Code