Skip to content

multi: follow-ups to option_independent_secrets and splice reserves - #15

Merged
paulscode merged 5 commits into
blake2bfrom
followups-22
Oct 24, 2026
Merged

paulscode merged 5 commits into
blake2bfrom
followups-22

Conversation

@paulscode

Copy link
Copy Markdown
Owner

Follow-ups from the reviews of #7, #10 and #13, and a test fix.

  • Don't connect to nodes announcing an unknown even bit (BOLT 7: SHOULD NOT connect; bolts#17 has nodes treat 266 in a node_announcement as unknown). The graph bootstrapper and autopilot skip nodes whose announced features feature.ValidateRoutable refuses. lncli connect, persistent peers and backups are unchanged, and a node without such bits behaves as before.
  • Blinded and onion message paths leave out intermediate nodes that pathfinding refuses, as feature, routing: treat 266 in a node announcement as unknown #13 does for payments.
  • shachain: IndependentProducer's comment uses the spec's current terms (its root is already per channel).
  • htlcswitch: TestLinkTxAbortKeepsReserves waits for the splice handler instead of sleeping; with the old link code it fails 20 of 20.
  • lnwallet/test: the backend tests run against stock regtests, which don't know the unified sighash, so funding inputs signed with it never confirmed (bitcoind refused them; btcd and neutrino hung). The test opts out, as dev builds do. Not in CI before; all three backends pass now.

Each change has a test that fails without it.

…ect to

BOLT 7 says a node that receives a node_announcement with an unknown even
feature bit SHOULD NOT connect to that node, and lightning-blake2b/bolts#17
has the even bit of option_independent_secrets count as one there.
Pathfinding already refuses such nodes through feature.ValidateRoutable,
but the graph bootstrapper and the autopilot agent still picked them as
peers to dial and to open channels with.

autopilot.Node now carries the node's announced features, and
autopilot.Connectable checks them with ValidateRoutable. The graph
bootstrapper skips nodes that fail it, and the agent leaves them out of
the candidates it hands its heuristic. A node whose features aren't known
is picked as before. Explicit connections (lncli connect, addpeer) and
reconnections to channel peers are unchanged.
…aths

findBlindedPaths picked intermediate nodes by RouteBlindingOptional alone,
so an invoice or offer could hand out a blinded path through a node that
announces an even feature bit we don't know, or the even bit of
option_independent_secrets, which lightning-blake2b/bolts#17 has nodes
treat as one. Pathfinding refuses to route through such a node since
feature.ValidateRoutable, and a payer that doesn't know the bit refuses
the path too. The onion message route search had the same gap, and its
first hop is a node we may connect to on our own.

Both now skip a node whose announced features fail ValidateRoutable, as
pathfinding does. Our own node and channels the caller chains in are not
checked, as before.
The comment quoted the old example of option_independent_secrets, a key
derivation function over a private seed and the commitment number.
lightning-blake2b/bolts#17 now names a value unique to the channel as a
third input. The producer meets that already: its root is derived per
channel, from a fresh revocation root key and the channel's own funding
key, so it stands for both the seed and the channel's value. Say so.

No change in behaviour.
The test slept 100ms after handing the link a tx_abort, betting that the
link had handled it before the reserves were read. The read is a request
on another queue than the peer's messages, so a slow run could read the
reserves before the abort and pass whatever the abort did to them.

It now waits for the splice handler to have the tx_abort. The link hands
it over from its own goroutine, so from then on a request queued runs
after the abort's handling: with the old behaviour, applying the splice
reserves at the tx_abort, every run fails.
…kends

Built without the dev tag, the interface tests sign the funding inputs
they make with chanfunding's WalletAssembler, through
input.SoleSignerSigHash, so with SIGHASH_ALL|SIGHASH_UNIFIED. The miner
and the backends are a stock SHA256d regtest (btcd's regtest has no
Blake2bHeight, and bitcoind runs without a BLAKE2b activation), which
doesn't know the bit: bitcoind refused the funding transaction with
"non mandatory script verify flag", and with btcd and neutrino it never
reached the mempool, so single_funding_workflow waited for it to confirm
until the test timed out. Tests whose transactions the wallet library
signs passed, since its hash types stay SIGHASH_ALL unless the daemon
changes them.

The harness now opts out, as the daemon does in a development build,
which is how make unit already ran these tests.
@paulscode
paulscode merged commit ea58263 into blake2b Oct 24, 2026
2 checks passed
@paulscode
paulscode deleted the followups-22 branch October 24, 2026 19:05
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