Skip to content

[custom channels]: fix bandwidth reported by TLV traffic shaper #1060

@MegalithicBTC

Description

@MegalithicBTC

Here is the situation.

A node opened an asset channel to my node, and used the keysend command to send my node assets.

Following the keysend, the channel looked like this:

user@aw60:/src$ lncli listchannels
{
    "channels": [
        {
            "active": true,
            "remote_pubkey": "022d71f557bdc06b37db1f2c8761e32c7345169719c49bb0f534bf9dc15fee141a",
            "channel_point": "c0e214e3dab15cde21d615ac110656f65d823ec852dbe78b5e83ceab8669da85:0",
            "chan_id": "940555231906103296",
            "capacity": "100000",
            "local_balance": "500",
            "remote_balance": "97914",
            "commit_fee": "926",
            "commit_weight": "958",
            "fee_per_kw": "957",
            "unsettled_balance": "0",
            "total_satoshis_sent": "0",
            "total_satoshis_received": "500",
            "num_updates": "2",
            "pending_htlcs": [],
            "csv_delay": 144,
            "private": true,
            "initiator": false,
            "chan_status_flags": "ChanStatusDefault",
            "local_chan_reserve_sat": "1062",
            "remote_chan_reserve_sat": "1000",
            "static_remote_key": false,
            "commitment_type": "SIMPLE_TAPROOT",
            "lifetime": "1160",
            "uptime": "1160",
            "close_address": "",
            "push_amount_sat": "0",
            "thaw_height": 0,
            "local_constraints": {
                "csv_delay": 144,
                "chan_reserve_sat": "1062",
                "dust_limit_sat": "354",
                "max_pending_amt_msat": "99000000",
                "min_htlc_msat": "1",
                "max_accepted_htlcs": 483
            },
            "remote_constraints": {
                "csv_delay": 144,
                "chan_reserve_sat": "1000",
                "dust_limit_sat": "354",
                "max_pending_amt_msat": "99000000",
                "min_htlc_msat": "1",
                "max_accepted_htlcs": 483
            },
            "alias_scids": [
                "17592186044416000000"
            ],
            "zero_conf": false,
            "zero_conf_confirmed_scid": "0",
            "peer_alias": "stablechannels",
            "peer_scid_alias": "17592186044416000000",
            "memo": "",
            "custom_channel_data": {
                "assets": [
                    {
                        "asset_utxo": {
                            "version": 1,
                            "asset_genesis": {
                                "genesis_point": "005f5e93263ff730fa0f2909e50ca9e5b8452a2f3a38621ada3356ac7662e5cd:0",
                                "name": "Umint.cash.test",
                                "meta_hash": "524d433446e98bece52809e65578efc6c625e226ba5f2debd7ae05b0611691d1",
                                "asset_id": "2ca93a1373e8a2ab2de8934f46fd86dac37cb7eca30accda6e24778f67020e5e"
                            },
                            "amount": 5000,
                            "script_key": "0250aaeb166f4234650d84a2d8a130987aeaf6950206e0905401ee74ff3f8d18e6"
                        },
                        "capacity": 5000,
                        "local_balance": 50,
                        "remote_balance": 4950
                    }
                ]
            }
        },

You can see the asset balances:

"capacity": 5000,
 "local_balance": 50,
 "remote_balance": 4950

Next: I attempted to keysend some assets back to this node. I used the command:

user@aw60:/src$ ./litcli-assetfunctions-mainnet.sh ln sendpayment --keysend --asset_id 2ca93a1373e8a2ab2de8934f46fd86dac37cb7eca30accda6e24778f67020e5e --amt 1 --dest 022d71f557bdc06b37db1f2c8761e32c7345169719c49bb0f534bf9dc15fee141a
+------------+--------------+--------------+--------------+-----+----------+----------+-------+
| HTLC_STATE | ATTEMPT_TIME | RESOLVE_TIME | RECEIVER_AMT | FEE | TIMELOCK | CHAN_OUT | ROUTE |
+------------+--------------+--------------+--------------+-----+----------+----------+-------+
+------------+--------------+--------------+--------------+-----+----------+----------+-------+
Amount + fee:   0 + 0 sat
Payment hash:   d927ad81e15ac37dc979c4a5409544014ab8366b57ec2bae9bd99139de6cf83c
Payment status: FAILED, reason: FAILURE_REASON_INSUFFICIENT_BALANCE
[litcli] FAILED
user@aw60:/src$

The keysend failed with FAILURE_REASON_INSUFFICIENT_BALANCE.

Following this, my partner node sent me 1000 satoshis, via standard bolt 11 invoice.

Following this, my local sats balance in the channel increased from 500 to 1500 satoshis

user@aw60:/src$ lncli listchannels
{
    "channels": [
        {
            "active": true,
            "remote_pubkey": "022d71f557bdc06b37db1f2c8761e32c7345169719c49bb0f534bf9dc15fee141a",
            "channel_point": "c0e214e3dab15cde21d615ac110656f65d823ec852dbe78b5e83ceab8669da85:0",
            "chan_id": "940555231906103296",
            "capacity": "100000",
            "local_balance": "1500",
            "remote_balance": "96914",

Following this, I again attempted the same keysend operation. I got a different output, but it was still not successful.

user@aw60:/src$ ./litcli-assetfunctions-mainnet.sh ln sendpayment --keysend --asset_id 2ca93a1373e8a2ab2de8934f46fd86dac37cb7eca30accda6e24778f67020e5e --amt 1 --dest 022d71f557bdc06b37db1f2c8761e32c7345169719c49bb0f534bf9dc15fee141a
+-------------------------------------+--------------+--------------+--------------+-----+----------+--------------------+----------------+
| HTLC_STATE                          | ATTEMPT_TIME | RESOLVE_TIME | RECEIVER_AMT | FEE | TIMELOCK | CHAN_OUT           | ROUTE          |
+-------------------------------------+--------------+--------------+--------------+-----+----------+--------------------+----------------+
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.042 |        0.059 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.106 |        0.123 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.174 |        0.185 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.233 |        0.250 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.300 |        0.317 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.367 |        0.384 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| TEMPORARY_CHANNEL_FAILURE @ 0th hop |        0.434 |        0.451 | 500          | 0   |   855517 | 940555231906103296 | stablechannels |
| IN_FLIGHT                           |        0.497 |            - | 500          | 0   |   855517 | 940555231906103296 | stablechannels |

The console continued like this with thousands of 'TEMPORARY_CHANNEL_FAILURE @ 0th hop` outputs per second.

NOTE -- this is on Mainnet. Neither my node, nor my partner's node, has a price oracle set up.

Metadata

Metadata

Assignees

Labels

P0bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions