Skip to content
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

Anchor spends crash node #6973

Closed
michael1011 opened this issue Jan 3, 2024 · 12 comments
Closed

Anchor spends crash node #6973

michael1011 opened this issue Jan 3, 2024 · 12 comments
Assignees
Labels
crash in diagnostic issue under diagnostic
Milestone

Comments

@michael1011
Copy link
Contributor

Issue and Steps to Reproduce

When trying to create what I think is an anchor spend, CLN crashes:

Jan 03 01:48:54 boltz lightningd[1242922]: Non-final PSBT from hsm: cHNidP8BAgQCAAAAAQMEEpMMAAEEAQIBBQEBAQYBAwH7BAIAAAAAAQDsAgAAAAABAX6NSRoq75CEBUtPpDmqTI8SCRfsfLSoaVr+jJ44jOqpBQAAAACAAQAAAT0fLQAAAAAAFgAUAL99t/2RggcFcpe7xvdp2ABMd1oDRzBEAiArn0Y2rPuMH4oHw7Mzd2U217iqtOTUpgat+WnaRgxD5QIgCU9cmFrfY7bsyCxWz2ppP10T7rN6fjNdX68/2FWbgZgBAE1jIQLT8Hj+uTShpNmacHtqZdXONn88Elg7BtuAEPk/lTOCTWcCgA
GydSEDMlvrlA+aiJsJ6hd/4HAoi7YH+HIS1Kmy/zHY7sN5pFJorAAAAAABAR89Hy0AAAAAABYAFAC/fbf9kYIHBXKXu8b3adgATHdaAQ4gDsiqF5mVS7VD6YIjua4GizFBvve8VdbSxUWvJ87NescBDwQAAAAAARAE/f///wABAStKAQAAAAAAACIAIB7m2wGQPXi6AYymquncLlSzQBssHrvzZNLsU8UG7hK4AQhyAkcwRAIgCUv8sbQ44gsIUPMjEc9mLXq9QJmfbkyAvvtxRWY8+ywCIARf5Mi9KuRORsjWMuRSH4HZrKFJMwMk+WqnnjxsZDqRASghAvmOwoBbvi7mMabbeUfMXSSBUjou8OfZEXx6s5JFyI7crHNk
YLJoAQ4gqV2gf3wYrbyYgPjeujCYkCCQNC2ZbBfk6qIEYb5QtA8BDwQAAAAAARAE/f///wABAwhCrikAAAAAAAEEFgAUoB2KseLAJjNHR2sxZNm9K6AgbrgA
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.468Z **BROKEN** lightningd: Non-final PSBT from hsm: cHNidP8BAgQCAAAAAQMEEpMMAAEEAQIBBQEBAQYBAwH7BAIAAAAAAQDsAgAAAAABAX6NSRoq75CEBUtPpDmqTI8SCRfsfLSoaVr+jJ44jOqpBQAAAACAAQAAAT0fLQAAAAAAFgAUAL99t/2RggcFcpe7xvdp2ABMd1oDRzBEAiArn0Y2rPuMH4oHw7Mzd2U217iqtOTUpgat+WnaRgxD5QIgCU9cmFrfY7bsyCxWz2ppP10T7rN6fjNdX68/2FWbgZgBAE1jIQ
LT8Hj+uTShpNmacHtqZdXONn88Elg7BtuAEPk/lTOCTWcCgAGydSEDMlvrlA+aiJsJ6hd/4HAoi7YH+HIS1Kmy/zHY7sN5pFJorAAAAAABAR89Hy0AAAAAABYAFAC/fbf9kYIHBXKXu8b3adgATHdaAQ4gDsiqF5mVS7VD6YIjua4GizFBvve8VdbSxUWvJ87NescBDwQAAAAAARAE/f///wABAStKAQAAAAAAACIAIB7m2wGQPXi6AYymquncLlSzQBssHrvzZNLsU8UG7hK4AQhyAkcwRAIgCUv8sbQ44gsIUPMjEc9mLXq9QJmfbkyAvvtxRWY8+ywCIARf5Mi9KuRORsjWMuRSH4HZrKFJMwMk+WqnnjxsZDqRASgh
AvmOwoBbvi7mMabbeUfMXSSBUjou8OfZEXx6s5JFyI7crHNkYLJoAQ4gqV2gf3wYrbyYgPjeujCYkCCQNC2ZbBfk6qIEYb5QtA8BDwQAAAAAARAE/f///wABAwhCrikAAAAAAAEEFgAUoB2KseLAJjNHR2sxZNm9K6AgbrgA
Jan 03 01:48:54 boltz lightningd[1242922]: lightningd: FATAL SIGNAL 6 (version v23.11.1)
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1be2a87 send_backtrace
Jan 03 01:48:54 boltz lightningd[1242922]:         common/daemon.c:33
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1be2b1e crashdump
Jan 03 01:48:54 boltz lightningd[1242922]:         common/daemon.c:75
Jan 03 01:48:54 boltz lightningd[1242922]: 0x7f76677b951f ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0x7f766780d9fc ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0x7f76677b9475 ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0x7f766779f7f2 ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b9157e fatal_vfmt
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/log.c:1025
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b9161d fatal
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/log.c:1035
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b67862 spend_anchor
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/anchorspend.c:389
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b679f5 refresh_anchor_spend
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/anchorspend.c:411
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b6b6dc rebroadcast_txs
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/chaintopology.c:198
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1bf42fa timer_expired
Jan 03 01:48:54 boltz lightningd[1242922]:         common/timeout.c:62
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b89b27 io_loop_with_timers
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/io_loop_with_timers.c:30
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b8ed9d main
Jan 03 01:48:54 boltz lightningd[1242922]:         lightningd/lightningd.c:1334
Jan 03 01:48:54 boltz lightningd[1242922]: 0x7f76677a0d8f ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0x7f76677a0e3f ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0x5585b1b66d64 ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 0xffffffffffffffff ???
Jan 03 01:48:54 boltz lightningd[1242922]:         ???:0
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.491Z **BROKEN** lightningd: FATAL SIGNAL 6 (version v23.11.1)
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.491Z **BROKEN** lightningd: backtrace: common/daemon.c:38 (send_backtrace) 0x5585b1be2acf
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.491Z **BROKEN** lightningd: backtrace: common/daemon.c:75 (crashdump) 0x5585b1be2b1e
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f76677b951f
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f766780d9fc
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f76677b9475
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f766779f7f2
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/log.c:1025 (fatal_vfmt) 0x5585b1b9157e
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/log.c:1035 (fatal) 0x5585b1b9161d
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/anchorspend.c:389 (spend_anchor) 0x5585b1b67862
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/anchorspend.c:411 (refresh_anchor_spend) 0x5585b1b679f5
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/chaintopology.c:198 (rebroadcast_txs) 0x5585b1b6b6dc
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: common/timeout.c:62 (timer_expired) 0x5585b1bf42fa
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/io_loop_with_timers.c:30 (io_loop_with_timers) 0x5585b1b89b27
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: lightningd/lightningd.c:1334 (main) 0x5585b1b8ed9d
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f76677a0d8f
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f76677a0e3f
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x5585b1b66d64
Jan 03 01:48:54 boltz lightningd[1242922]: 2024-01-03T01:48:54.492Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0xffffffffffffffff

