Skip to content

Stop when the backend is not following BLAKE2b - #21

Merged
kwsantiago merged 4 commits into
blake2b-unifiedfrom
blake2b-backend-check
Oct 1, 2026
Merged

kwsantiago merged 4 commits into
blake2b-unifiedfrom
blake2b-backend-check

Conversation

@kwsantiago

Copy link
Copy Markdown

lightningd only checks that its backend reports chain = main, which a bitcoind that never switched to BLAKE2b also reports. Block headers are parsed by their own version bit, so a node pointed at such a backend followed it without complaint.

new_block() now stops the node when a block at or above the BLAKE2b activation height (the chain parameter, or --dev-blake2b-activation-height) has an 80-byte header. Every block passes through it, including the startup scan and reorg replacements. Regtest has no activation height, so nothing changes there unless the developer option is set.

doc/blake2b-upgrade.md described this check as already present; it now describes it as it is.

SECURITY.md was upstream's, sending reports for this code to upstream's maintainers and listing their release keys. It now sends them to security@privkey.io, sends upstream-only issues upstream, and names the key these releases are signed with.

Tests

In tests/test_blake2b_differentiation.py, against a backend whose activation never arrives:

  • test_backend_without_blake2b_at_startup: the node refuses to start past the activation height.
  • test_backend_without_blake2b_at_activation: a running node stops at the first block past it.
  • test_backend_with_blake2b_passes_activation: a BLAKE2b backend crosses it untouched.

The first two fail on the current release, where the node keeps running.

Changelog-None

@kwsantiago
kwsantiago force-pushed the blake2b-backend-check branch from e73828e to a0ce97f Compare October 1, 2026 02:13
@kwsantiago
kwsantiago merged commit a0ce97f into blake2b-unified Oct 1, 2026
44 checks passed
@kwsantiago
kwsantiago deleted the blake2b-backend-check branch October 1, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant