lnd/graph/db/models
Erick Cestari 2ae1db83b3
multi: drop tor v2 onion production, keep wire codec faithful
Tor stopped serving v2 onion services in October 2021; lnd should not
produce v2 addresses anymore, but it must still verify signatures on
and re-broadcast peer NodeAnnouncement messages that carry v2 entries.

Stop accepting v2 as configuration input (lncfg), strip the legacy
`--tor.v2` flag from the sample config, and remove the
`tor.OnionHostToFakeIP` helper. Operator entry points (`--externalip`,
`--listen`, `lncli connect`, `lncli wtclient towers add`) fail fast on
a v2 `.onion` string, so upgrading nodes must remove any v2 entry from
`lnd.conf` before lnd will start.

Filter persisted v2 state before use without rewriting on-disk records:
the self-announcement builder strips any v2 entry inherited from the
stored self-node; the watchtower client drops v2 entries from each
persisted tower's address list (skipping the tower entirely if no
non-v2 address remains); the autopilot connector, graph bootstrapper,
and static-channel backup restore paths skip v2 entries before
attempting outbound dials. Restrict the Tor controller's ADD_ONION
path to v3 keys, including the encrypted on-disk legacy-key fallback.

For inbound announcements, keep the wire codec wire-faithful:
`lnwire.WriteOnionAddr`, `graph/db.encodeOnionAddr`, and the matching
decoders round-trip v2 bytes so `DataToSign` reproduces the bytes the
remote peer signed, signature validation succeeds, and the announcement
is persisted to the graph DB and re-broadcast across restarts byte-for-
byte. RPC surfaces continue to expose the full address set so external
tools can independently reproduce and verify the signed bytes.

Add a netann regression test that signs a [v3, v2, ipv4] announcement,
round-trips it through Encode/Decode, verifies the signature, and
confirms the resulting models.Node preserves the v2 entry. Add a
graph bootstrapper test asserting v2 entries are skipped while v3 and
plain TCP entries on the same node still surface as bootstrap
candidates.
2026-05-22 09:42:37 -03:00
..
cached_edge_info.go graph/db: let GraghCache.AddChannel take CachedEdgeInfo 2025-06-10 20:10:35 +02:00
cached_edge_policy.go graph/db: refactor CachedEdgePolicy to use explicit boolean fields 2026-02-13 07:21:24 +02:00
channel.go multi+refactor: move models package to graph/db 2024-11-28 13:34:33 +02:00
channel_auth_proof.go graph/db: treat empty channel signatures as missing 2026-02-13 07:21:23 +02:00
channel_edge_info.go graph/db: honor taproot feature bit in v1 funding script construction 2026-03-27 14:19:18 +02:00
channel_edge_info_test.go graph/db: honor taproot feature bit in v1 funding script construction 2026-03-27 14:19:18 +02:00
channel_edge_policy.go multi: add ChanEdgePolicyFromWire constructor for ChannelEdgePolicy 2026-02-13 07:21:24 +02:00
inbound_fee.go multi+refactor: move models package to graph/db 2024-11-28 13:34:33 +02:00
inbound_fee_test.go multi+refactor: move models package to graph/db 2024-11-28 13:34:33 +02:00
node.go multi: drop tor v2 onion production, keep wire codec faithful 2026-05-22 09:42:37 -03:00