Commit graph

134 commits

Author SHA1 Message Date
Oliver Gugger
9cd7285439
itest+lntest: use system wide unique ports everywhere
With this commit we create a new function that returns system wide
unique ports by using a single file to keep track of previously used
ports. We'll want to use this everywhere whenever we need to listen on a
new, random port during unit or integration tests.
Because we now have a unique source, we don't need to apply the port
offset that was used for the different tranches of parallel running
integration tests before.
2024-03-18 16:13:39 +01:00
Oliver Gugger
0bc3d29413
Merge pull request #8496 from aakselrod/locks-to-leases
multi: replace `LockOutpoint` with `LeaseOutput`
2024-03-18 03:34:56 -06:00
Alex Akselrod
07ba9d6015
itest: add open channel locked balance test 2024-03-13 09:50:15 -07:00
Olaoluwa Osuntokun
716c6dddd8
Merge pull request #8052 from bhandras/sql-invoices
sqldb: `InvoiceDB` implementation
2024-03-06 21:15:14 -06:00
Slyghtning
e79b8b2986
itest: estimate route fee tests 2024-03-05 09:24:27 +01:00
Slyghtning
ef069b658d
itest: preparatory fee estimation changes 2024-03-05 09:24:27 +01:00
Andras Banki-Horvath
ba8e7550d5
itest: add the -nativesql flag to run SQL itests with native SQL tables 2024-03-01 10:08:10 +01:00
Oliver Gugger
6dea39c23a
itest: add new test for FundPsbt with coin selection 2024-02-26 11:06:22 +01:00
Oliver Gugger
9bdddbcc56
mod+chanfunding: use coin selection strategy for channel funding
The wallet assembler is now aware of the node config level coin
selection strategy, so we can use it when creating new channels.
2024-02-23 08:58:09 +01:00
Elle Mouton
785790abed
peer/lnwallet: persist shutdown info on send
In this commit, we start persisting shutdown info when we send the
Shutdown message. When starting up a link, we also first check if we
have previously persisted Shutdown info and if we have, we start the
link in shutdown mode meaning that it will not accept any new outgoing
HTLC additions and it will queue the shutdown message after any pending
CommitSig has been sent.
2024-02-21 11:58:18 +02:00
Elle Mouton
987604effb
itest: demonstrate shutdown on restart bug
This commit adds an itest to demonstrate that the following bug exists:
If channel Shutdown is initiated but then a re-connect is done before
the shutdown is complete, then the initiating node currently does not
properly resend the Shutdown message as required by the spec. This will
be fixed in an upcoming commit.
2024-02-21 11:35:12 +02:00
Elle Mouton
71753af8ee
multi: fix various typos 2024-02-21 11:35:10 +02:00
Elle Mouton
4ab17525ce
itest+lntest: add wtclient session & tower management test 2024-02-20 14:44:39 +02:00
Elle Mouton
59a4bfbc59
itest+refactor: extract various tower test helpers 2024-02-20 14:44:39 +02:00
Elle Mouton
d4424fbcfa
itest: refactor watchtower related tests 2024-02-20 14:44:39 +02:00
yyforyongyu
221e7ff898
itest: update testListPayments to precisely test timestamp filters 2024-02-05 15:23:57 +08:00
Yong
d41b86bb7e
Merge pull request #7852 from ziggie1984/pathfind_sizeestimate
Path Finding Size Estimation including Blinded Path Data
2024-02-05 15:21:51 +08:00
ziggie
4732c09a26
multi: Fix final hop payload size for AMP payments. 2024-02-03 12:16:06 +00:00
Andras Banki-Horvath
187e61da23
itests: add itest for ListSweeps's start_height 2024-02-01 21:02:25 +01:00
Yong
dd7b186622
Merge pull request #8426 from breez/expose-closing-tx
Expose closing tx in waiting_close_channels
2024-01-30 09:13:17 +08:00
Jesse de Wit
b6616bc040
itest: assert closing tx is set in waiting_close_channels 2024-01-29 14:16:51 +01:00
Yong
59feec44ca
Merge pull request #7976 from w3irdrobot/serialize-deserialize-amp
Serialize/deserialize AMP struct in hop
2024-01-29 09:48:05 +08:00
Alex Sears
0767a2cbc0
routerrpc: unmarshal AMP record in route hop marshalling 2024-01-26 15:21:43 -05:00
Keagan McClelland
07277172f8 itest+lntest: remove temporary hacks around broken coop close in itests 2024-01-23 14:31:51 -08:00
Keagan McClelland
9e58ebd0fb itest: test that we can close with in-flight htlcs 2024-01-23 12:25:06 -08:00
ziggie
ccac5c349c
multi: Add itest for a failed funding flow.
This adds an itest for a failed funding flow by our peer.
2024-01-22 16:45:38 +00:00
Elle Mouton
55ee01a6ca
itest: add taproot tower itest 2024-01-19 15:33:07 +02:00
Keagan McClelland
109265c77a multi: make static remote key compulsory 2024-01-11 13:58:01 -08:00
ziggie
a1678fa9b7
itest: multi part payments test fix.
Because we need to account for an addtional fee buffer we need to
increase channel capacities for the multi payment tests.
2024-01-08 16:47:47 +01:00
ziggie
1ca3732f25
itest: add an itest for the removal of a tx. 2023-12-12 14:18:16 +01:00
erik
16f05105c1 itest: add gettransactiondetails 2023-12-10 22:14:18 +01:00
Yong
9f42459036
Merge pull request #8177 from yyforyongyu/payment-status
routerrpc: optionally return the new payment status
2023-11-30 17:15:23 +08:00
yyforyongyu
ded9fe6a84
itest: fix flake in multi_hop_htlc_remote_chain_claim 2023-11-17 17:29:53 +08:00
yyforyongyu
99354313d5
routerrpc+itest: make sure TrackPayments is compatible
This commit adds an itest case to make sure when the flag
`routerrpc.usestatusinitiated` is not set, the new status is not sent.
2023-11-15 20:18:21 +08:00
yyforyongyu
816a70e08c
multi: add new config usestatusinitiated for the new payment status
This commit adds a new config value to signal that the user understands
the new payment status `StatusInitiated`.
2023-11-15 20:18:17 +08:00
yyforyongyu
5168af55a9
itest: fix flake in max_htlc_pathfind
```
lnd_max_htlcs_test.go:149:
        	Error Trace:	/home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:149
        	            				/home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:40
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:286
        	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:136
        	Error:      	Not equal:
        	            	expected: 3
        	            	actual  : 0
        	Test:       	TestLightningNetworkDaemon/tranche01/60-of-134/btcd/max_htlc_pathfind
        	Messages:   	expected accepted
```
2023-11-13 16:11:07 +08:00
Olaoluwa Osuntokun
dacb86fdbc
Merge pull request #8106 from orbitalturtle/sign-tagged-hash-rpc
lnrpc: add tagged hash option to signer.SignMessage/VerifyMessage rpcs
2023-11-06 17:05:35 -08:00
Olaoluwa Osuntokun
9287b755d8
macaroons: reject unknown macaroon versions
We've only ever made macaroons with the v2 versions, so we should
explicitly reject those that aren't actually v2. We add a basic test
along the way, and also add a similar check for the version encoded in
the macaroon ID.
2023-10-31 13:23:50 -07:00
Olaoluwa Osuntokun
c382268201
Merge pull request #8104 from Roasbeef/taproot-chans-nonce-double-init
multi: skip InitRemoteMusigNonces if we've already called it
2023-10-31 13:02:54 -07:00
Slyghtning
12f23d2352
itest: simple taproot channel status 2023-10-31 10:10:43 -07:00
yyforyongyu
fc52a01055
itest: fix test flake in testHtlcTimeoutResolverExtractPreimageRemote
From the build,
```
harness_miner.go:218:
        	Error Trace:	/home/runner/work/lnd/lnd/lntest/harness_miner.go:218
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:1641
        	            				/home/runner/work/lnd/lnd/itest/lnd_multi-hop_test.go:2207
        	            				/home/runner/work/lnd/lnd/itest/lnd_multi-hop_test.go:152
        	Error:      	Received unexpected error:
        	            	want 2, got 3 in mempool: [a7cbb5724e39579cfc75d0469270f691988cb67fcc51a332256cafb193cf40bd b12a03a0622a3cf7d53867f060a6de8166e564a1a3109bc2be1ec0b720f305da 073d66885ccded1a770dc9aa5f1d44c8e10ac4e916e5ab50ef5149a5649ec8ba]
        	Test:       	TestLightningNetworkDaemon/tranche03/130-of-135/neutrino/htlc_timeout_resolver_extract_preimage_remote/zeroconf=false/committype=SIMPLE_TAPROOT
        	Messages:   	assert tx in mempool timeout
    harness.go:339: finished test: htlc_timeout_resolver_extract_preimage_remote, start height=1312, end height=1347, mined blocks=35
```
2023-10-31 23:49:31 +08:00
Orbital
aa6f13e524
itest: test SignMessage/VerifyMessage tag option 2023-10-30 21:39:39 -05:00
Jonathan Harvey-Buschel
c5d041f2f4
itest: add GetBlockHeader to ChainKit tests 2023-10-27 11:05:28 -04:00
yyforyongyu
0816f9124c
itest: update itest to reflect new sweeper behavior 2023-10-23 13:01:50 +08:00
Yong
939375f1a5
sweeper: relax anchor sweeping when there's no deadline pressure (#7965)
* sweep: use longer variable name for clarity in `addToState`