We have had this happen twice:

Jan 03 07:33:21 boltz lightningd[224994]: Non-final PSBT from hsm: cHNidP8BAgQCAAAAAQMEPJMMAAEEAQIBBQEBAQYBAwH7BAIAAAAAAQDsAgAAAAABAYcGVexZt0flhabjKN6g1inuai7tCML0Uo1RSqX+YpkjBAAAAACQAAAAAV+ZCAAAAAAAFgAUcVF2bIqUBuEJrvreUFAPyViVwcsDRzBEAiBzSgBtVH8uRCCPFZIQxxyodZjqh6jbt+IKPJvWMzm7lQIgcVRpFr5z1V8JPyCOBhxL4KFh80ipUHca4WI9t+J2sfYBAE1jIQM/gcQIahICNpEA6h/d0aXla+Matth5a9kFBtB9f+wwVGcCkACydSEDyVSvPcxbf3P3Xv8jl+HUH5+lXv7lxn1b4ayfJJzoHGporAAAAAABAR9fmQgAAAAAABYAFHFRdmyKlAbhCa763lBQD8lYlcHLAQ4gIXb3oYZvhm6jzNscNTws3D7iSCCoX51LpV15BeYm2qcBDwQAAAAAARAE/f///wABAStKAQAAAAAAACIAIB7m2wGQPXi6AYymquncLlSzQBssHrvzZNLsU8UG7hK4AQhyAkcwRAIgNoAeEFvHF5kQrJ4OpC8BHXO35C/0T6pvoDl0xgjdLT8CIHYVDtg0WoiAyzTo9hldUuQBdOVoLG3FsloBuht3n2F1ASghAvmOwoBbvi7mMabbeUfMXSSBUjou8OfZEXx6s5JFyI7crHNkYLJoAQ4gJIDCe+aQH4Tv50skCQ+77W2LeZU/m6zk/cFASdvFFf4BDwQAAAAAARAE/f///wABAwiA3AcAAAAAAAEEFgAUoB2KseLAJjNHR2sxZNm9K6AgbrgA
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.893Z **BROKEN** lightningd: Non-final PSBT from hsm: cHNidP8BAgQCAAAAAQMEPJMMAAEEAQIBBQEBAQYBAwH7BAIAAAAAAQDsAgAAAAABAYcGVexZt0flhabjKN6g1inuai7tCML0Uo1RSqX+YpkjBAAAAACQAAAAAV+ZCAAAAAAAFgAUcVF2bIqUBuEJrvreUFAPyViVwcsDRzBEAiBzSgBtVH8uRCCPFZIQxxyodZjqh6jbt+IKPJvWMzm7lQIgcVRpFr5z1V8JPyCOBhxL4KFh80ipUHca4WI9t+J2sfYBAE1jIQM/gcQIahICNpEA6h/d0aXla+Matth5a9kFBtB9f+wwVGcCkACydSEDyVSvPcxbf3P3Xv8jl+HUH5+lXv7lxn1b4ayfJJzoHGporAAAAAABAR9fmQgAAAAAABYAFHFRdmyKlAbhCa763lBQD8lYlcHLAQ4gIXb3oYZvhm6jzNscNTws3D7iSCCoX51LpV15BeYm2qcBDwQAAAAAARAE/f///wABAStKAQAAAAAAACIAIB7m2wGQPXi6AYymquncLlSzQBssHrvzZNLsU8UG7hK4AQhyAkcwRAIgNoAeEFvHF5kQrJ4OpC8BHXO35C/0T6pvoDl0xgjdLT8CIHYVDtg0WoiAyzTo9hldUuQBdOVoLG3FsloBuht3n2F1ASghAvmOwoBbvi7mMabbeUfMXSSBUjou8OfZEXx6s5JFyI7crHNkYLJoAQ4gJIDCe+aQH4Tv50skCQ+77W2LeZU/m6zk/cFASdvFFf4BDwQAAAAAARAE/f///wABAwiA3AcAAAAAAAEEFgAUoB2KseLAJjNHR2sxZNm9K6AgbrgA
Jan 03 07:33:21 boltz lightningd[224994]: lightningd: FATAL SIGNAL 6 (version v23.11.1)
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da7da87 send_backtrace
Jan 03 07:33:21 boltz lightningd[224994]:         common/daemon.c:33
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da7db1e crashdump
Jan 03 07:33:21 boltz lightningd[224994]:         common/daemon.c:75
Jan 03 07:33:21 boltz lightningd[224994]: 0x7f537405351f ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0x7f53740a79fc ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0x7f5374053475 ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0x7f53740397f2 ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da2c57e fatal_vfmt
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/log.c:1025
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da2c61d fatal
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/log.c:1035
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da02862 spend_anchor
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/anchorspend.c:389
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da029f5 refresh_anchor_spend
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/anchorspend.c:411
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da066dc rebroadcast_txs
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/chaintopology.c:198
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da8f2fa timer_expired
Jan 03 07:33:21 boltz lightningd[224994]:         common/timeout.c:62
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da24b27 io_loop_with_timers
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/io_loop_with_timers.c:30
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da29d9d main
Jan 03 07:33:21 boltz lightningd[224994]:         lightningd/lightningd.c:1334
Jan 03 07:33:21 boltz lightningd[224994]: 0x7f537403ad8f ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0x7f537403ae3f ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0x55d89da01d64 ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 0xffffffffffffffff ???
Jan 03 07:33:21 boltz lightningd[224994]:         ???:0
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: FATAL SIGNAL 6 (version v23.11.1)
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: common/daemon.c:38 (send_backtrace) 0x55d89da7dacf
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: common/daemon.c:75 (crashdump) 0x55d89da7db1e
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f537405351f
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f53740a79fc
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f5374053475
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f53740397f2
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: lightningd/log.c:1025 (fatal_vfmt) 0x55d89da2c57e
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: lightningd/log.c:1035 (fatal) 0x55d89da2c61d
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: lightningd/anchorspend.c:389 (spend_anchor) 0x55d89da02862
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.918Z **BROKEN** lightningd: backtrace: lightningd/anchorspend.c:411 (refresh_anchor_spend) 0x55d89da029f5
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: lightningd/chaintopology.c:198 (rebroadcast_txs) 0x55d89da066dc
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: common/timeout.c:62 (timer_expired) 0x55d89da8f2fa
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: lightningd/io_loop_with_timers.c:30 (io_loop_with_timers) 0x55d89da24b27
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: lightningd/lightningd.c:1334 (main) 0x55d89da29d9d
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f537403ad8f
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7f537403ae3f
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x55d89da01d64
Jan 03 07:33:21 boltz lightningd[224994]: 2024-01-03T07:33:21.919Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0xffffffffffffffff

