Commit Graph

201 Commits

Author SHA1 Message Date
yyforyongyu
4dcce9df69
lntest+itest: fix flakes found using neutrino backend
This commit makes sure the sweep requests are received before mining
blocks to trigger the actual sweeping.

In addition, `testFundingExpiryBlocksOnPending` is updated to deal with
the old `channel link not found` issue.
2024-07-23 21:30:09 +08:00
yyforyongyu
50279464ad
itest: remove unused param in chanRestoreViaRPC 2024-07-23 21:30:08 +08:00
yyforyongyu
8240a87c2b
itest: fix misuse of MineBlocks and replace it with
`MineBlocksAndAssertNumTxes`
2024-07-23 21:30:08 +08:00
yyforyongyu
f1f341095e
lntest+itest: add new method CurrentHeight 2024-07-23 21:30:08 +08:00
yyforyongyu
14e7b134d9
lntest+itest: make Miner a private instance 2024-07-23 21:30:08 +08:00
yyforyongyu
be4dba5da6
lntest+itest: finalize moving miner methods 2024-07-23 21:30:07 +08:00
yyforyongyu
6bd8baea38
lntest+itest: continue removing direct call to Miner 2024-07-23 21:30:07 +08:00
yyforyongyu
976bb37972
lntest+itest: add method AssertNumTxsInMempool and AssertTxInBlock
in harness

Prepare to make `HarnessTest.Miner` a private instance to sync height.
2024-07-23 21:30:07 +08:00
yyforyongyu
e553895ddd
lntest+itest: strictly define the behavior of MineBlocks
This commit adds more assertion to `MineBlocks` so the caller won't
misuse it.
2024-07-23 21:30:07 +08:00
Elle Mouton
ad0905f10e
record+htlcswitch: convert BlindedRouteData fields to optional
For the final hop in a blinded route, the SCID and RelayInfo fields will
_not_ be set. So these fields need to be converted to optional records.

The existing BlindedRouteData constructor is also renamed to
`NewNonFinalBlindedRouteData` in preparation for a
`NewFinalBlindedRouteData` constructor which will be used to construct
the blinded data for the final hop which will contain a much smaller set
of data. The SCID and RelayInfo parameters of the constructor are left
as non-pointers in order to force the caller to set them in the case
that the constructor is called for non-final nodes. The other option
would be to create a single constructor where all parameters are
optional but I think this makes it easier for the caller to make a
mistake.
2024-07-10 09:12:39 +02:00
Elle Mouton
f3cdbbed2f
itest+lntest: let abandoned channel be either not found or in zombie
index

When abandoning a channel, we remove it from the graph and then add it
to the zombie channel index. However, if we then process a ChannelUpdate
for this channel it will result in us calling `processZombieUpdate`
which will delete the edge from the zombie index. The abandon channel
itest currently asserts that a channel is no longer in the graph by
asserting that when querying for the channel we get a "marked as zombie"
error but to account for the above series of operations, we now also
allow it to just not be found at all ("edge not found").
2024-06-14 14:33:43 -04:00
yyforyongyu
955670fcc2
itest: provide a temporary fix to unblock CI 2024-06-14 15:18:20 +08:00
yyforyongyu
9f34a4dc54
itest: skip error assertion when parent context finishes
We may get a flake like the following,
```
lnd_route_blinding_test.go:468:
            Error Trace:    /Users/runner/work/lnd/lnd/itest/lnd_route_blinding_test.go:468
                                        /Users/runner/hostedtoolcache/go/1.22.3/arm64/src/runtime/asm_arm64.s:1222
            Error:          Received unexpected error:
                            rpc error: code = Canceled desc = context canceled
            Test:           TestLightningNetworkDaemon/tranche15/144-of-156/bitcoind/disable_introduction_node
```

