Related to #9964 (bbolt deprecation / sqlite as default backend).
Background
LND currently exposes --db.use-native-sql (default false) on sqlite/postgres backends. When unset, invoices, graph, and payments are persisted via KV-on-SQL emulation; when set, they use native SQL schemas. With #6288 (invoices), the graph SQL epic, and #7920 (payments) all landed, every subsystem that has a native schema is now production-ready, and KV-on-SQL is strictly the slower / less-typed of the two paths.
Proposal
Stop offering KV-on-SQL as a runtime option. Concretely:
- In
lncfg.DB.Validate(), force UseNativeSQL = true whenever the backend is sqlite or postgres. Bolt and etcd remain unaffected (they keep their existing KV path).
- Deprecate
--db.use-native-sql for one release (logged warning when set explicitly on an SQL backend, ignored otherwise), then remove it.
- Drop the
bitcoind-sqlite / bitcoind-postgres non-nativesql rows from .github/workflows/main.yml — their nativesql=true counterparts already exercise the only remaining SQL code path.
- Migrate or delete unit tests that exercise KV-on-SQL on a SQL backend (audit needed).
- Keep
--db.skip-native-sql-migration — it's still the escape hatch for migration failures, orthogonal to this change.
Why separate from #9964
#9964 covers what backend new nodes choose by default and when bbolt is blocked for new init. This issue covers the persistence shape used within a chosen SQL backend. They're tightly coupled (defaulting new nodes to sqlite is most useful when sqlite is automatically on the native path) but distinct enough to review and ship independently.
Milestone
v0.22.0, alongside #9964.
Related to #9964 (bbolt deprecation / sqlite as default backend).
Background
LND currently exposes
--db.use-native-sql(defaultfalse) on sqlite/postgres backends. When unset, invoices, graph, and payments are persisted via KV-on-SQL emulation; when set, they use native SQL schemas. With #6288 (invoices), the graph SQL epic, and #7920 (payments) all landed, every subsystem that has a native schema is now production-ready, and KV-on-SQL is strictly the slower / less-typed of the two paths.Proposal
Stop offering KV-on-SQL as a runtime option. Concretely:
lncfg.DB.Validate(), forceUseNativeSQL = truewhenever the backend is sqlite or postgres. Bolt and etcd remain unaffected (they keep their existing KV path).--db.use-native-sqlfor one release (logged warning when set explicitly on an SQL backend, ignored otherwise), then remove it.bitcoind-sqlite/bitcoind-postgresnon-nativesql rows from.github/workflows/main.yml— their nativesql=true counterparts already exercise the only remaining SQL code path.--db.skip-native-sql-migration— it's still the escape hatch for migration failures, orthogonal to this change.Why separate from #9964
#9964 covers what backend new nodes choose by default and when bbolt is blocked for new init. This issue covers the persistence shape used within a chosen SQL backend. They're tightly coupled (defaulting new nodes to sqlite is most useful when sqlite is automatically on the native path) but distinct enough to review and ship independently.
Milestone
v0.22.0, alongside #9964.