Commit Graph
20275 Commits
Author SHA1 Message Date
Elle Mouton 8722a96a4e graphdb: pass context to IsClosedScid 2026-02-25 16:11:46 +02:00
Elle Mouton 4dcaf1c16a graphdb: pass context to PutClosedScid 2026-02-25 16:11:46 +02:00
Elle Mouton 68c5206017 graphdb: pass context to AddEdgeProof 2026-02-25 16:11:46 +02:00
Elle Mouton 3dc2efd7f3 graphdb: pass context to DisconnectBlockAtHeight 2026-02-25 16:11:46 +02:00
Elle Mouton a31c86b0ee graphdb: pass context to PruneTip 2026-02-25 16:11:46 +02:00
Elle Mouton 9f855175d5 graphdb: pass context to ChannelView 2026-02-25 16:11:46 +02:00
Elle Mouton 7dbaa691c4 graphdb: pass context to PruneGraph 2026-02-25 16:11:46 +02:00
Elle Mouton 13668ce45f graphdb: pass context to PruneGraphNodes 2026-02-25 16:11:46 +02:00
Elle Mouton 072244ee18 graphdb: pass context to FilterKnownChanIDs 2026-02-25 16:11:46 +02:00
Elle Mouton 46d37a691f graphdb: pass context to FetchChanInfos 2026-02-25 16:11:46 +02:00
Elle Mouton f62ea62cfe graphdb: pass context to IsPublicNode 2026-02-25 16:11:42 +02:00
Elle Mouton 397330cbdb graphdb: pass context to ChannelID 2026-02-25 16:11:29 +02:00
Elle Mouton 3079c07afb graphdb: pass context to HasChannelEdge 2026-02-25 16:11:29 +02:00
Elle Mouton 87ed09a829 graphdb: pass context to HasV1ChannelEdge 2026-02-25 16:11:29 +02:00
Elle Mouton 1d4c6aadb4 graph/db: thread context through FetchChannelEdgesByOutpoint 2026-02-25 16:11:29 +02:00
Elle Mouton 6bbb9a32fc graph/db: thread context through FetchChannelEdgesByID 2026-02-25 16:11:25 +02:00
Elle Mouton acdef84d30 graph/db: thread context through DeleteChannelEdges 2026-02-25 15:33:59 +02:00
Elle Mouton 37cc6b29d9 graph/db: thread context through NumZombies 2026-02-25 15:33:34 +02:00
Elle Mouton f98905ae99 graph/db: thread context through IsZombieEdge 2026-02-25 15:33:34 +02:00
Elle Mouton 8a96e5f3d2 graph/db: thread context through MarkEdgeLive 2026-02-25 15:33:34 +02:00
Elle Mouton c270367071 graph/db: thread context through MarkEdgeZombie 2026-02-25 15:33:34 +02:00
Elle Mouton bb38aa8922 graph/db: thread context through FilterChannelRange 2026-02-25 15:33:34 +02:00
Elle Mouton e8e714f6a3 graph/db: thread context through ForEachChannelCacheable 2026-02-25 15:33:34 +02:00
Elle Mouton dc9dae8dd6 graph/db: thread context through ChanUpdatesInHorizon 2026-02-25 15:33:34 +02:00
Elle Mouton 6ccf93c2c9 graph/db: thread context through ForEachNodeDirectedChannel 2026-02-25 15:33:34 +02:00
Elle Mouton 2f0d2962dd graph/db: thread context through NodeUpdatesInHorizon 2026-02-25 15:33:34 +02:00
Elle Mouton 0597250ae4 graph/db: thread context through DisabledChannelIDs 2026-02-25 15:33:33 +02:00
Elle Mouton b1873e63ec graph/db: thread context through FetchNodeFeatures 2026-02-25 15:32:05 +02:00
Elle 13a8356558 Merge pull request #10609 from ellemouton/graph-unit-test-cleanup
graph: replace fatal assertions and simplify test helpers
2026-02-25 14:11:13 +02:00
Elle Mouton 160c2a9f68 graph/db tests: make compareEdgePolicies assert internally
Convert compareEdgePolicies into a test helper that accepts a
testing handle and performs assertions directly.