This happens when the test successfully finishes, the parent context is
canceled, causing the child context to return an error. We fix it by
ignoring it in the goroutine.
2024-06-13 17:54:30 +08:00
Keagan McClelland
56048133f2 itest+lntest: add itest to reproduce bug #8535 2024-06-05 12:56:04 -07:00
yyforyongyu
c9cad6ab81
itest+sweep: refactor testSignPsbt to use Subtest and add logs 2024-06-04 09:07:44 +02:00
Olaoluwa Osuntokun
ff85328050
Merge pull request #8774 from yyforyongyu/fix-size-calc
lnwallet+sweep: fix wrong unit used in fee calculation
2024-05-27 18:44:29 -07:00
yyforyongyu
8da68bb7db
multi: apply the new type lntypes.WeightUnit 2024-05-25 13:37:13 +08:00
Olaoluwa Osuntokun
bc6292f8bd
Merge pull request #8758 from feelancer21/preserve-inbound-fees
multi: Inbound fees are retained when not provided
2024-05-23 13:58:52 -07:00
feelancer21
dc4ec45423
itest: add more tests related to inbound fees
Add tests for setting inbound fees in channel policies, including tests
where no inbound fees are set in the PolicyUpdateRequest.
2024-05-22 20:48:52 +02:00
feelancer21
f62c00fe34
multi: Inbound fees are retained when not provided
Fixes the problem that inbound base fee and fee rate are overwritten
with 0 if they are not specified in PolicyUpdateRequest. This ensures
backward compatibility with older rpc clients that do not yet support
the inbound feature.
2024-05-22 20:48:42 +02:00
yyforyongyu
e45db07a10
contractcourt+itest: make sure ChannelArbitrator has the latest htlcs 2024-05-21 00:53:23 +08:00
yyforyongyu
4079f61d7e
itest+sweep: fix current itest re anchor deadline 2024-05-21 00:53:20 +08:00
yyforyongyu
e68c0235c6
itest: add new itests to check CPFP anchor sweeping behavior
Replaced `testSweepAnchorCPFPLocalForceClose` with dedicated tests.
2024-05-18 07:45:10 +08:00
Carla Kirk-Cohen
6e3a46ee91 itest: add more comprehensive assertions before HTLC cleared check
We mine quite a few blocks in this test to trigger a htlc timeout,
so it can be pretty slow. This fix adds assertions for additional
"state steps" that happen in between the failing of the htlc on-chain
and asserting that we're fully cleared out so that slower running
machines won't timeout.
2024-04-27 11:42:35 -04:00
Olaoluwa Osuntokun
675ae6e213
Merge pull request #8693 from yyforyongyu/add-default-conf
rpc: add default conf target back
2024-04-26 12:45:06 -07:00
Olaoluwa Osuntokun
add2691954
Merge pull request #8485 from carlaKC/7298-3-forwardblindedroutes
[3/3]: Blinded Route Error Handling
2024-04-26 12:39:11 -07:00
Carla Kirk-Cohen
75d4a4c295
itest: add coverage for blinded error resolution from on-chain failure
This itest adds a test that we still propagate blinded errors back
properly after a restart with an on-chain resolution. The test also
updates our sendpayment timeout to longer so that there's time to
resolve the on chain claim.
2024-04-26 11:35:17 -04:00
Carla Kirk-Cohen
2140f1940f
itest: manually set timeout on cancel payment and provide cancel
For tests where our payments require an on-chain resolution,
provide longer timeout and return cancel functions.
2024-04-26 10:56:33 -04:00
yyforyongyu
d0441a2a29
multi: add default conf targt in SendCoins/SendMany/OpenChannel/CloseChannel 2024-04-26 10:42:44 +08:00
Olaoluwa Osuntokun
e8031fdccf
lnrpc: ensure parsing of the Amp flag for payments is consistent
In this commit, we fix an inconsistent in the API related to AMP
payments. When a payment request isn't specified, we require the `--amp`
flag on the CLI to make an AMP payment. However, for payment requests,
we don't require this flag. To fix this inconsistency, we now require
the `--amp` flag to _also_ be set for payment requests.
2024-04-25 16:16:16 -07:00
Olaoluwa Osuntokun
ab2f34e13b
Merge pull request #8621 from ziggie1984/fix-sync-neutrino-nodes
fix sync neutrino nodes
2024-04-25 16:13:32 -07:00
Carla Kirk-Cohen
d57c6fab47
itest: add coverage for disabling blinded forwards 2024-04-25 09:47:17 -04:00
Carla Kirk-Cohen
428a33fbda
itest: add coverage for failure at the introduction node 2024-04-25 09:47:16 -04:00
Carla Kirk-Cohen
4535cf6c65
itest: add coverage for failure within a blinded route 2024-04-25 09:47:15 -04:00
Carla Kirk-Cohen
d13a73a93a
itest: add test coverage for failure at blinded receiver 2024-04-25 09:47:14 -04:00
ziggie
9f9d1c9e0b
itest: fix typo. 2024-04-25 12:00:26 +01:00
erik
ab83343c87 multi: repleace ioutil.ReadFile 2024-04-25 11:22:43 +02:00
Oliver Gugger
fe26005228
Merge pull request #8592 from zhiqiangxu/master
itest: fix ascii
2024-04-24 11:05:21 -06:00
zhiqiangxu
64740e18cb itest: fix ascii 2024-04-24 23:30:03 +08:00
ziggie
351e9a68dd
multi: Add tests to psbt and normal open channel flow.
Itests were added to the normal channel funding flow and the psbt
funding flow using unstable (unconfirmed sweeper inputs).
2024-04-24 13:58:20 +01:00
yyforyongyu
d854c80aa7
itest+lntest: fix itest re the new sweeping behavior 2024-04-20 04:41:29 +08:00
yyforyongyu
96883f307c
itest+sweep: add itest testSweepCommitOutputAndAnchor
This commit adds a test case to check the no deadline sweeping behavior.
The sweeper is updated to make sure it can handle the case for neutrino
backend.
2024-04-19 21:33:39 +08:00
yyforyongyu
6f55a7af05
itest: add new test to check BumpFee and PendingSweeps 2024-04-19 21:33:38 +08:00
yyforyongyu
db3aad31aa
lnrpc+sweep: rename Force to Immediate for clarity 2024-04-19 21:33:37 +08:00
yyforyongyu
563a5caed5
itest: fix watchtower test 2024-04-19 21:33:37 +08:00
yyforyongyu
d4de6dd236
itest+lntest: fix onchain tests 2024-04-19 21:33:37 +08:00
yyforyongyu
9c34eb7a56
itest: fix revocation itest 2024-04-19 21:33:37 +08:00
yyforyongyu
30c2b9f2df
itest: fix channel backup tests 2024-04-19 21:33:36 +08:00
yyforyongyu
f68c14321b
itest: fix multi-hop itest 2024-04-19 21:33:36 +08:00
yyforyongyu
ce58175314
itest+lntest: fix channel force close itest 2024-04-19 21:33:36 +08:00