Skip to content

[bug]: custom_channel_data is not present for closed channels #1419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jamaljsr opened this issue Mar 4, 2025 · 1 comment
Closed

[bug]: custom_channel_data is not present for closed channels #1419

jamaljsr opened this issue Mar 4, 2025 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@jamaljsr
Copy link
Member

jamaljsr commented Mar 4, 2025

Background

In Terminal we display closed channels for the connected node. While adding support for Taproot Assets, I discovered that the lnd PendingChannels and ClosedChannels RPCs does not include the custom_channel_data for closed asset channels, which is present for open channels. The result is that it is not possible to determine what asset was in the channel prior to closing it. We are not able to display the asset information in the list of closed channels in terminal.

Your environment

tapcli getinfo                       # version of `tapd`, `lnd`, and network
{
    "version":  "0.5.1-alpha commit=v0.5.1",
    "lnd_version":  "0.18.5-beta",
    "network":  "regtest",
    "lnd_identity_pubkey":  "032657ff49b02e43e74b0132f389d0e635c2f9e4128065e51b75ceda7b635a65ec",
    "node_alias":  "zane",
    "block_height":  332,
    "block_hash":  "5227419e45e34c8090538c7f83fd6fe71d7527c01665898c129b168cdc370b90",
    "sync_to_chain":  true
}
  • any other relevant environment details