Update call sites to invoke the helper instead of threading errors
into immediate require.NoError checks.
2026-02-25 11:34:31 +02:00
Elle Mouton ceb939ebb1 graph/tests: make createChannelEdge assert internally
Update createChannelEdge to take a testing handle, mark itself as a
helper, and call require.NoError for funding script generation.

All call sites now consume only returned values and no longer plumb
an immediately-asserted error value.
2026-02-25 11:34:05 +02:00
Elle Mouton 963975135c graph/tests: make randEdgePolicy assert internally
Update randEdgePolicy to take a testing handle, mark itself as a
helper, and assert internal packing errors directly with require.

Call sites now receive only the policy value without plumbing an
error through immediate require.NoError checks.
2026-02-25 11:32:04 +02:00
Elle Mouton 8dfe747c02 graph: migrate tests from Fatal to require helpers
Replace remaining fatal-style assertions in graph package tests with
direct testify/require helpers. This simplifies control flow and makes
test intent clearer by using NoError, True/False, Len, Empty, and
Equal/EqualValues assertions.

Also remove FailNow-style patterns in favor of specific assertion
helpers.
2026-02-25 11:31:28 +02:00
Elle Mouton f8899dd324 graph/db: migrate tests from Fatal to require helpers
Replace remaining fatal-style assertions in graph/db tests with direct
testify/require helpers. This simplifies control flow and reduces
indentation by using NoError, True/False, Equal, Len, Empty, and Nil
assertions directly.
2026-02-25 11:14:55 +02:00
Olaoluwa Osuntokun 0b00c66231 Merge pull request #10601 from ziggie1984/invoice-filter-index-optimization
invoices/sql_store: replace catch-all FilterInvoices with targeted index-friendly queries
2026-02-24 16:34:27 -08:00
Yong 344af33ac7 Merge pull request #10557 from Liongrass/master
Remove redundant documentation from /docs
2026-02-24 21:17:22 +08:00
ziggieXXX c81d69e56a Merge pull request #10586 from GeorgeTsagk/add-george-key
scripts: add gpg key for georgetsagk
2026-02-23 16:01:52 +01:00
George Tsagkarelis 05d1df6de1 scripts: add gpg key for georgetsagk 2026-02-23 14:40:07 +01:00
Elle dd65ba2b01 Merge pull request #10543 from bitromortac/2602-channel-update-events
rpc: add channel updates to SubscribeChannelEvents
2026-02-23 13:09:36 +02:00
ziggie 1e5e6f27ef docs: add release notes for invoice SQL query performance improvements 2026-02-21 17:05:44 +01:00
ziggie d26bf84843 invoices/sql_store: add tests for targeted invoice query variants
Add testFetchPendingInvoicesAccepted to explicitly verify the state
filtering behaviour of FetchPendingInvoices across all four contract
states:

  ContractOpen     (state 0) – must be returned
  ContractAccepted (state 3) – must be returned
  ContractSettled  (state 1) – must be excluded
  ContractCanceled (state 2) – must be excluded

This directly exercises the `state IN (0, 3)` predicate introduced in
the FetchPendingInvoices SQL query and addresses the review request for
explicit test coverage of the new targeted query variants. The test
runs against the KV, SQLite, and Postgres backends.
2026-02-21 17:05:44 +01:00
ziggie 9becdfa8a3 sqldb/sqlc: remove deprecated FilterInvoices query
All call sites have been migrated to the targeted replacement queries
in the previous commit. Remove FilterInvoices and its associated
params struct from the SQL source and regenerate.
2026-02-21 16:58:31 +01:00
ziggie 774ebaf126 invoices/sql_store: switch to targeted queries, default timestamp bounds
Replace all four FilterInvoices call sites with the focused queries
introduced in the previous commit:

  FetchPendingInvoices   → FetchPendingInvoices
  InvoicesSettledSince   → FilterInvoicesBySettleIndex
  InvoicesAddedSince     → FilterInvoicesByAddIndex
  QueryInvoices          → FilterInvoicesForward / FilterInvoicesReverse