getinfo output

The only experimental feature we have enabled are the anchors

{
   "id": "02d96eadea3d780104449aca5c93461ce67c1564e2e1d73225fa67dd3b997a6018",
   "alias": "Boltz|CLN",
   "color": "ff9800",
   "num_peers": 75,
   "num_pending_channels": 0,
   "num_active_channels": 72,
   "num_inactive_channels": 6,
   "address": [
      {
         "type": "ipv4",
         "address": "45.86.229.190",
         "port": 9736
      },
      {
         "type": "ipv6",
         "address": "2a10:1fc0:3::270:a9dc",
         "port": 9736
      },
      {
         "type": "torv3",
         "address": "oo5tkbbpgnqjopdjxepyfavx3yemtylgzul67s7zzzxfeeqpde6yr7yd.onion",
         "port": 9736
      }
   ],
   "binding": [
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9736
      },
      {
         "type": "ipv6",
         "address": "::1",
         "port": 9736
      }
   ],
   "version": "v23.11.1",
   "blockheight": 824166,
   "network": "bitcoin",
   "fees_collected_msat": <omitted>,
   "lightning-dir": "/home/bitcoin/.lightning/bitcoin",
   "our_features": {
      "init": "08a0000a8a69a2",
      "node": "88a0000a8a69a2",
      "channel": "",
      "invoice": "02000002024100"
   }
}
@vincenzopalazzo vincenzopalazzo added the in diagnostic issue under diagnostic label Jan 3, 2024
@vincenzopalazzo vincenzopalazzo added this to the v24.02 milestone Jan 3, 2024
endothermicdev added a commit to endothermicdev/lightning that referenced this issue Jan 3, 2024
@cdecker
Copy link
Member

cdecker commented Jan 4, 2024

My hunch here is that this is an old(-ish) node, or a node that had a channel open without option_upfront_shutdown_script, therefore the output from closing is one of the old tweaked pubkeys, which may be causing the signer to misidentify it as someone else's output, therefore not signing it, and causing the non-final PSBT status after signing.

The solutions here are twofold: prevent using tweaked pubkey outputs to bump anchors, or teach the signer about those tweaked key. I was unable to decode the PSBT, so I cannot verify this. But @michael1011 could probably take a look at the inputs and tell us if this idea is correct.

@jgriffiths
Copy link
Contributor

This is a v2 PSBT. using the following to convert it to v0:

from wallycore import *

x = "cHNidP8BAgQCAAAAAQMEPJMMAAEEAQIBBQEBAQYBAwH7BAIAAAAAAQDsAgAAAAABAYcGVexZt0flhabjKN6g1inuai7tCML0Uo1RSqX+YpkjBAAAAACQAAAAAV+ZCAAAAAAAFgAUcVF2bIqUBuEJrvreUFAPyViVwcsDRzBEAiBzSgBtVH8uRCCPFZIQxxyodZjqh6jbt+IKPJvWMzm7lQIgcVRpFr5z1V8JPyCOBhxL4KFh80ipUHca4WI9t+J2sfYBAE1jIQM/gcQIahICNpEA6h/d0aXla+Matth5a9kFBtB9f+wwVGcCkACydSEDyVSvPcxbf3P3Xv8jl+HUH5+lXv7lxn1b4ayfJJzoHGporAAAAAABAR9fmQgAAAAAABYAFHFRdmyKlAbhCa763lBQD8lYlcHLAQ4gIXb3oYZvhm6jzNscNTws3D7iSCCoX51LpV15BeYm2qcBDwQAAAAAARAE/f///wABAStKAQAAAAAAACIAIB7m2wGQPXi6AYymquncLlSzQBssHrvzZNLsU8UG7hK4AQhyAkcwRAIgNoAeEFvHF5kQrJ4OpC8BHXO35C/0T6pvoDl0xgjdLT8CIHYVDtg0WoiAyzTo9hldUuQBdOVoLG3FsloBuht3n2F1ASghAvmOwoBbvi7mMabbeUfMXSSBUjou8OfZEXx6s5JFyI7crHNkYLJoAQ4gJIDCe+aQH4Tv50skCQ+77W2LeZU/m6zk/cFASdvFFf4BDwQAAAAAARAE/f///wABAwiA3AcAAAAAAAEEFgAUoB2KseLAJjNHR2sxZNm9K6AgbrgA"

x = psbt_from_base64(x, 0)
psbt_set_version(x, 0, 0)
print(psbt_to_base64(x, 0))

we can decode the result:

