Skip to content

mempool: 3.2.1 -> 3.3.2 - #142

Merged
seberm merged 1 commit into
masterfrom
pkgs/mempool-3.3.2
Oct 25, 2026
Merged

seberm merged 1 commit into
masterfrom
pkgs/mempool-3.3.2

Conversation

@seberm

@seberm seberm commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Updates mempool from 3.2.1 to 3.3.2 (3.3.0, 3.3.1, 3.3.2).

Upstream highlights: regtest and testnet4 support, sub-1 sat/vB transactions, stale block views, Taproot script tree visualization, and an Angular 16 -> 20 upgrade. 3.3.2 moves to Node.js 26.

Changes

  • Build and run with Node.js 26 (nodejs_26/nodejs-slim_26, same version as upstream's .nvmrc).
  • Rebase both local patches on 3.3.2. Both are still needed:
    • 0002-bind-backend-to-HTTP_HOST.patch: upstream still calls listen() without a host, so without the patch the backend would listen on all interfaces.
    • 0001-allow-disabling-mining-pool-fetching.patch: upstream still exits at startup when it can't fetch the pools data, which breaks offline VM tests.
  • Release signing key: the 3.3.x tags are signed by mononaut's key 523B596A78BB8495AA2EC45ABFD16BE592A9CD8D, not by wiz' key. That key is published only on GitHub and isn't certified by another key. generate.sh now accepts a tag signed by either of the two pinned fingerprints and fails on any other signer. It also requires a GOODSIG status, so it rejects signatures by expired or revoked keys (git verify-tag itself exits 0 for an expired key).
  • Set CI for the frontend build. The Nix build log is a terminal, and the progress spinner of Angular 20's ng build stalls the build indefinitely on it. With CI set, the frontend builds in about 1.5 minutes on a 4-core machine.

Breaking: one-way database migration

No option, default, port or network exposure changes. The backend makes no new outbound connections. The upstream nginx changes only affect their enterprise SSR setup.

The database migration can't be undone, so this adds a 0.1.3 entry to modules/versioning.nix for configs with services.mempool.enable. It tells users to dump the database before deploying, because rolling back the NixOS generation keeps the migrated database. docs/upgrading.md ("Upgrading to config version 0.1.3") has the mysqldump command. bitcoinix's services.backups doesn't include this database.

For the release notes

  • The backend migrates its database from schema version 97 to 106 on first start. This is one-way: going back to the previous bitcoinix release requires a MariaDB backup taken before upgrading.
  • The first start on mainnet takes longer because of the ALTER TABLE statements on blocks and statistics. On mainnet, Goggles data for blocks from height 896070 on is recomputed in the background.

Tests

  • The CI test scenarios pass, including netnsRegtest, which ran the mempool test on 3.3.2. It checks that the backend starts, that config.json gets mode 600, that the frontend is served through nginx, that the backend listens only on its own address (patch 0002), that MariaDB listens only on 127.0.0.1, and that the API reports the regtest tip height.
  • nix flake check --no-build and ./test/shellcheck.sh pass locally.
  • generate.sh ran on x86_64-linux and verified the v3.3.2 tag signature. The rust-gbt cargo vendor hash didn't change.
  • The new signer check in generate.sh was tested with a throwaway key: it accepts a good signature and rejects a signature by an expired and by a revoked key.
  • The service was tested only by these CI tests, not on a running node. The database migration of an existing database is untested.

Refs #7

@seberm seberm added the type: maintenance No user-visible change: refactor, CI, deps, tooling, docs-only label Oct 24, 2026
@github-actions github-actions Bot added the area: packages pkgs/ and flake pins label Oct 24, 2026

@ostermayer ostermayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the diff and checked the inputs. The source hash matches nix flake prefetch github:mempool/mempool/v3.3.2, the v3.3.2 tag carries a good signature from 523B596A78BB8495AA2EC45ABFD16BE592A9CD8D with the key from github.com/mononaut.gpg, the mining-pool-logos rev exists, and both patches match the 3.3.2 code. Two things need a fix.

The signer check accepts a tag signed by an expired or revoked key. generate.sh:40 runs git verify-tag --raw in a pipeline with || true, so the exit status is thrown away and only the VALIDSIG line counts. GnuPG prints VALIDSIG for every cryptographically valid signature, also next to EXPKEYSIG and REVKEYSIG, and git verify-tag exits 1 in both cases. I tested it with a throwaway key: the signed tag passes, then after gpg --quick-set-expire <fpr> seconds=1 git exits 1 with EXPKEYSIG but the script still extracts the fingerprint and accepts the tag. A revoked key takes the same path, and a revoked key is exactly the case where we must stop trusting a signer. Check the exit status first and parse afterwards:

status=$(git -C "$src" verify-tag --raw "$tag" 2>&1) || {
    echo "Tag $tag failed verification:"; echo "$status"; exit 1
}
signer=$(sed -nE 's/^\[GNUPG:\] VALIDSIG .* ([0-9A-F]{40})$/\1/p' <<< "$status")

The database migration needs a versioning entry. The commit message says the backend migrates its MariaDB schema from 97 to 106 on first start and that this can't be undone. 3.3.x also drops the blocks primary key and recreates it on hash (backend/src/api/database-migration.ts). AGENTS.md lists a data migration and a database reindex as changes that must get an entry in modules/versioning.nix, like the electrs entries, so users with services.mempool.enable see it at evaluation time. The entry should tell them to dump the database before they deploy if they want to keep a way back, because a rollback of the NixOS generation keeps the migrated database and 3.2.1 has no downgrade path.

build_test_drivers in CI died after three hours with "Nix daemon disconnected unexpectedly", after mempool-backend-3.3.2 had already built and been pushed to the cache, so that looks like a runner problem and a rerun should pass.

DeepSeek V4.1 Flash 1017 (max) flagged the key download from the same GitHub account that hosts the release, but the fingerprint allowlist covers that, so I dropped it. GLM 5.3 (max) found nothing in this PR's files. Codex (GPT-6 Astra, xhigh) found the || true problem as the second opinion on that run and again on the diff, together with the missing versioning entry, and I checked both against the script and the migration code before writing this.

@seberm
seberm force-pushed the pkgs/mempool-3.3.2 branch from e550d89 to ef8969c Compare October 24, 2026 19:38
@github-actions github-actions Bot added area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix labels Oct 24, 2026
@seberm
seberm force-pushed the pkgs/mempool-3.3.2 branch from ef8969c to ae31dde Compare October 24, 2026 19:40
@seberm seberm added the breaking Changes existing user config; needs a versioning.nix entry label Oct 24, 2026
@seberm seberm mentioned this pull request Oct 24, 2026
15 of 33 tasks
@seberm

seberm commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Both are fixed in ae31dde.

Signer check: the exit status alone doesn't catch an expired key. I tested with a throwaway key (git 2.54, GnuPG 2.4.9). For a revoked key, git verify-tag --raw exits 1 with REVKEYSIG, as you described. After gpg --quick-set-expire <fpr> seconds=1, it exits 0: the output has EXPKEYSIG and still has VALIDSIG. So generate.sh now also requires a GOODSIG line, which GnuPG prints only for a good signature by a valid key:

if ! status=$(git -C "$src" verify-tag --raw "$tag" 2>&1) ||
   ! grep -q '^\[GNUPG:\] GOODSIG ' <<< "$status"; then
    echo "Tag $tag failed verification:"; echo "$status"; exit 1
fi
signer=$(sed -nE 's/^\[GNUPG:\] VALIDSIG .* ([0-9A-F]{40})$/\1/p' <<< "$status")

With the throwaway key, a good signature is accepted and signatures by an expired or a revoked key are rejected.

Database migration: added a 0.1.3 entry to modules/versioning.nix for services.mempool.enable. It tells users to dump the database before deploying, because rolling back the NixOS generation keeps the migrated database. docs/configuration.md ("Upgrading to config version 0.1.3") has the mysqldump command and notes that services.backups doesn't cover this database. The PR now has the breaking label.

CI: this wasn't a runner problem. Nix runs the build with a terminal as its log output. On that terminal, the progress spinner of Angular 20's ng build keeps the main thread busy and the build never finishes. A --prof profile showed the time in ora's clear() and in stream writes. Setting CI=1 for the frontend build fixes it: it now takes about 1.5 minutes, and the CI test scenarios pass, including the mempool test in netnsRegtest.

@seberm
seberm marked this pull request as ready for review October 24, 2026 20:35
@seberm
seberm requested review from ostermayer and prusnak and removed request for ostermayer October 24, 2026 20:35
@seberm
seberm force-pushed the pkgs/mempool-3.3.2 branch from ae31dde to f44ce46 Compare October 25, 2026 21:16

@ostermayer ostermayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gate ran on ae31dde, and f44ce46 only moves the docs pointer to docs/upgrading.md after #149, so it still applies. DeepSeek V4.1 Flash 1017 (max) and GLM 5.3 (max) found nothing in the files this PR changes, and Codex (GPT-6 Astra, xhigh) graded their findings without adding any here.

I re-checked the two fixes. GnuPG prints GOODSIG only for a good signature by a valid key and EXPKEYSIG or REVKEYSIG otherwise, so requiring that line plus the fingerprint match closes the expired-key case, and the versioning entry fires for every mempool user. CI is green on f44ce46, including the mempool test in netnsRegtest.

Release notes:
https://github.com/mempool/mempool/releases/tag/v3.3.0
https://github.com/mempool/mempool/releases/tag/v3.3.1
https://github.com/mempool/mempool/releases/tag/v3.3.2

- Build and run with Node.js 26, like upstream (`.nvmrc`).
- Rebase both patches. They are still needed: upstream still listens
  on all interfaces and still exits when the pools data can't be fetched.
- Release tags since v3.3.0 are signed by mononaut's key
  523B596A78BB8495AA2EC45ABFD16BE592A9CD8D instead of wiz' key. It is
  published only on GitHub (https://github.com/mononaut.gpg).
  `generate.sh` now accepts a tag signed by either of the two pinned keys,
  and only with a GOODSIG status, so signatures by expired or revoked
  keys are rejected.
- Set `CI` for the frontend build. The Nix build log is a terminal, and
  the progress spinner of Angular 20's `ng build` stalls the build
  indefinitely on it.

On first start, the backend migrates its database from schema version
97 to 106. This can't be undone: running an older mempool version again
requires restoring a database backup. Add a versioning entry that tells
mempool users to dump the database before deploying.

Assisted-by: Claude Code (claude-opus-5-5)
@seberm
seberm force-pushed the pkgs/mempool-3.3.2 branch from f44ce46 to fdff5fb Compare October 25, 2026 22:13
@seberm

seberm commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased and resolved conflicts.


Both changes added to the same places: the 0.1.3 section of docs/upgrading.md and the end of changes in modules/versioning.nix. I kept both. The mempool paragraph and versioning entry now follow #51's, and their text is unchanged from f44ce46.

@seberm
seberm merged commit 8d1052a into master Oct 25, 2026
12 checks passed
@seberm
seberm deleted the pkgs/mempool-3.3.2 branch October 25, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix area: packages pkgs/ and flake pins breaking Changes existing user config; needs a versioning.nix entry type: maintenance No user-visible change: refactor, CI, deps, tooling, docs-only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants