Commit Graph

18902 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
c34c35dbac cmd/commands: update query+import+rc mc to accept an mc namespace 2025-06-05 18:30:28 -07:00
Olaoluwa Osuntokun
29ba9686f2 itest: enhance mission control namespace itest
In this commit, we enhance the itess to exercise the new
query+reset+import namespace features. This also rounds out the test as
well to make sure that the mc payment portion works properly.
2025-06-05 18:30:25 -07:00
Olaoluwa Osuntokun
976ca31a25 lnrpc/routerrpc: recognize new mission control param for router rpc server 2025-06-05 18:30:24 -07:00
Olaoluwa Osuntokun
4243a22224 lnrpc/routerrpc: add mc namespace param to: reset+import+query mc 2025-06-05 18:30:21 -07:00
Olaoluwa Osuntokun
d0062cb5dd itest: add test coverage for mission control namespaces
This commit adds integration test coverage for the mission control
namespace feature. The test verifies that:

- Payments can be sent using the default namespace
- Payments can be sent using a custom namespace
- Both namespace types work correctly and maintain isolation
- Mission control records payment attempts in the appropriate namespace

The test creates a simple two-node network, sends payments with different
namespaces, and verifies that mission control is tracking the payment
attempts correctly. This ensures end-to-end functionality of the namespace
feature from the RPC layer through to mission control.
2025-06-05 18:30:17 -07:00
Olaoluwa Osuntokun
d4dbe79e3e rpcserver: wire up mission control namespace selection
This commit connects the RPC layer to the routing layer for mission
control namespace support:

- Updated extractIntentFromSendRequest in router_backend.go to propagate
  the mission_control_namespace from the RPC request to the payment intent
- Modified server.go to provide a GetMissionControl function to the
  SessionSource that retrieves namespaced MissionControl instances from
  the MissionController

These changes complete the integration between the RPC interface and the
routing engine, allowing SendPaymentV2 callers to specify custom mission
control namespaces for their payments.
2025-06-05 18:30:13 -07:00
Olaoluwa Osuntokun
ed6fefe3d0 routing: add support for namespaced mission control in payments
This commit enhances the routing package to support namespaced mission
control for payment routing. The changes include:

- Added MissionControlNamespace field to LightningPayment struct to
  propagate namespace through the routing layer
- Modified SessionSource to accept a GetMissionControl function that
  retrieves namespaced MissionControl instances
- Updated NewPaymentSession to use the namespaced MissionControl when
  a custom namespace is specified in the payment

These changes enable different payment types to maintain separate routing
histories and success/failure statistics through mission control namespaces.
Unit tests are included to verify the namespace functionality.
2025-06-05 18:30:13 -07:00
Olaoluwa Osuntokun
ccfcbd76e5 lnrpc: add mission_control_namespace field to SendPaymentRequest
This commit adds a new optional mission_control_namespace field to the
SendPaymentRequest RPC message. This field allows callers to specify a
custom namespace for mission control, enabling different routing
strategies and payment history isolation for different payment types.

