-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Background
I am testing single hop Taproot Assets LN payments in Polar. I have three litd v0.14.0-alpha.rc1 nodes (each backed by their own bitcoind v27.0 node) Alice, Bob, and Carol. Alice has minted 21M units of a Taproot Asset called USDTest with a decimal_display of 6, and opened a 1M asset channel to Bob (so Alice has 1M assets outbound liquidity). Bob has then opened a 1M sats channel to Carol, and is using the default edge node config --taproot-assets.experimental.rfq.mockoracleassetsperbtc=1000000. I am testing Alice trying to pay sats invoices generated by Carol, whether paying in Taproot Assets or in sats.
Your environment
Alice's litd config:
litd
--httpslisten=0.0.0.0:8443
--uipassword={{litdPass}}
--network=regtest
--lnd-mode=integrated
--pool-mode=disable
--loop-mode=disable
--autopilot.disable
--lnd.noseedbackup
--lnd.debuglevel=debug
--lnd.alias={{name}}
--lnd.externalip={{name}}
--lnd.tlsextradomain={{name}}
--lnd.tlsextradomain={{containerName}}
--lnd.tlsextradomain=host.docker.internal
--lnd.listen=0.0.0.0:9735
--lnd.rpclisten=0.0.0.0:10009
--lnd.restlisten=0.0.0.0:8080
--lnd.bitcoin.active
--lnd.bitcoin.regtest
--lnd.bitcoin.node=bitcoind
--lnd.bitcoind.rpchost={{backendName}}
--lnd.bitcoind.rpcuser={{rpcUser}}
--lnd.bitcoind.rpcpass={{rpcPass}}
--lnd.bitcoind.zmqpubrawblock=tcp://{{backendName}}:28334
--lnd.bitcoind.zmqpubrawtx=tcp://{{backendName}}:28335
--taproot-assets.allow-public-uni-proof-courier
--taproot-assets.universe.public-access=rw
--taproot-assets.universe.sync-all-assets
--taproot-assets.allow-public-stats
--taproot-assets.universerpccourier.skipinitdelay
--taproot-assets.universerpccourier.backoffresetwait=1s
--taproot-assets.universerpccourier.numtries=5
--taproot-assets.universerpccourier.initialbackoff=300ms
--taproot-assets.universerpccourier.maxbackoff=600ms
--taproot-assets.experimental.rfq.priceoracleaddress=use_mock_price_oracle_service_promise_to_not_use_on_mainnet
--taproot-assets.experimental.rfq.mockoracleassetsperbtc=1000000
--lnd.trickledelay=50
--lnd.gossip.sub-batch-delay=5ms
--lnd.caches.rpc-graph-cache-duration=100ms
--lnd.default-remote-max-htlcs=483
--lnd.dust-threshold=5000000
--lnd.protocol.option-scid-alias
--lnd.protocol.zero-conf
--lnd.protocol.simple-taproot-chans
--lnd.protocol.simple-taproot-overlay-chans
--lnd.protocol.wumbo-channels
--lnd.accept-keysend
--lnd.protocol.custom-message=17
Alice's tapcli getinfo output:
litd@alice:/$ tapcli getinfo
{
"version": "0.5.0-alpha.rc1 commit=v0.5.0-rc1",
"lnd_version": "0.18.4-beta.rc1",
"network": "regtest",
"lnd_identity_pubkey": "0352d1f85ffbf9b2161096c7019930054ad566992ce7fa2df8e75161fb5832ce3f",
"node_alias": "alice",
"block_height": 137,
"block_hash": "2b7394bd8f358545a4b5fa4de4f1b0633ca23635443eeb2ca4ff81dcd1d47fc3",
"sync_to_chain": true
}
Bob's litd config:
litd
--httpslisten=0.0.0.0:8443
--uipassword={{litdPass}}
--network=regtest
--lnd-mode=integrated
--pool-mode=disable
--loop-mode=disable
--autopilot.disable
--lnd.noseedbackup
--lnd.debuglevel=debug
--lnd.alias={{name}}
--lnd.externalip={{name}}
--lnd.tlsextradomain={{name}}
--lnd.tlsextradomain={{containerName}}
--lnd.tlsextradomain=host.docker.internal
--lnd.listen=0.0.0.0:9735
--lnd.rpclisten=0.0.0.0:10009
--lnd.restlisten=0.0.0.0:8080
--lnd.bitcoin.active
--lnd.bitcoin.regtest
--lnd.bitcoin.node=bitcoind
--lnd.bitcoind.rpchost={{backendName}}
--lnd.bitcoind.rpcuser={{rpcUser}}
--lnd.bitcoind.rpcpass={{rpcPass}}
--lnd.bitcoind.zmqpubrawblock=tcp://{{backendName}}:28334
--lnd.bitcoind.zmqpubrawtx=tcp://{{backendName}}:28335
--taproot-assets.allow-public-uni-proof-courier
--taproot-assets.universe.public-access=rw
--taproot-assets.universe.sync-all-assets
--taproot-assets.allow-public-stats
--taproot-assets.universerpccourier.skipinitdelay
--taproot-assets.universerpccourier.backoffresetwait=1s
--taproot-assets.universerpccourier.numtries=5
--taproot-assets.universerpccourier.initialbackoff=300ms
--taproot-assets.universerpccourier.maxbackoff=600ms
--taproot-assets.experimental.rfq.priceoracleaddress=use_mock_price_oracle_service_promise_to_not_use_on_mainnet
--taproot-assets.experimental.rfq.mockoracleassetsperbtc=1000000
--lnd.trickledelay=50
--lnd.gossip.sub-batch-delay=5ms
--lnd.caches.rpc-graph-cache-duration=100ms
--lnd.default-remote-max-htlcs=483
--lnd.dust-threshold=5000000
--lnd.protocol.option-scid-alias
--lnd.protocol.zero-conf
--lnd.protocol.simple-taproot-chans
--lnd.protocol.simple-taproot-overlay-chans
--lnd.protocol.wumbo-channels
--lnd.accept-keysend
--lnd.protocol.custom-message=17
Bob's tapcli getinfo output:
litd@bob:/$ tapcli getinfo
{
"version": "0.5.0-alpha.rc1 commit=v0.5.0-rc1",
"lnd_version": "0.18.4-beta.rc1",
"network": "regtest",
"lnd_identity_pubkey": "0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef",
"node_alias": "bob",
"block_height": 137,
"block_hash": "2b7394bd8f358545a4b5fa4de4f1b0633ca23635443eeb2ca4ff81dcd1d47fc3",
"sync_to_chain": true
}
Steps to reproduce
- Create the single hop Taproot Assets LN to BTC network architecture described above
- Have Carol generate a 10 sats invoice (lnbcrt100n1pn5muhppp5tvmng5q2qmcnym882gr9dnkfwpgvjs2rkueywjjztjjd0cavgzcqdqqcqzzsxqyz5vqsp5xj837yyv53xzpf6mgqhlnsdj2hpazs88evmy6cs486cllsmd4k8s9qxpqysgqmajxgkxph2ny8gzfy5l80w256he50k2s6zsupyj320nh9ts2ul3y7ask3yeqsjnxhlqtx25kdc2z5a22d5g557mv5xf4cksw0nktemspml9vup)
- Attempt to pay that invoice with the command
litcli ln payinvoice --pay_req lnbcrt100n1pn5muhppp5tvmng5q2qmcnym882gr9dnkfwpgvjs2rkueywjjztjjd0cavgzcqdqqcqzzsxqyz5vqsp5xj837yyv53xzpf6mgqhlnsdj2hpazs88evmy6cs486cllsmd4k8s9qxpqysgqmajxgkxph2ny8gzfy5l80w256he50k2s6zsupyj320nh9ts2ul3y7ask3yeqsjnxhlqtx25kdc2z5a22d5g557mv5xf4cksw0nktemspml9vup --asset_id 3da18be97ca3b399129be4242061bcde054082be0c1a36b8d2b7750a4a461919 --rfq_peer_pubkey 0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef
Expected behavior
Given that this request is asking Alice to send 0.1 assets across her Taproot Assets channel, the litcli ln payinvoice command should fail gracefully with feedback that the amount is too small instead of panicking.
Actual behavior
Alice receives the following CLI output:
Payment hash: 5b3734500a06f1326ce7520656cec97050c94143b732474a425ca4d7e3ac40b0
Description:
Amount (in satoshis): 10
Fee limit (in satoshis): 10
Destination: 03b8e965b29f04dc579497755bf6b8fa207a6c783f3092220f36fdbcc3e4fc0c5e
Confirm payment (yes/no): yes
panic: runtime error: integer divide by zero
goroutine 1 [running]:
main.(*resultStreamWrapper).Recv(0xc000a10c00)
github.com/lightninglabs/lightning-terminal/cmd/litcli/ln.go:219 +0x2ee
github.com/lightningnetwork/lnd/cmd/commands.PrintLivePayment({0x2167680, 0xc000a0e000}, {0x214aec0, 0xc000a10c00}, {0x2197660, 0xc000a02020}, 0x0)
github.com/lightningnetwork/[email protected]/cmd/commands/cmd_payments.go:711 +0xa9
github.com/lightningnetwork/lnd/cmd/commands.SendPaymentRequest(0xc0004454a0, 0xc0006982c0, {0x215c1d0, 0xc000234c08}, {0x215c1d0, 0xc000234c08}, 0xc000472468)
github.com/lightningnetwork/[email protected]/cmd/commands/cmd_payments.go:626 +0x999
main.payInvoice(0xc0004454a0)
github.com/lightninglabs/lightning-terminal/cmd/litcli/ln.go:461 +0x565
github.com/urfave/cli.HandleAction({0x19abc80?, 0x1f4a968?}, 0xa?)
github.com/urfave/[email protected]/app.go:524 +0x50
github.com/urfave/cli.Command.Run({{0x1ddc664, 0xa}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x1e288f6, 0x2d}, {0x0, ...}, ...}, ...)
github.com/urfave/[email protected]/command.go:173 +0x685
github.com/urfave/cli.(*App).RunAsSubcommand(0xc00047d880, 0xc0004451e0)
github.com/urfave/[email protected]/app.go:405 +0xddb
github.com/urfave/cli.Command.startApp({{0x1dd371c, 0x2}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x1e13349, 0x24}, {0x0, ...}, ...}, ...)
github.com/urfave/[email protected]/command.go:378 +0xb1e
github.com/urfave/cli.Command.Run({{0x1dd371c, 0x2}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x1e13349, 0x24}, {0x0, ...}, ...}, ...)
github.com/urfave/[email protected]/command.go:102 +0x7c5
github.com/urfave/cli.(*App).Run(0xc00047d6c0, {0xc0000500b0, 0xb, 0xb})
github.com/urfave/[email protected]/app.go:277 +0xb1b
main.main()
github.com/lightninglabs/lightning-terminal/cmd/litcli/main.go:103 +0xbb6
Alice's logs show the following:
2024-12-02 17:50:51.697 [DBG] RPCS: [/tapchannelrpc.TaprootAssetChannels/SendPayment] requested
2024-12-02 17:50:51.698 [DBG] RPCS: [/lnrpc.Lightning/CheckMacaroonPermissions] requested
2024-12-02 17:50:51.729 [DBG] RPCS: [/lnrpc.Lightning/ListChannels] requested
2024-12-02 17:50:51.732 [DBG] RPCS: [listchannels] fetched 1 channels from DB
2024-12-02 17:50:51.737 [DBG] RPCS: [/lnrpc.Lightning/ListChannels] requested
2024-12-02 17:50:51.741 [DBG] RPCS: [listchannels] fetched 1 channels from DB
2024-12-02 17:50:51.752 [DBG] RFQS: Manager handling outgoing message: SellRequest(peer=0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef, id=329cc42b88e0a30b874c8b4a8864436a17ecabdbdc846468f4e38c67beaa6043, asset=AssetSpecifier(id=3da18be97ca3b399129be4242061bcde054082be0c1a36b8d2b7750a4a461919, group_pub_key=), payment_max_amt=20000, asset_rate_hint=AssetRate(rate=1000000, expiry=2024-12-02T18:50:51Z))
2024-12-02 17:50:51.756 [DBG] RFQS: Stream handling outgoing message: SellRequest(peer=0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef, id=329cc42b88e0a30b874c8b4a8864436a17ecabdbdc846468f4e38c67beaa6043, asset=AssetSpecifier(id=3da18be97ca3b399129be4242061bcde054082be0c1a36b8d2b7750a4a461919, group_pub_key=), payment_max_amt=20000, asset_rate_hint=AssetRate(rate=1000000, expiry=2024-12-02T18:50:51Z))
2024-12-02 17:50:51.761 [DBG] RPCS: [/lnrpc.Lightning/SendCustomMessage] requested
2024-12-02 17:50:51.763 [DBG] PEER: Peer(0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef): Sending custom(type=52884) to 0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef@172.18.0.7:9735
2024-12-02 17:50:51.782 [DBG] PEER: Peer(0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef): Received custom(type=52885) from 0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef@172.18.0.7:9735
2024-12-02 17:50:51.783 [DBG] TCHN: Failed to handle: *lnwire.Custom
2024-12-02 17:50:51.784 [DBG] SRVR: Custom message received: peer=0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef, type=52885
2024-12-02 17:50:51.788 [DBG] RFQS: Stream handling incoming message: SellAccept(peer=0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef, id=329cc42b88e0a30b874c8b4a8864436a17ecabdbdc846468f4e38c67beaa6043, asset_rate=AssetRate(rate=1000000, expiry=2024-12-02T18:50:51Z), scid=17646102142176092227)
2024-12-02 17:50:51.789 [DBG] RFQS: Manager handling incoming message: SellAccept(peer=0370175e690645b4c47f462aa1f94aa08d79af1460c3e8f548b803b34b9c5603ef, id=329cc42b88e0a30b874c8b4a8864436a17ecabdbdc846468f4e38c67beaa6043, asset_rate=AssetRate(rate=1000000, expiry=2024-12-02T18:50:51Z), scid=17646102142176092227)
2024-12-02 17:50:51.799 [INF] RPCS: Got quote for 0 asset units at 1000000 asset/BTC from peer 303337303137356536393036343562346334376634363261613166393461613038643739616631343630633365386635343862383033623334623963353630336566 with SCID 17646102142176092227
2024-12-02 17:50:51.804 [DBG] RPCS: [/routerrpc.Router/SendPaymentV2] requested
2024-12-02 17:50:51.809 [ERR] RPCS: [/tapchannelrpc.TaprootAssetChannels/SendPayment]: rpc error: code = Canceled desc = context canceled
2024-12-02 17:50:51.852 [INF] RRPC: Payment stream 5b3734500a06f1326ce7520656cec97050c94143b732474a425ca4d7e3ac40b0 canceled
2024-12-02 17:50:51.862 [DBG] CRTR: Payment 5b3734500a06f1326ce7520656cec97050c94143b732474a425ca4d7e3ac40b0: status=Initiated, active_shards=0, rem_value=10000 mSAT, fee_limit=10000 mSAT
2024-12-02 17:50:51.876 [DBG] CRTR: PaymentSession(5b3734500a06f1326ce7520656cec97050c94143b732474a425ca4d7e3ac40b0): pathfinding for amt=10000 mSAT
2024-12-02 17:50:51.883 [DBG] TSVR: HandleTraffic called, cid=132:1:0, fundingBlob=(fn.Option[[]uint8]) {
...
}
}
2024-12-02 17:50:51.956 [DBG] CRTR: ShortChannelID=132:1:0: external traffic shaper is handling traffic: true
2024-12-02 17:50:51.965 [DBG] TSVR: PaymentBandwidth called, htlcBlob=(fn.Option[[]uint8]) {
...
}
}
2024-12-02 17:50:51.996 [DBG] CRTR: ShortChannelID=132:1:0: external traffic shaper reported available bandwidth: 100000000000000000 mSAT
2024-12-02 17:50:52.013 [DBG] CRTR: Pathfinding absolute attempt cost: 100.01 sats
2024-12-02 17:50:52.015 [DBG] TSVR: HandleTraffic called, cid=132:1:0, fundingBlob=(fn.Option[[]uint8]) {
...
}
}
2024-12-02 17:50:52.074 [DBG] CRTR: ShortChannelID=132:1:0: external traffic shaper is handling traffic: true
2024-12-02 17:50:52.081 [DBG] TSVR: PaymentBandwidth called, htlcBlob=(fn.Option[[]uint8]) {
...
}
}
2024-12-02 17:50:52.110 [DBG] CRTR: ShortChannelID=132:1:0: external traffic shaper reported available bandwidth: 100000000000000000 mSAT
2024-12-02 17:50:52.126 [DBG] CRTR: Found route: probability=0.57, hops=2, fee=1000 mSAT
2024-12-02 17:50:52.128 [DBG] CRTR: Pathfinding perf metrics: nodes=2, edges=2, time=252.69575ms
2024-12-02 17:50:52.134 [DBG] TSVR: ProduceHtlcExtraData called, totalAmount=11000, htlcBlob=(lnwire.CustomRecords) (len=2) {
(uint64) 65536: ([]uint8) (len=1 cap=1) {
00000000 00 |.|
},
(uint64) 65538: ([]uint8) (len=32 cap=32) {
00000000 32 9c c4 2b 88 e0 a3 0b 87 4c 8b 4a 88 64 43 6a |2..+.....L.J.dCj|
00000010 17 ec ab db dc 84 64 68 f4 e3 8c 67 be aa 60 43 |......dh...g..`C|
}
}
2024-12-02 17:50:52.135 [ERR] CRTR: Payment 5b3734500a06f1326ce7520656cec97050c94143b732474a425ca4d7e3ac40b0 with status=Initiated failed: traffic shaper failed to produce extra data: asset unit price ({1000000 2024-12-02 18:50:51 +0000 UTC} asset per BTC) too high to represent HTLC value of 11000 mSAT
2024-12-02 17:50:52.141 [ERR] CRTR: Payment 5b3734500a06f1326ce7520656cec97050c94143b732474a425ca4d7e3ac40b0 failed: traffic shaper failed to produce extra data: asset unit price ({1000000 2024-12-02 18:50:51 +0000 UTC} asset per BTC) too high to represent HTLC value of 11000 mSAT
Metadata
Metadata
Assignees
Labels
Type
Projects
Status