ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.84k stars 901 forks source link

Peer permanent failure in ONCHAIN: Funding transaction spent #4367

Closed 3nprob closed 3 years ago

3nprob commented 3 years ago

Issue and Steps to Reproduce

Fairly new node, with a couple of outgoing channels (all initiated from me), no incoming. It seems one channel is being closed by the other peer and c-lightning can't handle it. Does this mean I will lose my funds if I do't reolve this in a timely manner?

Logs from startup:

C-Lightning starting
INFO    connectd: Static Tor service onion address: "....." bound from extern port 1234
INFO    plugin-bcli: bitcoin-cli initialized and connected to bitcoind.
C-Lightning started
C-Lightning started, RPC available on port 4567
lightningd "$@"
INFO    plugin-watchtower.py: A key file for the watchtower client already exists. Loading it
INFO    plugin-watchtower.py: Plugin watchtower client initialized. User id = abc123
INFO    lightningd: Restarting onchaind for channel 18
UNUSUAL xxxxxxxxxx-chan#18: Peer permanent failure in ONCHAIN: Funding transaction spent
INFO    xxxxxxxxxx-chan#18: State changed from ONCHAIN to FUNDING_SPEND_SEEN
INFO    lightningd: --------------------------------------------------
INFO    lightningd: Server started with public key yyyy, alias ALIAS (color #000000) and lightningd v0.9.3
INFO    xxxxxxxxxx-chan#18: State changed from FUNDING_SPEND_SEEN to ONCHAIN
INFO    plugin-offers: Killing plugin: offers not enabled in config
INFO    plugin-fetchinvoice: Killing plugin: offers not enabled in config
INFO    plugin-summary.py: Plugin summary.py initialized
UNUSUAL plugin-summary.py: [PriceThread] Expecting value: line 1 column 1 (char 0)

getinfo output

{
   "num_peers": 5,
   "num_pending_channels": 0,
   "num_active_channels": 4,
   "num_inactive_channels": 1,
   "version": "v0.9.3",
   "blockheight": 668777,
   "network": "bitcoin",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
   "lightning-dir": "/var/lib/clightning/data/bitcoin"
}

Also, I get the following over and over in stderr (not sure if related, I'm guessing it's from a plugin):

column number 12 is out of range 0..11
column number 12 is out of range 0..11
3nprob commented 3 years ago

Here's the peer info from listpeers

{
  "id": "id_other",
  "connected": false,
  "channels": [
    {
      "state": "ONCHAIN",
      "scratch_txid": "scratch_txid",
      "owner": "onchaind",
      "short_channel_id": "short_id",
      "direction": 1,
      "channel_id": "channel_id",
      "funding_txid": "funding_txid",
      "close_to_addr": "funding_to_txaddr",
      "close_to": "close_to",
      "private": false,
      "opener": "local",
      "closer": "remote",
      "features": [
        "option_static_remotekey"
      ],
      "funding_allocation_msat": {
        "id_other": 0,
        "id_me": 200000000
      },
      "funding_msat": {
        "id_other": "0msat",
        "id_me": "200000000msat"
      },
      "msatoshi_to_us": 200000000,
      "to_us_msat": "200000000msat",
      "msatoshi_to_us_min": 200000000,
      "min_to_us_msat": "200000000msat",
      "msatoshi_to_us_max": 200000000,
      "max_to_us_msat": "200000000msat",
      "msatoshi_total": 200000000,
      "total_msat": "200000000msat",
      "fee_base_msat": "1200msat",
      "fee_proportional_millionths": 15,
      "dust_limit_satoshis": 546,
      "dust_limit_msat": "546000msat",
      "max_htlc_value_in_flight_msat": 1XXXXXXXXXXXXXXXXXXX,
      "max_total_htlc_in_msat": "1xxxxxxxxxxxxxxxxxxxmsat",
      "their_channel_reserve_satoshis": 2000,
      "their_reserve_msat": "2000000msat",
      "our_channel_reserve_satoshis": 2000,
      "our_reserve_msat": "2000000msat",
      "spendable_msatoshi": 1XXXXXXXX,
      "spendable_msat": "1xxxxxxxxmsat",
      "receivable_msatoshi": 0,
      "receivable_msat": "0msat",
      "htlc_minimum_msat": 0,
      "minimum_htlc_in_msat": "0msat",
      "their_to_self_delay": 144,
      "our_to_self_delay": 144,
      "max_accepted_htlcs": 30,
      "state_changes": [
        {
          "timestamp": "2021-02-01T11:4x:xx.xxxZ",
          "old_state": "CHANNELD_AWAITING_LOCKIN",
          "new_state": "CHANNELD_NORMAL",
          "cause": "user",
          "message": "Lockin complete"
        },
        {
          "timestamp": "2021-02-02T13:3x:xx.xxxZ",
          "old_state": "CHANNELD_NORMAL",
          "new_state": "CHANNELD_SHUTTING_DOWN",
          "cause": "remote",
          "message": "Peer closes channel"
        },
        {
          "timestamp": "2021-02-02T13:3x:xx.xxxZ",
          "old_state": "CHANNELD_SHUTTING_DOWN",
          "new_state": "CLOSINGD_SIGEXCHANGE",
          "cause": "remote",
          "message": "Start closingd"
        },
        {
          "timestamp": "2021-02-02T13:3x:xx.xxxZ",
          "old_state": "CLOSINGD_SIGEXCHANGE",
          "old_state": "CLOSINGD_SIGEXCHANGE",
          "new_state": "CLOSINGD_COMPLETE",
          "cause": "remote",
          "message": "Closing complete"
        },
        {
          "timestamp": "2021-02-02T13:3x:xx.xxxZ",
          "old_state": "CLOSINGD_COMPLETE",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T13:3x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        },
        {
          "timestamp": "2021-02-02T15:0x:xx.xxxZ",
          "old_state": "ONCHAIN",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T15:0x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        },
        {
          "timestamp": "2021-02-02T15:2x:xx.xxxZ",
          "old_state": "ONCHAIN",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T15:2x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        },
        {
          "timestamp": "2021-02-02T16:0x:xx.xxxZ",
          "old_state": "ONCHAIN",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T16:0x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        },
        {
          "timestamp": "2021-02-02T16:2x:xx.xxxZ",
          "old_state": "ONCHAIN",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T16:2x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        },
        {
          "timestamp": "2021-02-02T16:4x:xx.xxxZ",
          "old_state": "ONCHAIN",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T16:4x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        },
        {
          "timestamp": "2021-02-02T17:1x:xx.xxxZ",
          "old_state": "ONCHAIN",
          "new_state": "FUNDING_SPEND_SEEN",
          "cause": "remote",
          "message": "Onchain funding spend"
        },
        {
          "timestamp": "2021-02-02T17:1x:xx.xxxZ",
          "old_state": "FUNDING_SPEND_SEEN",
          "new_state": "ONCHAIN",
          "cause": "remote",
          "message": "Onchain init reply"
        }
      ],
      "status": [
        "ONCHAIN:Tracking mutual close transaction",
        "ONCHAIN:All outputs resolved: waiting 73 more blocks before forgetting channel"
      ],
      "in_payments_offered": 0,
      "in_msatoshi_offered": 0,
      "in_offered_msat": "0msat",
      "in_payments_fulfilled": 0,
      "in_msatoshi_fulfilled": 0,
      "in_fulfilled_msat": "0msat",
      "out_payments_offered": 0,
      "out_msatoshi_offered": 0,
      "out_offered_msat": "0msat",
      "out_payments_fulfilled": 0,
      "out_msatoshi_fulfilled": 0,
      "out_fulfilled_msat": "0msat",
      "htlcs": []
    }
  ]
}
cdecker commented 3 years ago

I can't see anything out of the ordinary. The log entries marked as unusual just mean that they are of a higher priority than info. So nothing to be worried about. As the logs mention you'll get your funds back in 73 blocks.