$ cli decodepsbt cHNidP8BAHsCAAAAAiF296GGb4Zuo8zbHDU8LNw+4kggqF+dS6VdeQXmJtqnAAAAAAD9////JIDCe+aQH4Tv50skCQ+77W2LeZU/m6zk/cFASdvFFf4AAAAAAP3///8BgNwHAAAAAAAWABSgHYqx4sAmM0dHazFk2b0roCBuuDyTDAAAAQDsAgAAAAABAYcGVexZt0flhabjKN6g1inuai7tCML0Uo1RSqX+YpkjBAAAAACQAAAAAV+ZCAAAAAAAFgAUcVF2bIqUBuEJrvreUFAPyViVwcsDRzBEAiBzSgBtVH8uRCCPFZIQxxyodZjqh6jbt+IKPJvWMzm7lQIgcVRpFr5z1V8JPyCOBhxL4KFh80ipUHca4WI9t+J2sfYBAE1jIQM/gcQIahICNpEA6h/d0aXla+Matth5a9kFBtB9f+wwVGcCkACydSEDyVSvPcxbf3P3Xv8jl+HUH5+lXv7lxn1b4ayfJJzoHGporAAAAAABAR9fmQgAAAAAABYAFHFRdmyKlAbhCa763lBQD8lYlcHLAAEBK0oBAAAAAAAAIgAgHubbAZA9eLoBjKaq6dwuVLNAGyweu/Nk0uxTxQbuErgBCHICRzBEAiA2gB4QW8cXmRCsng6kLwEdc7fkL/RPqm+gOXTGCN0tPwIgdhUO2DRaiIDLNOj2GV1S5AF05WgsbcWyWgG6G3efYXUBKCEC+Y7CgFu+LuYxptt5R8xdJIFSOi7w59kRfHqzkkXIjtysc2RgsmgAAA==
{
  "tx": {
    "txid": "333085aced8e20db05a52d57069d141c7b0a405d18a7b2ae1613c7aa3f31c8db",
    "hash": "333085aced8e20db05a52d57069d141c7b0a405d18a7b2ae1613c7aa3f31c8db",
    "version": 2,
    "size": 123,
    "vsize": 123,
    "weight": 492,
    "locktime": 824124,
    "vin": [
      {
        "txid": "a7da26e605795da54b9d5fa82048e23edc2c3c351cdbcca36e866f86a1f77621",
        "vout": 0,
        "scriptSig": {
          "asm": "",
          "hex": ""
        },
        "sequence": 4294967293
      },
      {
        "txid": "fe15c5db4940c1fde4ac9b3f95798b6dedbb0f09244be7ef841f90e67bc28024",
        "vout": 0,
        "scriptSig": {
          "asm": "",
          "hex": ""
        },
        "sequence": 4294967293
      }
    ],
    "vout": [
      {
        "value": 0.00515200,
        "n": 0,
        "scriptPubKey": {
          "asm": "0 a01d8ab1e2c0263347476b3164d9bd2ba0206eb8",
          "desc": "addr(bcrt1q5qwc4v0zcqnrx368dvckfkda9wszqm4cz53vhx)#wlvaw0uu",
          "hex": "0014a01d8ab1e2c0263347476b3164d9bd2ba0206eb8",
          "address": "bcrt1q5qwc4v0zcqnrx368dvckfkda9wszqm4cz53vhx",
          "type": "witness_v0_keyhash"
        }
      }
    ]
  },
  "global_xpubs": [
  ],
  "psbt_version": 0,
  "proprietary": [
  ],
  "unknown": {
  },
  "inputs": [
    {
      "witness_utxo": {
        "amount": 0.00563551,
        "scriptPubKey": {
          "asm": "0 7151766c8a9406e109aefade50500fc95895c1cb",
          "desc": "addr(bcrt1qw9ghvmy2jsrwzzdwlt09q5q0e9vftswtp5sev0)#6tpe554y",
          "hex": "00147151766c8a9406e109aefade50500fc95895c1cb",
          "address": "bcrt1qw9ghvmy2jsrwzzdwlt09q5q0e9vftswtp5sev0",
          "type": "witness_v0_keyhash"
        }
      },
      "non_witness_utxo": {
        "txid": "a7da26e605795da54b9d5fa82048e23edc2c3c351cdbcca36e866f86a1f77621",
        "hash": "9d925ddef6b4422af8cfd6e42106114c4c798f35b98fc7f584dbc5a61692803c",
        "version": 2,
        "size": 236,
        "vsize": 121,
        "weight": 482,
        "locktime": 0,
        "vin": [
          {
            "txid": "239962fea54a518d52f4c208ed2e6aee29d6a0de28e3a685e547b759ec550687",
            "vout": 4,
            "scriptSig": {
              "asm": "",
              "hex": ""
            },
            "txinwitness": [
              "30440220734a006d547f2e44208f159210c71ca87598ea87a8dbb7e20a3c9bd63339bb95022071546916be73d55f093f208e061c4be0a161f348a950771ae1623db7e276b1f601",
              "",
              "6321033f81c4086a1202369100ea1fddd1a5e56be31ab6d8796bd90506d07d7fec305467029000b2752103c954af3dcc5b7f73f75eff2397e1d41f9fa55efee5c67d5be1ac9f249ce81c6a68ac"
            ],
            "sequence": 144
          }
        ],
        "vout": [
          {
            "value": 0.00563551,
            "n": 0,
            "scriptPubKey": {
              "asm": "0 7151766c8a9406e109aefade50500fc95895c1cb",
              "desc": "addr(bcrt1qw9ghvmy2jsrwzzdwlt09q5q0e9vftswtp5sev0)#6tpe554y",
              "hex": "00147151766c8a9406e109aefade50500fc95895c1cb",
              "address": "bcrt1qw9ghvmy2jsrwzzdwlt09q5q0e9vftswtp5sev0",
              "type": "witness_v0_keyhash"
            }
          }
        ]
      }
    },
    {
      "witness_utxo": {
        "amount": 0.00000330,
        "scriptPubKey": {
          "asm": "0 1ee6db01903d78ba018ca6aae9dc2e54b3401b2c1ebbf364d2ec53c506ee12b8",
          "desc": "addr(bcrt1qrmndkqvs84ut5qvv564wnhpw2je5qxevr6alxexja3fu2phwz2uqnf208g)#lgp98em5",
          "hex": "00201ee6db01903d78ba018ca6aae9dc2e54b3401b2c1ebbf364d2ec53c506ee12b8",
          "address": "bcrt1qrmndkqvs84ut5qvv564wnhpw2je5qxevr6alxexja3fu2phwz2uqnf208g",
          "type": "witness_v0_scripthash"
        }
      },
      "final_scriptwitness": [
        "3044022036801e105bc7179910ac9e0ea42f011d73b7e42ff44faa6fa03974c608dd2d3f022076150ed8345a8880cb34e8f6195d52e40174e5682c6dc5b25a01ba1b779f617501",
        "2102f98ec2805bbe2ee631a6db7947cc5d2481523a2ef0e7d9117c7ab39245c88edcac736460b268"
      ]
    }
  ],
  "outputs": [
    {
    }
  ],
  "fee": 0.00048681
}

