-
Notifications
You must be signed in to change notification settings - Fork 912
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
wallet: skip the PEGIN tx feature on elements #6975
wallet: skip the PEGIN tx feature on elements #6975
Conversation
c60a55f
to
420d306
Compare
This patch is proposing a temporary patch for elements, some of our users try to use elements and get the stack trace on the bottom. The crash happens because the `psbt_input_from_tx_input_pegin` is called and libwally do not support the PEGIN tx feature. This patch removes the PEGIN feature because cln should not care about this kind of transaction. I am not sure about this change so this requires more eyes. Link ElementsProject#6955 Signed-off-by: Vincenzo Palazzo <[email protected]> lightningd: bitcoin/psbt.c:65: struct wally_psbt *new_psbt(const tal_t *, const struct wally_tx *): Assertion `wally_err == WALLY_OK' failed. lightningd: FATAL SIGNAL 6 (version v23.11-84-ga59dbbd-modded) 0x19f6a0 send_backtrace /home/vincent/github/work/lightning/common/daemon.c:33 0x19fb29 crashdump /home/vincent/github/work/lightning/common/daemon.c:75 0x4ba170f ??? ???:0 0x4bf183c ??? ???:0 0x4ba1667 ??? ???:0 0x4b894b7 ??? ???:0 0x4b893db ??? ???:0 0x4b99d25 ??? ???:0 0x1bd052 new_psbt /home/vincent/github/work/lightning/bitcoin/psbt.c:65 0x1c6a45 pull_bitcoin_tx /home/vincent/github/work/lightning/bitcoin/tx.c:665 0x1bbcd0 bitcoin_block_from_hex /home/vincent/github/work/lightning/bitcoin/block.c:213 0x123f90 getrawblockbyheight_callback /home/vincent/github/work/lightning/lightningd/bitcoind.c:486 0x16ece7 plugin_response_handle Signed-off-by: Vincenzo Palazzo <[email protected]>
420d306
to
d7b3df6
Compare
I'd be really surprised if this were to work: we are patching the features on a transaction from a block, masking away some features, which then somehow change the way we parse, but we still parse successfully? Maybe @jgriffiths can help us out with this one? |
I'd need a script reproducing this to implement the required wally functionality I think, I'm not particularly familiar with pegins. edit: I'm also wondering why you need to make psbts out of every tx in the block; that surely can't be right. I suspect you just want the wtxs? You couldn't do anything with a psbt from a fully signed block tx except extract the tx from it that you started with. In the short term perhaps you could add a flag to |
FWIW the patch appears to get CLN past the point in which it would crash previously. Uptime is probably around 48 hours with no crash.
|
The patch works by ensuring that any pegin information is ignored and as a result that all the psbts created from pegins are silently created in an invalid state. As above, this code shouldn't need to create psbts at all, which is both more correct and significantly more efficient I think the psbt creation inside |
Hmm, I'm not sure! It seems that libwally has never supported Peg-in, so I was working under the following assumption, because I do not know how Peg-in works on Liquid 😸
Yes, I believe this is the method that Core Lightning uses to locate the transaction within the block. If the transactions are found, then the PSB is being passed somewhere. I don't remember the code anymore, but I think this is the only situation where using the PSB makes sense. 😄 Also, @lvaccaro pointed out to me that parsing the PSBT while scanning the block might be something I should consider, without resorting to hacky code to solve crashes Thanks for testing @grubles I was able also to sync liquid without any problem! but I am not happy with this solution is hacky |
Right. I don't see that any relevant-to-cln txs will ever have pegin information present. So the correct fix here is:
|
Please see #6983 which attempts my suggested fix above. |
This patch is proposing a temporary patch for elements, some of our users try to use elements and get the stack trace on the bottom.
The crash happens because the
psbt_input_from_tx_input_pegin
is called and libwally do not support the PEGIN tx feature. This patch removes the PEGIN feature because cln should not care about this kind of transaction. I am not sure about this change so this requires more eyes.Fixes #6955