The namespace field is added as field number 26 in the SendPaymentRequest
message. When not specified, the default mission control namespace will
be used, maintaining backward compatibility.
2025-06-05 18:30:05 -07:00
Oliver Gugger
fc906f2a65 Merge pull request #9127 from MPins/issue-8993
Add the option on path creator to specify the incoming channel on blinded path
2025-06-05 08:47:05 +02:00
Oliver Gugger
aec16eee97 Merge pull request #9876 from yyforyongyu/fix-accessman
accessman: remove restrictions on protected/temporary peers
2025-06-04 09:53:13 +02:00
Olaoluwa Osuntokun
89881414e6 Merge pull request #9726 from Roasbeef/protofsm-full-block-conf
protofsm: add option to allow conf resp to return full block
2025-06-03 16:41:22 -07:00
Olaoluwa Osuntokun
3f03752b25 protofsm: add test for new full block conf behavior 2025-06-03 16:39:48 -07:00
Olaoluwa Osuntokun
4908d76653 protofsm: add option to allow conf resp to return full back
In this commit, we add an option to allow a conf req caller to receive
the full block. This is useful if the caller wants to be able to create
an SPV proof.
2025-06-03 16:39:48 -07:00
Olaoluwa Osuntokun
a8930773a4 Merge pull request #9725 from Roasbeef/protofsm-conf-mapper
protofsm: add ConfMapper to allow conf attribute projection for new events
2025-06-03 16:28:01 -07:00
Olaoluwa Osuntokun
946ae4c804 protofsm: add generic type assertion to state machine tests
This commit introduces a new generic type assertion function
`assertState` to the state machine tests. This function asserts that the
state machine is currently in the expected state type and returns the
state cast to that type. This allows us to directly access the fields of
the state without having to perform a type assertion manually.
2025-06-03 16:27:30 -07:00
Olaoluwa Osuntokun
c580666e28 protofsm: add unit tests for SpendMapper 2025-06-03 16:27:30 -07:00
Olaoluwa Osuntokun
cb46f3daa0 protofsm: add new ConfMapper similar to SpendMapper for conf events
In this commit, we add a new ConfMapper which is useful for state
machines that want to project some of the conf attributes into a new
event to be sent post conf.
2025-06-03 16:27:28 -07:00
Oliver Gugger
239aab8b9e Merge pull request #9875 from ziggie1984/fix-peer-connection-2
discovery: make sure we do not block the read queue
2025-06-03 22:37:17 +02:00
ziggie
6f45735d55 docs: add release notes for 19.1 2025-06-03 21:18:19 +02:00
ziggie
732d3a77b4 discovery: increase syncer gossip chan buffer 2025-06-03 21:13:42 +02:00
ziggie
74c5541147 brontide: increase logging when processing gossip msgs
We add logging to we can draw conclusions how long the processing
of gossip message last and potentially see whether the syncer
buffer channel size is a bottleneck in processing.
2025-06-03 21:13:42 +02:00
Oliver Gugger
ac76d63119 Merge pull request #9858 from Roasbeef/non-staging-rbf-coop
peer+feature: start to signal the prod rbf coop close bit
2025-06-03 20:14:22 +02:00
yyforyongyu
e0b6acb584 docs: update release notes 2025-06-03 22:43:34 +08:00
yyforyongyu
04db1a1c3f lnd: increase DefaultNumRestrictedSlots to 100 2025-06-03 22:43:15 +08:00
yyforyongyu
a232c57c8c accessman: patch unit tests 2025-06-03 22:43:14 +08:00
yyforyongyu
704bb736a5 accessman: only check ban score for restricted peers
If a peer has, or used to have a channel with us there's no need to
check for the ban score.
2025-06-03 22:43:14 +08:00
Oliver Gugger
7e444220a7 Merge pull request #9890 from ziggie1984/update-btclog-lib
update btclog lib
2025-06-03 16:22:45 +02:00
ziggie
a59666455b docs: update release-notes 2025-06-03 13:06:28 +02:00
ziggie
73251952d1 mod: update btclog library 2025-06-03 13:06:28 +02:00
Oliver Gugger
c61095ce0b Merge pull request #9879 from ellemouton/graphSQLFixNodesQuery
sqldb+graph/db: fix UpsertNode query to account for nullable `last_update` field
2025-06-02 21:21:25 +02:00
Olaoluwa Osuntokun
f8e67c0bcd Merge pull request #9872 from ziggie1984/fix-peer-connection
brontide: fix peer disconnection issue
2025-06-02 11:53:35 -07:00
Elle Mouton
547b836180 sqldb+graph/db: fix UpsertNode bug
Account for the last_update field being null.
2025-06-02 17:29:03 +02:00
Elle Mouton
eb32b39380 graph/db: demonstrate SQL upsert node bug 2025-06-02 17:28:59 +02:00
Oliver Gugger
e9692f8ccd Merge pull request #9869 from ellemouton/graphSQL8-channels-schema
sqldb+graph/db: add channel tables and implement some channel CRUD
2025-06-02 17:18:04 +02:00
Elle Mouton
cf542458bd graph/db+sqldb: add HighestChanID to SQLStore 2025-06-02 14:53:18 +02:00
Elle Mouton
d93d104a66 graph/db+sqldb: implement AddChannelEdge on SQLStore
In this commit, the `AddChannelEdge` method of the SQLStore is
implemented. Like the KVStore implementation, it makes use of the
available channel `batch.Scheduler` and also updates the reject and
channel caches.