analyzepsbt:

{
  "inputs": [
    {
      "has_utxo": true,
      "is_final": false,
      "next": "updater",
      "missing": {
        "pubkeys": [
          "7151766c8a9406e109aefade50500fc95895c1cb"
        ]
      }
    },
    {
      "has_utxo": true,
      "is_final": true,
      "next": "extractor"
    }
  ],
  "fee": 0.00048681,
  "next": "updater"
}

@cdecker cdecker removed this from the v24.02 milestone Feb 13, 2024
@michael1011
Copy link
Contributor Author

The release v24.02 enables anchors by default. Was this issue fixed?

@cdecker
Copy link
Member

cdecker commented Mar 11, 2024

The latest version of liberally has been pulled din and it should be fixed, as far as I know.

@michael1011
Copy link
Contributor Author

The latest version of liberally has been pulled din and it should be fixed, as far as I know.

Alright. I am gonna close this for now and will reopen in case we observe the same behaviour again

@michael1011
Copy link
Contributor Author

+175839.489044502 lightningdBROKEN: Non-final PSBT from hsm: cHNidP8BAgQCAAAAAQME1ngnAAEEAQIBBQEBAQYBAwH7BAIAAAAAAQD9aQMCAAAAAAEBtHkxKg5GGVQGPoYTq6Pz0gqE3CrOcIz7qJx91hJ4zQcBAAAAAHT094AOSgEAAAAAAAAiACCAdnGSg9tgZH64wvG9ijxrvJTXgzF3QlyHT74r4ax9W0oBAAAAAAAAIgAg9ukbv8J3lesNxsNka6Nyv5zEJAmkKaR34GbK8t29qvujawAAAAAAACIAIEBOAmbooc1LtdUTQ9lFiuHmJ4iAwJrkM18dBM+3LozXOXQAAAAAAAAiACC+//uiUvyN7BGvM1PFu5LQlXL6Kj6v9xAMYzdIxGjrejB1AAAAAAAAIgAgGIjbfQHXOomX8uTbGV7eC1Le80rGvhKlKbHQdN7gZMJQigAAAAAAACIAIL7/+6JS/I3sEa8zU8W7ktCVcvoqPq/3EAxjN0jEaOt6EKQAAAAAAAAiACBCgxtgJbDZ0m1z6PqiyGberLZNr8o7k1bEpZjBXqryehnAAAAAAAAAIgAgvv/7olL8jewRrzNTxbuS0JVy+io+r/cQDGM3SMRo63px6AAAAAAAACIAIL7/+6JS/I3sEa8zU8W7ktCVcvoqPq/3EAxjN0jEaOt6nxQBAAAAAAAiACC+//uiUvyN7BGvM1PFu5LQlXL6Kj6v9xAMYzdIxGjrevBVAQAAAAAAIgAgvv/7olL8jewRrzNTxbuS0JVy+io+r/cQDGM3SMRo63o+KQIAAAAAACIAIL7/+6JS/I3sEa8zU8W7ktCVcvoqPq/3EAxjN0jEaOt6mmFSAAAAAAAiACD/KpicrvGAxlIWsN+P6iCfiBI/M+amT/rRX8VoW3RV2BefmgUAAAAAIgAgmNc09A2SQTp9N81JYnvsgxlhxOKAKIUke/nP/Kt/dIUEAEcwRAIgD9PsvtsdtYcfsJC0tco25N6EqchznxWu7kteIeC7gmsCIEBrpMAJ2ga0gSzpgVY+iFfNJ7iFAeiZaKBKh+2DeXnXAUcwRAIgbVfTgHuXIwqt/OnkoDr9ZtCM5caL6l+k3gCzQHJUh0ICICIrf4wBOJ9UWCTEO6xE9K7h7bDLRK0zOqJpzSrEJGY3AUdSIQJVITkBOokgRNJUyRsnfA+zqSTsLOpUaTetHLNPMrQKICEDJrcWhu5TQCEyv3yAhWkzfaeKjW/ZtvwWcXrK2uiLqx1Srpw38yABASuaYVIAAAAAACIAIP8qmJyu8YDGUhaw34/qIJ+IEj8z5qZP+tFfxWhbdFXYAQ4glbQ96o6WmrPWEinWvj4rCuKikmmotI0Ug6JBPJUoHmYBDwQMAAAAARAEAQAAAAABAStKAQAAAAAAACIAIIB2cZKD22BkfrjC8b2KPGu8lNeDMXdCXIdPvivhrH1bAQhyAkcwRAIgYQ1TzwxLRmwtEMNzRR93KdlOWz4gPys816VUJtK7VhECIDy3lHDfMoRsV9BNasm9uicl5U9UgDXdysGatsN33pYSASghAlUhOQE6iSBE0lTJGyd8D7OpJOws6lRpN60cs08ytAogrHNkYLJoAQ4gezYB4+Elfc4jrZEpxmJGQ+JB+ZY+Nyp59175wI4WyTgBDwQAAAAAARAE/f///wABAwjyBUsAAAAAAAEEFgAUcrL/X6ZqEqifE8CNXAGK1ozBQlwA
+175839.514597860 lightningdBROKEN: FATAL SIGNAL 6 (version v24.02.2)
+175839.514671306 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da43ee6
+175839.514695019 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da43f35
+175839.514710743 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a8fa4951f
+175839.514746420 lightningdBROKEN: backtrace: (null):0 (pthread_kill) 0x7f8a8fa9d9fc
+175839.514761660 lightningdBROKEN: backtrace: (null):0 (raise) 0x7f8a8fa49475
+175839.514813676 lightningdBROKEN: backtrace: (null):0 (abort) 0x7f8a8fa2f7f2
+175839.514829114 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9f1b57
+175839.514844378 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9f1bf6
+175839.514875773 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c4782
+175839.514897222 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c4915
+175839.514912466 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c861c
+175839.514927303 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c8747
+175839.514958238 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c8801
+175839.514973585 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c5c36
+175839.514988099 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da12d22
+175839.515003272 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da165e6
+175839.515018039 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da1687e
+175839.515049687 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb38d7
+175839.515065001 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb3db2
+175839.515079996 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb3e4f
+175839.515095029 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb57ec
+175839.515144067 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9e9ca8
+175839.515159677 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9ef376
+175839.515175133 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a8fa30d8f
+175839.515190121 lightningdBROKEN: backtrace: (null):0 (__libc_start_main) 0x7f8a8fa30e3f
+175839.515205050 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c3c84
+175839.515240113 lightningdBROKEN: backtrace: (null):0 ((null)) 0xffffffffffffffff
+175840.128520997 lightningdBROKEN: FATAL SIGNAL 11 (version v24.02.2)
+175840.128560486 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da43ee6
+175840.128577938 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da43f35
+175840.128593554 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a8fa4951f
+175840.128620390 lightningdBROKEN: backtrace: (null):0 (abort) 0x7f8a8fa2f898
+175840.128635903 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9f1b57
+175840.128651334 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9f1bf6
+175840.128666787 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c4782
+175840.128682399 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c4915
+175840.128697535 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c861c
+175840.128712707 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c8747
+175840.128728276 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c8801
+175840.128744401 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c5c36
+175840.128760021 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da12d22
+175840.128775485 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da165e6
+175840.128790421 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8da1687e
+175840.128806340 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb38d7
+175840.128821948 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb3db2
+175840.128837484 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb3e4f
+175840.128853247 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8dbb57ec
+175840.128868564 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9e9ca8
+175840.128884170 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9ef376
+175840.128898971 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a8fa30d8f
+175840.128914359 lightningdBROKEN: backtrace: (null):0 (__libc_start_main) 0x7f8a8fa30e3f
+175840.128939741 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55ad8d9c3c84
+175840.128954674 lightningdBROKEN: backtrace: (null):0 ((null)) 0xffffffffffffffff

Still happening on v24.02.2. On testnet this time

@michael1011 michael1011 reopened this Apr 17, 2024
@kilrau
Copy link

kilrau commented Apr 17, 2024

linking a patch that at least prevents the crash endothermicdev@5aebe15

@rustyrussell rustyrussell added this to the v24.05 milestone Apr 28, 2024
@rustyrussell rustyrussell self-assigned this Apr 28, 2024
@rustyrussell
Copy link
Contributor

rustyrussell commented May 6, 2024

This is the bitcoind decode (after using lightningd to change to PSBT v0) for this one:

$ bitcoin-cli -regtest decodepsbt cHNidP8BAHsCAAAAApW0PeqOlpqz1hIp1r4+KwriopJpqLSNFIOiQTyVKB5mDAAAAAABAAAAezYB4+Elfc4jrZEpxmJGQ+JB+ZY+Nyp59175wI4WyTgAAAAAAP3///8B8gVLAAAAAAAWABRysv9fpmoSqJ8TwI1cAYrWjMFCXNZ4JwAAAQD9aQMCAAAAAAEBtHkxKg5GGVQGPoYTq6Pz0gqE3CrOcIz7qJx91hJ4zQcBAAAAAHT094AOSgEAAAAAAAAiACCAdnGSg9tgZH64wvG9ijxrvJTXgzF3QlyHT74r4ax9W0oBAAAAAAAAIgAg9ukbv8J3lesNxsNka6Nyv5zEJAmkKaR34GbK8t29qvujawAAAAAAACIAIEBOAmbooc1LtdUTQ9lFiuHmJ4iAwJrkM18dBM+3LozXOXQAAAAAAAAiACC+//uiUvyN7BGvM1PFu5LQlXL6Kj6v9xAMYzdIxGjrejB1AAAAAAAAIgAgGIjbfQHXOomX8uTbGV7eC1Le80rGvhKlKbHQdN7gZMJQigAAAAAAACIAIL7/+6JS/I3sEa8zU8W7ktCVcvoqPq/3EAxjN0jEaOt6EKQAAAAAAAAiACBCgxtgJbDZ0m1z6PqiyGberLZNr8o7k1bEpZjBXqryehnAAAAAAAAAIgAgvv/7olL8jewRrzNTxbuS0JVy+io+r/cQDGM3SMRo63px6AAAAAAAACIAIL7/+6JS/I3sEa8zU8W7ktCVcvoqPq/3EAxjN0jEaOt6nxQBAAAAAAAiACC+//uiUvyN7BGvM1PFu5LQlXL6Kj6v9xAMYzdIxGjrevBVAQAAAAAAIgAgvv/7olL8jewRrzNTxbuS0JVy+io+r/cQDGM3SMRo63o+KQIAAAAAACIAIL7/+6JS/I3sEa8zU8W7ktCVcvoqPq/3EAxjN0jEaOt6mmFSAAAAAAAiACD/KpicrvGAxlIWsN+P6iCfiBI/M+amT/rRX8VoW3RV2BefmgUAAAAAIgAgmNc09A2SQTp9N81JYnvsgxlhxOKAKIUke/nP/Kt/dIUEAEcwRAIgD9PsvtsdtYcfsJC0tco25N6EqchznxWu7kteIeC7gmsCIEBrpMAJ2ga0gSzpgVY+iFfNJ7iFAeiZaKBKh+2DeXnXAUcwRAIgbVfTgHuXIwqt/OnkoDr9ZtCM5caL6l+k3gCzQHJUh0ICICIrf4wBOJ9UWCTEO6xE9K7h7bDLRK0zOqJpzSrEJGY3AUdSIQJVITkBOokgRNJUyRsnfA+zqSTsLOpUaTetHLNPMrQKICEDJrcWhu5TQCEyv3yAhWkzfaeKjW/ZtvwWcXrK2uiLqx1Srpw38yABASuaYVIAAAAAACIAIP8qmJyu8YDGUhaw34/qIJ+IEj8z5qZP+tFfxWhbdFXYAAEBK0oBAAAAAAAAIgAggHZxkoPbYGR+uMLxvYo8a7yU14Mxd0Jch0++K+GsfVsBCHICRzBEAiBhDVPPDEtGbC0Qw3NFH3cp2U5bPiA/KzzXpVQm0rtWEQIgPLeUcN8yhGxX0E1qyb26JyXlT1SANd3KwZq2w3felhIBKCECVSE5ATqJIETSVMkbJ3wPs6kk7CzqVGk3rRyzTzK0CiCsc2RgsmgAAA==
{
  "tx": {
    "txid": "2ece015791069d159de1476e8b24fa11e308948d66e4e363a36924064ed3a9b5",
    "hash": "2ece015791069d159de1476e8b24fa11e308948d66e4e363a36924064ed3a9b5",
    "version": 2,
    "size": 123,
    "vsize": 123,
    "weight": 492,
    "locktime": 2586838,
    "vin": [
      {
        "txid": "661e28953c41a283148db4a86992a2e20a2b3ebed62912d6b39a968eea3db495",
        "vout": 12,
        "scriptSig": {
          "asm": "",
          "hex": ""
        },
        "sequence": 1
      },
      {
        "txid": "38c9168ec0f95ef7792a373e96f941e2434662c62991ad23ce7d25e1e301367b",
        "vout": 0,
        "scriptSig": {
          "asm": "",
          "hex": ""
        },
        "sequence": 4294967293
      }
    ],
    "vout": [
      {
        "value": 0.04916722,
        "n": 0,
        "scriptPubKey": {
          "asm": "0 72b2ff5fa66a12a89f13c08d5c018ad68cc1425c",
          "desc": "addr(bcrt1qw2e07haxdgf238cnczx4cqv266xvzsjunvma8h)#wylztc8g",
          "hex": "001472b2ff5fa66a12a89f13c08d5c018ad68cc1425c",
          "address": "bcrt1qw2e07haxdgf238cnczx4cqv266xvzsjunvma8h",
          "type": "witness_v0_keyhash"
        }
      }
    ]
  },
  "global_xpubs": [
  ],
  "psbt_version": 0,
  "proprietary": [
  ],
  "unknown": {
  },
  "inputs": [
    {
      "witness_utxo": {
        "amount": 0.05398938,
        "scriptPubKey": {
          "asm": "0 ff2a989caef180c65216b0df8fea209f88123f33e6a64ffad15fc5685b7455d8",
          "desc": "addr(bcrt1qlu4f389w7xqvv5skkr0cl63qn7ypy0enu6nyl7k3tlzkskm52hvqr42eq5)#eh93ywnd",
          "hex": "0020ff2a989caef180c65216b0df8fea209f88123f33e6a64ffad15fc5685b7455d8",
          "address": "bcrt1qlu4f389w7xqvv5skkr0cl63qn7ypy0enu6nyl7k3tlzkskm52hvqr42eq5",
          "type": "witness_v0_scripthash"
        }
      },
      "non_witness_utxo": {
        "txid": "661e28953c41a283148db4a86992a2e20a2b3ebed62912d6b39a968eea3db495",
        "hash": "3784a0db1b57c11fc9fa3ad61de007d2158c32649661cd72d171ed10cfa486db",
        "version": 2,
        "size": 873,
        "vsize": 708,
        "weight": 2832,
        "locktime": 552810396,
        "vin": [
          {
            "txid": "07cd7812d67d9ca8fb8c70ce2adc840ad2f3a3ab13863e065419460e2a3179b4",
            "vout": 1,
            "scriptSig": {
              "asm": "",
              "hex": ""
            },
            "txinwitness": [
              "",
              "304402200fd3ecbedb1db5871fb090b4b5ca36e4de84a9c8739f15aeee4b5e21e0bb826b0220406ba4c009da06b4812ce981563e8857cd27b88501e89968a04a87ed837979d701",
              "304402206d57d3807b97230aadfce9e4a03afd66d08ce5c68bea5fa4de00b340725487420220222b7f8c01389f545824c43bac44f4aee1edb0cb44ad333aa269cd2ac424663701",
              "522102552139013a892044d254c91b277c0fb3a924ec2cea546937ad1cb34f32b40a20210326b71686ee53402132bf7c808569337da78a8d6fd9b6fc16717acadae88bab1d52ae"
            ],
            "sequence": 2163733620
          }
        ],
        "vout": [
          {
            "value": 0.00000330,
            "n": 0,
            "scriptPubKey": {
              "asm": "0 8076719283db60647eb8c2f1bd8a3c6bbc94d7833177425c874fbe2be1ac7d5b",
              "desc": "addr(bcrt1qspm8ry5rmdsxgl4cctcmmz3udw7ff4urx9m5yhy8f7lzhcdv04dssj3g9q)#rscg0tr5",
              "hex": "00208076719283db60647eb8c2f1bd8a3c6bbc94d7833177425c874fbe2be1ac7d5b",
              "address": "bcrt1qspm8ry5rmdsxgl4cctcmmz3udw7ff4urx9m5yhy8f7lzhcdv04dssj3g9q",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00000330,
            "n": 1,
            "scriptPubKey": {
              "asm": "0 f6e91bbfc27795eb0dc6c3646ba372bf9cc42409a429a477e066caf2ddbdaafb",
              "desc": "addr(bcrt1q7m53h07zw727krwxcdjxhgmjh7wvgfqf5s56galqvm909hda4tasy90frk)#3kn9gjdz",
              "hex": "0020f6e91bbfc27795eb0dc6c3646ba372bf9cc42409a429a477e066caf2ddbdaafb",
              "address": "bcrt1q7m53h07zw727krwxcdjxhgmjh7wvgfqf5s56galqvm909hda4tasy90frk",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00027555,
            "n": 2,
            "scriptPubKey": {
              "asm": "0 404e0266e8a1cd4bb5d51343d9458ae1e6278880c09ae4335f1d04cfb72e8cd7",
              "desc": "addr(bcrt1qgp8qyehg58x5hdw4zdpaj3v2u8nz0zyqczdwgv6lr5zvldew3ntsdzdc4l)#g05dzmg2",
              "hex": "0020404e0266e8a1cd4bb5d51343d9458ae1e6278880c09ae4335f1d04cfb72e8cd7",
              "address": "bcrt1qgp8qyehg58x5hdw4zdpaj3v2u8nz0zyqczdwgv6lr5zvldew3ntsdzdc4l",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00029753,
            "n": 3,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00030000,
            "n": 4,
            "scriptPubKey": {
              "asm": "0 1888db7d01d73a8997f2e4db195ede0b52def34ac6be12a529b1d074dee064c2",
              "desc": "addr(bcrt1qrzydklgp6uagn9ljund3jhk7pdfdau62c6lp9fffk8g8fhhqvnpqw0ud7r)#jyke3qh3",
              "hex": "00201888db7d01d73a8997f2e4db195ede0b52def34ac6be12a529b1d074dee064c2",
              "address": "bcrt1qrzydklgp6uagn9ljund3jhk7pdfdau62c6lp9fffk8g8fhhqvnpqw0ud7r",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00035408,
            "n": 5,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00042000,
            "n": 6,
            "scriptPubKey": {
              "asm": "0 42831b6025b0d9d26d73e8faa2c866deacb64dafca3b9356c4a598c15eaaf27a",
              "desc": "addr(bcrt1qg2p3kcp9krvaymtnara29jrxm6ktvnd0egaex4ky5kvvzh427faqpqacrd)#jnj7pxtf",
              "hex": "002042831b6025b0d9d26d73e8faa2c866deacb64dafca3b9356c4a598c15eaaf27a",
              "address": "bcrt1qg2p3kcp9krvaymtnara29jrxm6ktvnd0egaex4ky5kvvzh427faqpqacrd",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00049177,
            "n": 7,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00059505,
            "n": 8,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00070815,
            "n": 9,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00087536,
            "n": 10,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.00141630,
            "n": 11,
            "scriptPubKey": {
              "asm": "0 befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "desc": "addr(bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h)#tav8n8qc",
              "hex": "0020befffba252fc8dec11af3353c5bb92d09572fa2a3eaff7100c633748c468eb7a",
              "address": "bcrt1qhmllhgjjljx7cyd0xdfutwuj6z2h973286hlwyqvvvm533rgadaqk9u53h",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.05398938,
            "n": 12,
            "scriptPubKey": {
              "asm": "0 ff2a989caef180c65216b0df8fea209f88123f33e6a64ffad15fc5685b7455d8",
              "desc": "addr(bcrt1qlu4f389w7xqvv5skkr0cl63qn7ypy0enu6nyl7k3tlzkskm52hvqr42eq5)#eh93ywnd",
              "hex": "0020ff2a989caef180c65216b0df8fea209f88123f33e6a64ffad15fc5685b7455d8",
              "address": "bcrt1qlu4f389w7xqvv5skkr0cl63qn7ypy0enu6nyl7k3tlzkskm52hvqr42eq5",
              "type": "witness_v0_scripthash"
            }
          },
          {
            "value": 0.94019351,
            "n": 13,
            "scriptPubKey": {
              "asm": "0 98d734f40d92413a7d37cd49627bec831961c4e2802885247bf9cffcab7f7485",
              "desc": "addr(bcrt1qnrtnfaqdjfqn5lfhe4yky7lvsvvkr38zsq5g2frml88le2mlwjzstrkrjm)#uwax7e7a",
              "hex": "002098d734f40d92413a7d37cd49627bec831961c4e2802885247bf9cffcab7f7485",
              "address": "bcrt1qnrtnfaqdjfqn5lfhe4yky7lvsvvkr38zsq5g2frml88le2mlwjzstrkrjm",
              "type": "witness_v0_scripthash"
            }
          }
        ]
      }
    },
    {
      "witness_utxo": {
        "amount": 0.00000330,
        "scriptPubKey": {
          "asm": "0 8076719283db60647eb8c2f1bd8a3c6bbc94d7833177425c874fbe2be1ac7d5b",
          "desc": "addr(bcrt1qspm8ry5rmdsxgl4cctcmmz3udw7ff4urx9m5yhy8f7lzhcdv04dssj3g9q)#rscg0tr5",
          "hex": "00208076719283db60647eb8c2f1bd8a3c6bbc94d7833177425c874fbe2be1ac7d5b",
          "address": "bcrt1qspm8ry5rmdsxgl4cctcmmz3udw7ff4urx9m5yhy8f7lzhcdv04dssj3g9q",
          "type": "witness_v0_scripthash"
        }
      },
      "final_scriptwitness": [
        "30440220610d53cf0c4b466c2d10c373451f7729d94e5b3e203f2b3cd7a55426d2bb561102203cb79470df32846c57d04d6ac9bdba2725e54f548035ddcac19ab6c377de961201",
        "2102552139013a892044d254c91b277c0fb3a924ec2cea546937ad1cb34f32b40a20ac736460b268"
      ]
    }
  ],
  "outputs": [
    {
    }
  ],
  "fee": 0.00482546
}

Note that this, like the previous, seems to have no outputs! That's not a valid tx! (WRONG, sorry)

While there's no proper backtrace on the second report, the first shows spend_anchor, i.e. this is us creating a CPFP tx to bump the fee.

@rustyrussell
Copy link
Contributor

rustyrussell commented May 6, 2024

OK. Looking at the testnet one. We have two inputs: second is the anchor, which is finalized fine, and first is a to-remote output from a previous unilateral close, which for some reason we do not finalize.

Interestingly, that output did get spent according to the testnet explorer (which is why I know its script!), so we obviously can spend it somehow, but we're failing to do so in this case.

Here's the tx which spent it (as third output): https://blockstream.info/testnet/tx/d1d87af8946333427a76d76f9524a8590e15eb1ef3bf691f32907dc4627781a8

@benthecarman
Copy link
Contributor

benthecarman commented May 6, 2024

For the anchor input there is only the witness_utxo. Some libraries don't like this because with pre-taproot inputs, that may be the cause

@rustyrussell
Copy link
Contributor

Good point, but we're OK with that (and indeed, you can see the final_scriptwitness for that one).

I've added a test, but it works. I think we'll need @endothermicdev 's "don't crash" fix, and more logging to get to the bottom of this if it happens again...

rustyrussell pushed a commit to rustyrussell/lightning that referenced this issue May 6, 2024
Temporary patch to avoid issue ElementsProject#6973

[ Add much more logging! --RR ]

Changelog-Fixed: lightningd: avoid crash on signing failure when trying to spend anchor outputs.
rustyrussell pushed a commit to rustyrussell/lightning that referenced this issue May 7, 2024
Temporary patch to avoid issue ElementsProject#6973

[ Add much more logging! --RR ]

Changelog-Fixed: lightningd: avoid crash on signing failure when trying to spend anchor outputs.
endothermicdev added a commit that referenced this issue May 7, 2024
Temporary patch to avoid issue #6973

[ Add much more logging! --RR ]

Changelog-Fixed: lightningd: avoid crash on signing failure when trying to spend anchor outputs.
rustyrussell pushed a commit to rustyrussell/lightning that referenced this issue May 14, 2024
Temporary patch to avoid issue ElementsProject#6973

[ Add much more logging! --RR ]

Changelog-Fixed: lightningd: avoid crash on signing failure when trying to spend anchor outputs.
@rustyrussell rustyrussell modified the milestones: v24.05, v24.08 Jun 9, 2024
@rustyrussell
Copy link
Contributor

I'm closing this for now, will reopen if it happens again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash in diagnostic issue under diagnostic
Projects
None yet
Development

No branches or pull requests

7 participants