The first three are straight 1:1 swaps — the new params structs carry
only the fields that are actually used, and the removed fields (Reverse,
PendingOnly, unused index bounds) were always left at their zero values.

QueryInvoices is restructured more substantially. The forward/reverse
branch now selects between FilterInvoicesForward and
FilterInvoicesReverse, each of which takes a concrete id bound that is
always set:

  forward: AddIndexGet = IndexOffset + 1   (≥ 1 when IndexOffset = 0)
  reverse: AddIndexLet = IndexOffset - 1   (or MaxInt64 when offset = 0)

Timestamp parameters are changed from nullable (sql.NullTime with
OR-based SQL fallbacks) to always-on Go-side defaults, consistent with
the approach used by the payments query:

  createdAfter  → time.Unix(0, 0).UTC()          (epoch, before any invoice)
  createdBefore → time.Date(9999, 12, 31, …)     (far future, no upper cap)

This ensures the planner always sees plain range predicates on
created_at and can use the invoices_created_at_idx index.

The SQLInvoiceQueries interface is updated to expose the five new
methods and drop FilterInvoices.
2026-02-21 16:57:08 +01:00
ziggie 866efbd7fb sqldb/sqlc: add targeted invoice queries
The existing FilterInvoices query uses optional parameters via the
pattern `(col >= param OR param IS NULL)` for every filter. SQLite
cannot use indexes with this pattern because the OR prevents the query
planner from determining at plan time which rows satisfy the condition,
resulting in a full table scan regardless of the available indexes
(invoices_state_idx, invoices_settle_index_idx, and the primary-key
clustered index on id).

Additionally, the conditional ORDER BY:

  ORDER BY CASE WHEN reverse = FALSE ... THEN id ELSE NULL END ASC,
           CASE WHEN reverse = TRUE  ... THEN id ELSE NULL END DESC

prevents the planner from using the index ordering and forces an
explicit sort.

Add five focused replacements, each with a plain sargable predicate and
a direct ORDER BY so the planner can always choose an index scan:

  - FetchPendingInvoices:        WHERE state IN (0, 3)
  - FilterInvoicesBySettleIndex: WHERE settle_index >= $1
  - FilterInvoicesByAddIndex:    WHERE id >= $1
  - FilterInvoicesForward:       WHERE id >= $1 ... ORDER BY id ASC
  - FilterInvoicesReverse:       WHERE id <= $1 ... ORDER BY id DESC

FilterInvoicesForward and FilterInvoicesReverse accept non-nullable
timestamp parameters (created_after, created_before) so the planner
always sees plain range predicates on created_at. Callers supply
Go-side defaults when no date filter is needed, following the same
convention already used by the payments query.

FilterInvoices is kept in this commit so all existing call sites
continue to compile. It will be removed once all callers have been
migrated.
2026-02-21 16:09:03 +01:00
bitromortac 3a00ed4a8d docs: update release notes 2026-02-20 10:47:48 +01:00
bitromortac fa5722355f itest: test channel update subscription 2026-02-20 10:47:04 +01:00
bitromortac 10e8a69cec lnd: handle channel update events in SubscribeChannelEvents 2026-02-20 10:47:04 +01:00
bitromortac 4f22a5130d proto: add ChannelCommitUpdate to channel event updates 2026-02-20 10:47:03 +01:00
bitromortac 4701f00cfd htlcswitch: let link notify on remote commit sig 2026-02-20 10:43:52 +01:00
bitromortac 0f1472536c peer+htlcswitch: inject notification endpoint 2026-02-20 10:43:52 +01:00