Skip to content

Commit d3bdd03

Browse files
authored
Merge pull request #790 from lightninglabs/reverse-invoice-fix
mod+itest: reproduce and fix reverse direction invoice payment, bump to rc4
2 parents 2f0f95d + b9e6bb5 commit d3bdd03

File tree

11 files changed

+232
-42
lines changed

11 files changed

+232
-42
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Visit https://localhost:8443 to access Terminal.
3232

3333
Note that a password with a minimum of 8 characters is required to run Lightning Terminal. In a production environment, it's recommended that you store this password as an environment variable to avoid it being recorded in the command history.
3434

35-
To use LiT with a remote `lnd` instance please [follow these instructions](./doc/config-lnd-remote.md). If you would like to replace your existing LND instance with the one integrated within LiT please see [configuring Terminal](./doc/config-lnd-integrated.md).
35+
To use LiT with a remote `lnd` instance please [follow these instructions](./docs/config-lnd-remote.md). If you would like to replace your existing LND instance with the one integrated within LiT please see [configuring Terminal](./doc/config-lnd-integrated.md).
3636

3737
## LND
3838
Note that LiT requires `lnd` to be built with **all of its subservers** and requires running at least v0.11.0. Download the latest [official release binary](https://github.com/lightningnetwork/lnd/releases/latest) or build `lnd` from source by following the [installation instructions](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md). If you choose to build `lnd` from source, use the following command to enable all the relevant subservers:
@@ -43,7 +43,7 @@ Note that LiT requires `lnd` to be built with **all of its subservers** and requ
4343

4444
## Interaction
4545
If you plan to run LiT on a remote machine but access the web-interface from your computer you may not want to deal with self-signed certificate browser warnings. To avoid these warnings configure the HTTP server to use a certificate from [Let's Encrypt](https://letsencrypt.org/). View the
46-
[Let's Encrypt Configuration](./doc/letsencrypt.md) doc for instructions on how to configure this.
46+
[Let's Encrypt Configuration](./docs/letsencrypt.md) doc for instructions on how to configure this.
4747

4848
## Upgrading
4949
If you used command line arguments with previous versions then you don't need to change anything when upgrading.
@@ -56,13 +56,13 @@ To upgrade from v0.1.1-alpha or earlier simply create a `lit.conf` file in your
5656
Move all the configuration settings specific to LiT from `lnd.conf` to `lit.conf` and remove any previous LiT-specific customizations from the configuration settings in `lnd.conf`. Note that any section headers (`[ Example ]`) in `lit.conf` should be removed or changed to comments (`# Example`).
5757

5858
## Usage
59-
Read the [walkthrough](doc/WALKTHROUGH.md) document to learn more about how to use LiT.
59+
Read the [walkthrough](docs/WALKTHROUGH.md) document to learn more about how to use LiT.
6060

6161
## Troubleshooting
62-
If you encounter any issues please see our [troubleshooting guide](./doc/troubleshooting.md).
62+
If you encounter any issues please see our [troubleshooting guide](./docs/troubleshooting.md).
6363

6464
## Build from source
65-
If you’d prefer to compile from source code please follow [these instructions](./doc/compile.md).
65+
If you’d prefer to compile from source code please follow [these instructions](./docs/compile.md).
6666

6767
## Compatibility
6868

@@ -126,9 +126,9 @@ in remote mode (meaning that `lnd-mode=remote` is set). It shows the
126126

127127
LiT offers two main operating modes, one in which [`lnd` is running inside the
128128
LiT process (called "lnd integrated mode", set by `lnd-mode=integrated` config
129-
option)](doc/config-lnd-integrated.md) and one in which [`lnd` is running in
129+
option)](docs/config-lnd-integrated.md) and one in which [`lnd` is running in
130130
a standalone process on the same or remote machine (called "lnd remote mode",
131-
set by `lnd-mode=remote` config option)](doc/config-lnd-remote.md).
131+
set by `lnd-mode=remote` config option)](docs/config-lnd-remote.md).
132132

133133
In addition to those main modes, the individual bundled daemons (Faraday, Loop
134134
and Pool) can be toggled to be integrated or remote as well, or as disabled.

cmd/litcli/ln.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ func addInvoice(ctx *cli.Context) error {
727727
ValueMsat: int64(numMSats),
728728
DescriptionHash: descHash,
729729
FallbackAddr: ctx.String("fallback_addr"),
730-
Expiry: int64(timeoutSeconds),
730+
Expiry: int64(ctx.Uint64("expiry")),
731731
Private: ctx.Bool("private"),
732732
IsAmp: ctx.Bool("amp"),
733733
RouteHints: []*lnrpc.RouteHint{

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ require (
2020
github.com/lightninglabs/loop/swapserverrpc v1.0.8
2121
github.com/lightninglabs/pool v0.6.5-beta.0.20240604070222-e121aadb3289
2222
github.com/lightninglabs/pool/auctioneerrpc v1.1.2
23-
github.com/lightninglabs/taproot-assets v0.4.0-alpha.rc3
24-
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240709210732-0cd11ad84792
23+
github.com/lightninglabs/taproot-assets v0.4.0-rc4
24+
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240712025014-90f997c908d0
2525
github.com/lightningnetwork/lnd/cert v1.2.2
2626
github.com/lightningnetwork/lnd/fn v1.1.0
2727
github.com/lightningnetwork/lnd/kvdb v1.4.8

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,12 +1175,12 @@ github.com/lightninglabs/pool/auctioneerrpc v1.1.2 h1:Dbg+9Z9jXnhimR27EN37foc4aB
11751175
github.com/lightninglabs/pool/auctioneerrpc v1.1.2/go.mod h1:1wKDzN2zEP8srOi0B9iySlEsPdoPhw6oo3Vbm1v4Mhw=
11761176
github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display h1:pRdza2wleRN1L2fJXd6ZoQ9ZegVFTAb2bOQfruJPKcY=
11771177
github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
1178-
github.com/lightninglabs/taproot-assets v0.4.0-alpha.rc3 h1:Ovt4wMhCIqdw+uNwJaSfM/fWpn06n51b4rlIadAnL2g=
1179-
github.com/lightninglabs/taproot-assets v0.4.0-alpha.rc3/go.mod h1:oAiEnRj2sCbPHAURot+tmKbyDhIoxnvkmag0JqlF1bs=
1178+
github.com/lightninglabs/taproot-assets v0.4.0-rc4 h1:tl8gClGZBmLlkMxfDRVAdIhx+LyhThZCEjYBpuM37pc=
1179+
github.com/lightninglabs/taproot-assets v0.4.0-rc4/go.mod h1:oAiEnRj2sCbPHAURot+tmKbyDhIoxnvkmag0JqlF1bs=
11801180
github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f h1:Pua7+5TcFEJXIIZ1I2YAUapmbcttmLj4TTi786bIi3s=
11811181
github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
1182-
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240709210732-0cd11ad84792 h1:bM4UmjVTvhqwDCMzLZIDMecfo/mei4OS/BFLUzHiDNc=
1183-
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240709210732-0cd11ad84792/go.mod h1:L3IArArdRrWtuw+wNsUlibuGmf/08Odsm/zo3+bPXuM=
1182+
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240712025014-90f997c908d0 h1:V+PoltFSxN5oijkErYe+QbnVz5WJjBsAzaMNRrhmz3Q=
1183+
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240712025014-90f997c908d0/go.mod h1:L3IArArdRrWtuw+wNsUlibuGmf/08Odsm/zo3+bPXuM=
11841184
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
11851185
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
11861186
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=

itest/assets_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ func createTestAssetNetwork(t *harnessTest, net *NetworkHarness, charlieTap,
154154
AssetId: assetID,
155155
PeerPubkey: fabiaTap.node.PubKey[:],
156156
FeeRateSatPerVbyte: 5,
157+
PushSat: 1065,
157158
},
158159
)
159160
require.NoError(t.t, err)
@@ -662,7 +663,7 @@ func createAndPayNormalInvoiceWithBtc(t *testing.T, src, dst *HarnessNode,
662663
}
663664

664665
func createAndPayNormalInvoice(t *testing.T, src, rfqPeer, dst *HarnessNode,
665-
amountSat btcutil.Amount, assetID []byte) uint64 {
666+
amountSat btcutil.Amount, assetID []byte, smallShards bool) uint64 {
666667

667668
ctxb := context.Background()
668669
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
@@ -676,7 +677,9 @@ func createAndPayNormalInvoice(t *testing.T, src, rfqPeer, dst *HarnessNode,
676677
})
677678
require.NoError(t, err)
678679

679-
return payInvoiceWithAssets(t, src, rfqPeer, invoiceResp, assetID)
680+
return payInvoiceWithAssets(
681+
t, src, rfqPeer, invoiceResp, assetID, smallShards,
682+
)
680683
}
681684

682685
func payInvoiceWithSatoshi(t *testing.T, payer *HarnessNode,
@@ -703,7 +706,8 @@ func payInvoiceWithSatoshi(t *testing.T, payer *HarnessNode,
703706
}
704707

705708
func payInvoiceWithAssets(t *testing.T, payer, rfqPeer *HarnessNode,
706-
invoice *lnrpc.AddInvoiceResponse, assetID []byte) uint64 {
709+
invoice *lnrpc.AddInvoiceResponse, assetID []byte,
710+
smallShards bool) uint64 {
707711

708712
ctxb := context.Background()
709713
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
@@ -782,9 +786,13 @@ func payInvoiceWithAssets(t *testing.T, payer, rfqPeer *HarnessNode,
782786
PaymentRequest: invoice.PaymentRequest,
783787
TimeoutSeconds: 2,
784788
FirstHopCustomRecords: encodeResp.CustomRecords,
785-
MaxShardSizeMsat: 80_000_000,
786789
FeeLimitMsat: 1_000_000,
787790
}
791+
792+
if smallShards {
793+
sendReq.MaxShardSizeMsat = 80_000_000
794+
}
795+
788796
stream, err := payer.RouterClient.SendPaymentV2(ctxt, sendReq)
789797
require.NoError(t, err)
790798

0 commit comments

Comments
 (0)