Steps to reproduce

  1. Open an asset channel

  2. Run lncli pendingchannels and confirm the asset info is in the custom_channel_data field

    Command output

    {
        "total_limbo_balance": "0",
        "pending_open_channels": [
            {
                "channel": {
                    "remote_node_pub": "0273f5f857d3125654b83cd69fd0c1c81165b2a63dafa7f020a67f65abfb773c35",
                    "channel_point": "59cc4ca823181b73620d22bfa00e29063e362950feb53ab326a0802c9885b3bf:0",
                    "capacity": "100000",
                    "local_balance": "96920",
                    "remote_balance": "0",
                    "local_chan_reserve_sat": "1000",
                    "remote_chan_reserve_sat": "1062",
                    "initiator": "INITIATOR_LOCAL",
                    "commitment_type": "SIMPLE_TAPROOT_OVERLAY",
                    "num_forwarding_packages": "0",
                    "chan_status_flags": "",
                    "private": true,
                    "memo": "",
                    "custom_channel_data": {
                        "assets": [
                            {
                                "asset_utxo": {
                                    "version": 1,
                                    "asset_genesis": {
                                        "genesis_point": "6e74c013d599432499e2eca8615570fd1bdf75eaaf1cadb43c946ea0cc030284:1",
                                        "name": "LUSD",
                                        "meta_hash": "f393f6fea5bef1774b02ab54af6cb050b1cc04d84765363c0929b4b00c424be4",
                                        "asset_id": "704da5c3e5bc55ed3a67b9b9ce3b21e69d3c4a31631207fb83aea8090cb2cc24"
                                    },
                                    "amount": 60000,
                                    "script_key": "0250aaeb166f4234650d84a2d8a130987aeaf6950206e0905401ee74ff3f8d18e6",
                                    "decimal_display": 2
                                },
                                "capacity": 60000,
                                "local_balance": 60000,
                                "remote_balance": 0
                            }
                        ]
                    }
                },
                "commit_fee": "2420",
                "commit_weight": "614",
                "fee_per_kw": "2500",
                "funding_expiry_blocks": 2016
            }
        ],
        "pending_closing_channels": [],
        "pending_force_closing_channels": [],
        "waiting_close_channels": []
    }

  3. Mine blocks to confirm the channel funding

  4. Run lncli listchannels and confirm the asset info is in the custom_channel_data field

    Command output

        {
            "channels": [
                {
                    "active": true,
                    "remote_pubkey": "0273f5f857d3125654b83cd69fd0c1c81165b2a63dafa7f020a67f65abfb773c35",
                    "channel_point": "59cc4ca823181b73620d22bfa00e29063e362950feb53ab326a0802c9885b3bf:0",
                    "chan_id": "352943232581632",
                    "capacity": "100000",
                    "local_balance": "96920",
                    "remote_balance": "0",
                    "commit_fee": "2750",
                    "commit_weight": "614",
                    "fee_per_kw": "2500",
                    "unsettled_balance": "0",
                    "total_satoshis_sent": "0",
                    "total_satoshis_received": "0",
                    "num_updates": "0",
                    "pending_htlcs": [],
                    "csv_delay": 144,
                    "private": true,
                    "initiator": true,
                    "chan_status_flags": "ChanStatusDefault",
                    "local_chan_reserve_sat": "1000",
                    "remote_chan_reserve_sat": "1062",
                    "static_remote_key": false,
                    "commitment_type": "SIMPLE_TAPROOT_OVERLAY",
                    "lifetime": "7",
                    "uptime": "7",
                    "close_address": "",
                    "push_amount_sat": "0",
                    "thaw_height": 0,
                    "local_constraints": {
                        "csv_delay": 144,
                        "chan_reserve_sat": "1000",
                        "dust_limit_sat": "354",
                        "max_pending_amt_msat": "99000000",
                        "min_htlc_msat": "1",
                        "max_accepted_htlcs": 83
                    },
                    "remote_constraints": {
                        "csv_delay": 144,
                        "chan_reserve_sat": "1062",
                        "dust_limit_sat": "354",
                        "max_pending_amt_msat": "99000000",
                        "min_htlc_msat": "1",
                        "max_accepted_htlcs": 83
                    },
                    "alias_scids": [
                        "17592186044416000002"
                    ],
                    "zero_conf": false,
                    "zero_conf_confirmed_scid": "0",
                    "peer_alias": "alice",
                    "peer_scid_alias": "17592186044416000002",
                    "memo": "",
                    "custom_channel_data": {
                        "assets": [
                            {
                                "asset_utxo": {
                                    "version": 1,
                                    "asset_genesis": {
                                        "genesis_point": "6e74c013d599432499e2eca8615570fd1bdf75eaaf1cadb43c946ea0cc030284:1",
                                        "name": "LUSD",
                                        "meta_hash": "f393f6fea5bef1774b02ab54af6cb050b1cc04d84765363c0929b4b00c424be4",
                                        "asset_id": "704da5c3e5bc55ed3a67b9b9ce3b21e69d3c4a31631207fb83aea8090cb2cc24"
                                    },
                                    "amount": 60000,
                                    "script_key": "0250aaeb166f4234650d84a2d8a130987aeaf6950206e0905401ee74ff3f8d18e6",
                                    "decimal_display": 2
                                },
                                "capacity": 60000,
                                "local_balance": 60000,
                                "remote_balance": 0
                            }
                        ]
                    }
                }
            ]
        }

  5. Close the channel

  6. Run lncli pendingchannels and confirm the custom_channel_data field is not present

    Command output

    {
        "total_limbo_balance":  "96920",
        "pending_open_channels":  [],
        "pending_closing_channels":  [],
        "pending_force_closing_channels":  [],
        "waiting_close_channels":  [
            {
                "channel":  {
                    "remote_node_pub":  "0273f5f857d3125654b83cd69fd0c1c81165b2a63dafa7f020a67f65abfb773c35",
                    "channel_point":  "59cc4ca823181b73620d22bfa00e29063e362950feb53ab326a0802c9885b3bf:0",
                    "capacity":  "100000",
                    "local_balance":  "96920",
                    "remote_balance":  "0",
                    "local_chan_reserve_sat":  "1000",
                    "remote_chan_reserve_sat":  "1062",
                    "initiator":  "INITIATOR_LOCAL",
                    "commitment_type":  "SIMPLE_TAPROOT_OVERLAY",
                    "num_forwarding_packages":  "0",
                    "chan_status_flags":  "ChanStatusCoopBroadcasted|ChanStatusLocalCloseInitiator",
                    "private":  true,
                    "memo":  "",
                    "custom_channel_data":  ""
                },
                "limbo_balance":  "96920",
                "commitments":  {
                    "local_txid":  "989a807dc777c50046f810aec3c7aae35b8de84e107e8919905cbeb3ce6460f4",
                    "remote_txid":  "890e687ca50b31d762caffb10e69c133c977d4c280ca552ff35126eca494ed53",
                    "remote_pending_txid":  "",
                    "local_commit_fee_sat":  "2420",
                    "remote_commit_fee_sat":  "2420",
                    "remote_pending_commit_fee_sat":  "0"
                },
                "closing_txid":  "14519879b08ed4f4dbf441925311a14a9aac5d76060b80dc5cbb4c1112eab710",
                "closing_tx_hex":  ""
            }
        ]
    }

  7. Mine blocks to confirm the channel closing

  8. Run lncli closedchannels and confirm the custom_channel_data field is not present

    Command output

    {
        "channels":  [
            {
                "channel_point":  "59cc4ca823181b73620d22bfa00e29063e362950feb53ab326a0802c9885b3bf:0",
                "chan_id":  "352943232581632",
                "chain_hash":  "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
                "closing_tx_hash":  "14519879b08ed4f4dbf441925311a14a9aac5d76060b80dc5cbb4c1112eab710",
                "remote_pubkey":  "0273f5f857d3125654b83cd69fd0c1c81165b2a63dafa7f020a67f65abfb773c35",
                "capacity":  "100000",
                "close_height":  327,
                "settled_balance":  "91500",
                "time_locked_balance":  "0",
                "close_type":  "COOPERATIVE_CLOSE",
                "open_initiator":  "INITIATOR_LOCAL",
                "close_initiator":  "INITIATOR_LOCAL",
                "resolutions":  [],
                "alias_scids":  [
                    "17592186044416000002"
                ],
                "zero_conf_confirmed_scid":  "0"
            }
        ]
    }

Expected behavior

The custom_channel_data field should be present in the pendingchannels and closedchannels RPC responses for closed asset channels.

Actual behavior

The custom_channel_data field is not present in the pendingchannels and closedchannels RPC responses for closed asset channels.

@guggero
Copy link
Member

guggero commented Apr 3, 2025

Fixed by #1441.

@guggero guggero closed this as completed Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants