Commit graph

15 commits

Author SHA1 Message Date
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
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
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
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
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
yyforyongyu
a1a480a81c
itest+lntest: add itest testSweepHTLCs to check HTLC sweepings 2024-04-19 21:33:36 +08:00
Carla Kirk-Cohen
0d9a184df8
lntest: dispatch and intercept payment to blinded route
We don't support receiving blinded in this PR - just intercept and
settle instead. The HTLC's arrival on the interceptor indicates that
it was successfully forwarded on a blinded hop.
2024-04-03 09:19:42 -04:00
Carla Kirk-Cohen
69e1162dd1
lntest: add route construction to blinded forwarding test 2024-04-03 09:19:41 -04:00
Carla Kirk-Cohen
58dda83b22
lntest: add helper to create blinded route 2024-04-03 09:19:40 -04:00
Carla Kirk-Cohen
a72aaa3d84
lntest: add setup for blinded route forwarding itest
Note: the itest is broken up into multiple commits to make it
more readable, they can be squashed post-review.
2024-04-03 09:19:39 -04:00
Renamed from itest/lnd_route_blinding.go (Browse further)