Source bitcoin-node from the bitcoind-gunix flake #6
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/bitcoind-gunix-migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sources the multiprocess Bitcoin Core node from a single flake-locked
bitcoind-gunixinput whose build verifies byte-for-byte parity with the official GUIX release, replacing the three hand-maintained version+sha256 pins (bitcoin-node.nix, and theBITCOIN_VERSIONdownload blocks inscripts/build.sh+scripts/ship.sh). The Core version and every runtime invocation are unchanged — this is a version-neutral packaging/transport swap that ships byte-identical binaries (official 31.1 tarballb80d9c3e04da78fb6f0569685673418cf686fadba9042d926d13fb87ff503f9e).Implements the dev plan
notes/hashpool/dev-plans/bitcoind-gunix-migration.md.Closes vnprc/hashpool#4
Refs vnprc/hashpool#2
What changed
bitcoin-node-gunix.nix— pin-free adapter{ pkgs, lib, gunix }returning{ tarball, release, patched }.release(unpatched,dontFixup, keeps the FHS interpreter/lib64/ld-linux-x86-64.so.2) is the deploy artifact;patched(autoPatchelf +gcc.cc.lib) is the NixOS/devenv PATH variant. Both takegunix.tarballassrc— notgunix.bitcoind— because on the v31.1 branch only the tarball derivation carries the sha256 parity gate, so everynix buildof a node attr forces the gate transitively. Contains no version string, no hash, no URL.flake.nix— new inputbitcoind-gunix.url = "github:0xB10C/bitcoind-gunix/v31.1"(deliberately noinputs.nixpkgs.follows— byte parity depends on gunix's exact pinned toolchain). Exposespackages.bitcoin-node(patched; name/role preserved),packages.bitcoin-node-release, andpackages.bitcoin-node-tarball, guarded bylib.optionalAttrs (bitcoind-gunix.packages ? ${system})so unsupported systems stay eval-clean.devenv.yaml/devenv.nix— declare the same input with the byte-identical ref string; the adapter'spatchedoutput reaches PATH exactly as before. The oldbitcoin-node.niximport is removed.scripts/ship.sh/scripts/build.sh— the node binaries are now built locally withnix build .#bitcoin-node-releaseand staged/rsynced to the VPS. The unpatched FHS variant passes the existingcheck_nix_abigate, which structurally refuses a/nix/storeinterpreter — so staging the wrong variant is impossible to miss. Thebitcoincore.orgnode curl, its/tmpcache guard, and theBITCOIN_VERSIONpin are removed. The sv2-tp download / cache / staging is byte-for-byte unchanged in both scripts.build.sh --dry-runnow returns before the VPS ssh (agent-runnable), and both scripts preflightnix.bitcoind.nix(legacy Sjors sv2-fork binary, imported by nothing) and itsupdate-bitcoindjustfile recipe; adds a one-line README mechanism note.flake.lockanddevenv.lockboth gainbitcoind-gunixat the same rev4599977e9723e45ce4a16dd076b43f2d8b02b042.Risk
R2 (Medium), per the plan. The staged production binaries hash-match the official release tarball that both the previous curl path and vnprc/hashpool#2's fetchurl pin already ship, and there is no Core version change — so no datadir/chainstate migration and no downgrade hazard. The only real behavior change is deploy transport (node sourcing moves from a VPS-side curl to a local
nix build+ rsync). Worst credible post-merge failure is a prod-path script edge case leaving/opt/hashpoolwith a wrong or missing node binary: blast radius is one VPS service, detected immediately at the human-attended deploy (withcheck_nix_abiand the staged-hash check as tripwires), and recovered by a single-commit revert + redeploy. There is no config, schema, secret, or generated state to reconcile in either direction.Validation
Verified in the agent environment (no gunix build required):
packages.x86_64-linuxexposesbitcoin-node,bitcoin-node-release,bitcoin-node-tarball; all three resolve to derivation paths, andrelease/patchedsrcboth equalgunix.tarball's output (the gate-chaining contract).flake.lockanddevenv.lockpin the same gunix rev (4599977e…); the ref string appears exactly once inflake.nixand once indevenv.yaml.noncodesigned.SHA256SUMSand bitcoincore.org's signedSHA256SUMSboth publishb80d9c3e…forbitcoin-31.1-x86_64-linux-gnu.tar.gz. Because gunix fails the build on any mismatch, a successful v31.1 build produces the official byte-identical tarball by construction; gunix CI is green at this rev.BITCOIN_VERSIONorbitcoincore.orgremains inscripts/;bitcoin-node.nixandbitcoind.nixare gone; no dangling imports;SV2_TP_VERSIONretained in both scripts../scripts/ship.sh all --dry-runand./scripts/build.sh --dry-runboth pass their localnixpreflight without touching the VPS.Deferred to a build-capable environment — this VM's disk cannot fit gunix's tens-of-GB from-source build, and the project's
0xb10c-bitcoind-gunixCachix cache currently has no v31.1 paths (confirmed 404 + nothing substitutable): AT1 (local build of the three attrs), AT2 (local tarball-hash equality againstb80d9c3e…), AT2b (extraction determinism), AT3 (readelf variant properties), and AT3b (devenv shellnode version). These are mechanical and low-risk given the static verification above.Human-gated per the plan: AT5 live regtest
devenv upIPC smoke test; the signedmastermerge; and the ride-along testnet4 production deploy (AT7), whose only added operator duty is the staged-binary hash check before trusting the restart.Reviewer focus
bitcoind-gunixrev identical in both locks and at/after4599977e. Note: the transitivenixpkgsdiffers between the two locks — the flake inherits gunix's own locked6b316287, while devenv re-resolves the branch to a newer4382ed2b. This rev-skew is plan-accepted: each side's build re-verifies parity through the gate, and AT0 only requires the gunix rev itself to match. Afollowsto force them equal is deliberately avoided (it would destroy the byte reproduction).tarball, notbitcoind.Replace the hand-maintained bitcoin-node.nix (version + sha256) and the BITCOIN_VERSION download pins in scripts/build.sh and scripts/ship.sh with a single flake-locked bitcoind-gunix input whose build verifies byte-for-byte parity with the official GUIX release. Core stays 31.1 and every runtime invocation is unchanged; the staged binaries are byte-identical to the official 31.1 tarball (b80d9c3e04da78fb6f0569685673418cf686fadba9042d926d13fb87ff503f9e). - New bitcoin-node-gunix.nix adapter: { tarball, release, patched }, all derived from gunix's gate-verified tarball (not bitcoind), so every node build forces the parity gate transitively. No version, no hash, no URL. - flake.nix: add bitcoind-gunix input (no nixpkgs.follows); expose bitcoin-node (patched), bitcoin-node-release (unpatched FHS), bitcoin-node-tarball under an optionalAttrs system guard. - devenv.yaml/devenv.nix: same input (identical ref string); PATH node comes from the adapter's patched variant. - Deploy scripts: node binaries built locally via nix build and staged/rsynced; the unpatched FHS variant passes check_nix_abi. sv2-tp path left untouched. - Delete dead bitcoind.nix + update-bitcoind justfile recipe; README note. - flake.lock + devenv.lock both pin gunix rev 4599977e. Implements notes/hashpool/dev-plans/bitcoind-gunix-migration.md Refs vnprc/hashpool#2Read-only implementation review
Ran an independent adversarial review of the migration commit (
c1eca3c3), weighted toward the two deploy scripts where all behavioral risk lives. No blockers or majors — every Interface Contract in the plan is correctly implemented, and the highest-risk surface (the deploy scripts) is sound, including the adversarial case of rsync overwriting a pre-existing read-only/tmp/bitcoinfrom an old curl-based run, and theset -e/set -uedge paths (BITCOIN_NODE_RELEASEis always set beforestage_binariesreads it, and is correctly not declaredlocal, so anix buildfailure aborts rather than masks).Verified clean: the sv2-tp download/cache/staging is byte-for-byte unchanged in both scripts; no if-not-exists node cache path remains;
require_cmd nixpreflights even the--skip-buildpath;build.sh --dry-runreturns before the ssh; the adapter derivesrelease/patchedfromgunix.tarball(notbitcoind) withdontFixuponrelease; there is noinputs.nixpkgs.follows; both locks pin the same gunix rev; and the deletions leave no dangling references.Minor notes for the signed-merge reviewer (no code change made — surfacing for your call):
masterinitially made it look like the branch also carried vnprc/hashpool#2 and a cdk-ehash bump. Confirmed a false alarm — against the forge'smaster(7fe5780b, which already contains #2), this PR adds exactly one commit (c1eca3c3) touching only the 12 planned files.nix buildand flakes (optional env hardening):scripts/build.shandscripts/ship.shcall barenix build .#bitcoin-node-release, matching the plan's acceptance-test convention. Any hashpool dev/deploy machine already runs devenv/flakes, so this is fine in practice; if you want the deploy scripts self-contained regardless of a machine'snix.conf, add--extra-experimental-features 'nix-command flakes'to those two calls.if [ "${DRY_RUN:-0}" -eq 1 ]early-exit inbuild.shis now unreachable (the local dry-run returns before the ssh). Harmless; removable for clarity.Deferred (build-realization) and human-gated items are listed in the PR description.
vnprc-agent referenced this pull request2026-08-07 22:51:34 +01:00
vnprc-agent referenced this pull request2026-08-12 18:07:45 +01:00