Stop when the backend is not following BLAKE2b - #21
Merged
Merged
Conversation
kwsantiago
force-pushed
the
blake2b-backend-check
branch
from
October 1, 2026 02:13
e73828e to
a0ce97f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lightningdonly checks that its backend reportschain = 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.mddescribed this check as already present; it now describes it as it is.SECURITY.mdwas 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