Skip to content

persist: crash upgrading from v11.0.x to main because chaintracker txid reversals (chaotic)

Summary

[UPDATE 2024-05-21] There is a problem updating VLS from v0.11.x to main. I believe everything works prior to the upgrade and fresh nodes seem to work after the upgrade, but upgraded nodes crash on startup with can't find funding outpoint 61227e00d39723ec5edab522b3a345be4b108a58c199e550024340bffb1b7bb1:1 (see #490 (comment 1915208509))

The first output is completely prior to the change, this is how vls v0.11.1 would look.

I've marked the reversed cases below with a trailing <= REVERSED

Some of the txid fields in the chaintracker persistence object are reversed.

There are two txid involved:

In the following persistence object the following are reversed byte order:

  • 8b9cb397966109c7c72c4debdba3bc45965be4870d753febebf4d20e73e51733
  • 73ca6b41dfb528e3d043b994f6eb692b8f96b1ade03b861e17da80d43b0d5ced
[
      {
        "txid": "8b9cb397966109c7c72c4debdba3bc45965be4870d753febebf4d20e73e51733",  <= REVERSED
        "vout": 2
      },
      [
        {
          "closing_outpoints": {
            "htlc_outputs": [
              2,
              3,
              4,
              5
            ],
            "htlc_spents": [
              true,
              true,
              true,
              false
            ],
            "our_output": null,
            "txid": "ed5c0d3bd480da171e863be0adb1968f2b69ebf694b943d0e328b5df416bca73"
          },
          "closing_swept_height": null,
          "funding_double_spent_height": null,
          "funding_height": 2586001,
          "funding_inputs": [],
          "funding_outpoint": "3317e5730ed2f4ebeb3f750d87e45b9645bca3dbeb4d2cc7c709619697b39c8b:2",
          "funding_txids": [
            "3317e5730ed2f4ebeb3f750d87e45b9645bca3dbeb4d2cc7c709619697b39c8b"
          ],
          "funding_vouts": [
            2
          ],
          "height": 2586501,
          "mutual_closing_height": null,
          "our_output_swept_height": 2586481,
          "saw_block": true,
          "saw_forget_channel": false,
          "unilateral_closing_height": 2586481
        },
        {
          "seen": [
            {
              "txid": "73ca6b41dfb528e3d043b994f6eb692b8f96b1ade03b861e17da80d43b0d5ced",  <= REVERSED
              "vout": 2
            },
            {
              "txid": "73ca6b41dfb528e3d043b994f6eb692b8f96b1ade03b861e17da80d43b0d5ced",  <= REVERSED
              "vout": 3
            },
            {
              "txid": "73ca6b41dfb528e3d043b994f6eb692b8f96b1ade03b861e17da80d43b0d5ced",  <= REVERSED
              "vout": 4
            },
            {
              "txid": "8b9cb397966109c7c72c4debdba3bc45965be4870d753febebf4d20e73e51733",  <= REVERSED
              "vout": 2
            }
          ],
          "txid_watches": [
            "8b9cb397966109c7c72c4debdba3bc45965be4870d753febebf4d20e73e51733"  <= REVERSED
          ],
          "watches": [
            {
              "txid": "73ca6b41dfb528e3d043b994f6eb692b8f96b1ade03b861e17da80d43b0d5ced",  <= REVERSED
              "vout": 5
            }
          ]
        }
      ]
    ],

This is at least confusing. We could:

  • reverse the order of these fields
  • change the field names to txhash
Edited by Ken Sedgwick