* sweeper: add more docs and debug logs

* sweep: prioritize smaller inputs when adding wallet UTXOs

This commit sorts wallet UTXOs by their values when using them for
sweeping inputs. This way we'd avoid locking large UTXOs when sweeping
inputs and also provide an opportunity to aggregate wallet UTXOs.

* contractcourt+itest: relax anchor sweeping for CPFP purpose

This commit changes from always sweeping anchor for a local force close
to only do so when there is an actual time pressure. After this change,
a forced anchor sweeping will only be attempted when the deadline is
less than 144 blocks.

* docs: update release notes

* itest: update test `testMultiHopHtlcLocalChainClaim` to skip CPFP

Since we now only perform CPFP when both the fee rate is higher and the
deadline is less than 144, we need to update the test to reflect that
Bob will not CPFP the force close tx for the channle Alice->Bob.

* itest: fix `testMultiHopRemoteForceCloseOnChainHtlcTimeout`

* itest: update related tests to reflect anchor sweeping

This commit updates all related tests to reflect the latest anchor
sweeping behavior. Previously, anchor sweeping is always attempted as
CPFP when a force close is broadcast, while now it only happens when the
deadline is less than 144. For non-CPFP purpose sweeping, it will happen
after one block is mined after the force close transaction is confirmed
as the anchor will be resent to the sweeper with a floor fee rate, hence
making it economical to sweep.
2023-10-12 17:18:59 +02:00
Eugene
9478b85e59
htlcswitch/hop: use InvalidOnionVersion for replayed packets (#7937)
* htlcswitch/hop: use InvalidOnionVersion for replayed packets

The link will send an update_fail_malformed_htlc, so we need to set
the BADONION bit. Since there isn't a replay-specific error, we
set the failure code to InvalidOnionVersion which has the BADONION bit.

* release-notes: update for 0.17.1
2023-10-11 10:08:43 +02:00
Carla Kirk-Cohen
b42a621438 lntest: add coverage for single hop blinded route query routes 2023-10-06 16:38:33 -07:00
Carla Kirk-Cohen
eb31ff553b lntest/itest: add coverage for querying routes to blinded paths 2023-10-06 16:38:33 -07:00
yyforyongyu
24fa35ec80 multi: make sure CPFP won't exceed max allowed fee rate
This commit updates the `fee()` method in `weightEstimator` to make sure
when doing CPFP we are not exceeding the max allowed fee rate. In order
to use the max fee rate, we need to modify several methods to pass the
configured value to the estimator.
2023-10-06 16:34:47 -07:00
yyforyongyu
258fe7999b sweep+itest: change MaxFeeRate to use SatPerVbyte 2023-10-06 16:34:47 -07:00