This then lets us convert the following 2 unit tests to run against the
SQL backends:
- TestPartialNode
- TestAddChannelEdgeShellNodes
2025-06-02 14:53:18 +02:00
Elle Mouton
c5f159f485 graph/db: expand AddChannelEdge test
Expand the existing TestAddChannelEdgeShellNodes test so that we have
coverage for error we expect when AddChannelEdge is called a second time
if we already know of a channel.
2025-06-02 14:53:18 +02:00
Elle Mouton
2a36e17f6f graph/db: only init extra byte if not nil
In preparation for having consistency with the structs created by the
SQLStore and the KVStore (so that they have the same behaviour when
tested by the unit tests), here we make sure not to init the
ExtraOpaqueData field of the LightningNode struct unless there are
actualy bytes to set.
2025-06-02 14:53:18 +02:00
Elle Mouton
e5d099ef14 sqldb/sqlc: add graph channel schemas
In this commit, we define the SQL schemas for storing graph channel
data. This includes a new `channels` table and a new `channel_features`
table along with various indices.
2025-06-02 14:53:17 +02:00
Oliver Gugger
f93c675b04 Merge pull request #9885 from ffranr/sm-isrunning-unit-test
protofsm: exercise `StateMachine.IsRunning()` in unit test
2025-06-02 13:49:48 +02:00
ffranr
828e764bbe protofsm: exercise StateMachine.IsRunning() in unit test
Update unit test to call `StateMachine.IsRunning()` to ensure the
method has test coverage.
2025-06-02 10:02:56 +01:00
Oliver Gugger
5a036a8fcd Merge pull request #9883 from ffranr/add-state-machine-isrunning
protofsm: add thread-safe IsRunning method to StateMachine
2025-06-02 10:08:28 +02:00
ffranr
4109ecb057 protofsm: add thread-safe IsRunning method to StateMachine
This commit introduces a new `IsRunning()` method to the `StateMachine`.
This method allows callers to safely query whether the state machine
is currently active after it has been started and before it has been
stopped.

To ensure thread-safety, the internal `running` status flag is
implemented using `atomic.Bool` (from `sync/atomic`). Without atomic
operations, concurrent accesses to a simple boolean flag from different
goroutines (e.g., one goroutine calling `IsRunning()` while another
executes `Start()` or `Stop()`) could lead to stale reads or data races.
2025-06-02 01:06:40 +01:00
ziggie
329c571d5a docs: add release notes 2025-05-29 10:19:28 +02:00
ziggie
e593c9d266 brontide: fix peer disconnection issue
In case when the rbf coop close feature was active we would not
properly disconnect the peer.
2025-05-29 10:19:28 +02:00
ziggie
b837c889dc itest: add disconnect test
Add a connect/disconnect test when the peers both started up
with the rbf coop close feature.
2025-05-29 10:19:21 +02:00
Oliver Gugger
bff2f2440c Merge pull request #9873 from ellemouton/sqldbHelpers
sqldb: re-usable TxOptions and NoOpReset
2025-05-28 12:45:59 +02:00
Elle Mouton
9cbc1f804e multi: use sqldb.NoOpReset helper
Define a re-usable "reset" function, sqldb.NoOpReset, that can be used
for the reset parameter in sql ExecTx calls.
2025-05-28 10:18:53 +02:00
Elle Mouton
c4e6f23c5b multi: add a re-usable TxOptions type
Add a re-usable implementation of the sqldb.TxOptions interface and make
use of this in the various spots (invoices, batch and graph/db) where we
had previously defined individual implementations that were all doing
the same thing.
2025-05-28 10:18:10 +02:00
Oliver Gugger
8e96bd0308 Merge pull request #9866 from ellemouton/graphSQL7-nodes-tables
sqldb+graph/db: add node related tables and implement some node CRUD
2025-05-28 08:45:33 +02:00