-
Notifications
You must be signed in to change notification settings - Fork 879
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
bitcoind: bad-txns-inputs-missingorspent on sendrawtransaction #7172
Labels
Comments
vincenzopalazzo
added a commit
to vincenzopalazzo/lightning
that referenced
this issue
May 7, 2024
Working to fix the following issue error: {\\\"code\\\":-25,\\\"message\\\":\\\"bad-txns-inputs-missingorspent\\\"}\") }) 2024-03-25T14:05:44.178Z DEBUG lightningd: Expected error broadcasting tx 020000000001018c9e9f69341019c959b5526231e2bd52bd1e7227a3b72fa40e095ed283b7ddbb0000000000cae9f0800199c20000000000002200203251c1d74d76a6a487afca13913bc09fb3cc766e12efe938c049a1c432316bcf040047304402201a96b84a9e234172ade0f055be867097ac480c2d21f8163f449bde67266dda15022060fe38faed61d573db32ab5d48a3a9eff1f9e27f7adc51e86cb7b22878aad66a014730440220764c985c44e8ae0e303c46588090dea100c997b42ba9bdec7fa66bc68f5cc1fe02205200f62950b4ac4d8a297a97bb30fdc92edd43f5fccaf35b31a46e6963f42f4d0147522102b7c0c24f0a4ed6880289c17132f63c7a9ace2db1dfbc0baaf03a19916cfc867e210382323ae01328ab397c250a3120567531e76970a8c88795cac03e488dafe81b4252ae8ea0b720: [400] Unknown error (sendrawtransaction RPC error: {\"code\":-25,\"message\":\"bad-txns-inputs-missingorspent\"}) The problem is that my database is marking the ouputs with state AVAILABLE but they are spent, so we should look at the spend height and just mark with a spent status, but due that we can have other kind of status inside the database, it is better that we make a double check with an external explorer. This PR add the necessary RPC methods to fix the issue. Link: ElementsProject#7172 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This was referenced May 7, 2024
vincenzopalazzo
added a commit
to vincenzopalazzo/lightning
that referenced
this issue
May 8, 2024
This PR should be title "Never assume that some shit works". Thanks for @niftynei that wake up me and said "Hey this is a DB shit", and thanks to @rustyrussell to waste 20 minutes debugging my problem. But now, back to the patch description ---- Working to fix the following issue ``` error: {\\\"code\\\":-25,\\\"message\\\":\\\"bad-txns-inputs-missingorspent\\\"}\") }) 2024-03-25T14:05:44.178Z DEBUG lightningd: Expected error broadcasting tx 020000000001018c9e9f69341019c959b5526231e2bd52bd1e7227a3b72fa40e095ed283b7ddbb0000000000cae9f0800199c20000000000002200203251c1d74d76a6a487afca13913bc09fb3cc766e12efe938c049a1c432316bcf040047304402201a96b84a9e234172ade0f055be867097ac480c2d21f8163f449bde67266dda15022060fe38faed61d573db32ab5d48a3a9eff1f9e27f7adc51e86cb7b22878aad66a014730440220764c985c44e8ae0e303c46588090dea100c997b42ba9bdec7fa66bc68f5cc1fe02205200f62950b4ac4d8a297a97bb30fdc92edd43f5fccaf35b31a46e6963f42f4d0147522102b7c0c24f0a4ed6880289c17132f63c7a9ace2db1dfbc0baaf03a19916cfc867e210382323ae01328ab397c250a3120567531e76970a8c88795cac03e488dafe81b4252ae8ea0b720: [400] Unknown error (sendrawtransaction RPC error: {\"code\":-25,\"message\":\"bad-txns-inputs-missingorspent\"}) ``` The issue is that my database is incorrectly marking outputs as AVAILABLE when they have actually been spent. Therefore, we should verify the spend height and appropriately label them as spent. This change will help ensure that we correctly identify the status of each UTXO. Is it certain that the UTXO is spent? Is the current status incorrect? There might also be a chance that the status is correct. To confirm, we should double-check against an external explorer. To avoid adding an extra bitcoin core call just for this, I am adding a new dangerous dev method that will help to fix this problem, and I implemented the recovery strategy in folgore [1] This PR adds the necessary RPC methods to fix the issue. [1] coffee-tools/folgore@6215861 Link: ElementsProject#7172 Co-Developed-by: Rusty Russell <rusty@rustcorp.com.au> Co-Developer-by: @niftynei Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
added a commit
to vincenzopalazzo/lightning
that referenced
this issue
May 17, 2024
This PR should be title "Never assume that some shit works". Thanks for @niftynei that wake up me and said "Hey this is a DB shit", and thanks to @rustyrussell to waste 20 minutes debugging my problem. But now, back to the patch description ---- Working to fix the following issue ``` error: {\\\"code\\\":-25,\\\"message\\\":\\\"bad-txns-inputs-missingorspent\\\"}\") }) 2024-03-25T14:05:44.178Z DEBUG lightningd: Expected error broadcasting tx 020000000001018c9e9f69341019c959b5526231e2bd52bd1e7227a3b72fa40e095ed283b7ddbb0000000000cae9f0800199c20000000000002200203251c1d74d76a6a487afca13913bc09fb3cc766e12efe938c049a1c432316bcf040047304402201a96b84a9e234172ade0f055be867097ac480c2d21f8163f449bde67266dda15022060fe38faed61d573db32ab5d48a3a9eff1f9e27f7adc51e86cb7b22878aad66a014730440220764c985c44e8ae0e303c46588090dea100c997b42ba9bdec7fa66bc68f5cc1fe02205200f62950b4ac4d8a297a97bb30fdc92edd43f5fccaf35b31a46e6963f42f4d0147522102b7c0c24f0a4ed6880289c17132f63c7a9ace2db1dfbc0baaf03a19916cfc867e210382323ae01328ab397c250a3120567531e76970a8c88795cac03e488dafe81b4252ae8ea0b720: [400] Unknown error (sendrawtransaction RPC error: {\"code\":-25,\"message\":\"bad-txns-inputs-missingorspent\"}) ``` The issue is that my database is incorrectly marking outputs as AVAILABLE when they have actually been spent. Therefore, we should verify the spend height and appropriately label them as spent. This change will help ensure that we correctly identify the status of each UTXO. Is it certain that the UTXO is spent? Is the current status incorrect? There might also be a chance that the status is correct. To confirm, we should double-check against an external explorer. To avoid adding an extra bitcoin core call just for this, I am adding a new dangerous dev method that will help to fix this problem, and I implemented the recovery strategy in folgore [1] This PR adds the necessary RPC methods to fix the issue. [1] coffee-tools/folgore@6215861 Link: ElementsProject#7172 Co-Developed-by: Rusty Russell <rusty@rustcorp.com.au> Co-Developer-by: @niftynei Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
It literally says that this failure is expected because we are sending a conflicting commitment tx to the peers close. |
Well not quite, this problem was because the wallet of cln is tracking spent tx and it is putting inside the funding transaction. So this is a bug of our dev- commands that need to be fixed somehow, I think I provided some idea in here vincenzopalazzo@6e2ab02 |
vincenzopalazzo
added a commit
to vincenzopalazzo/lightning
that referenced
this issue
Jun 18, 2024
This PR should be title "Never assume that some shit works". Thanks for @niftynei that wake up me and said "Hey this is a DB shit", and thanks to @rustyrussell to waste 20 minutes debugging my problem. But now, back to the patch description ---- Working to fix the following issue ``` error: {\\\"code\\\":-25,\\\"message\\\":\\\"bad-txns-inputs-missingorspent\\\"}\") }) 2024-03-25T14:05:44.178Z DEBUG lightningd: Expected error broadcasting tx 020000000001018c9e9f69341019c959b5526231e2bd52bd1e7227a3b72fa40e095ed283b7ddbb0000000000cae9f0800199c20000000000002200203251c1d74d76a6a487afca13913bc09fb3cc766e12efe938c049a1c432316bcf040047304402201a96b84a9e234172ade0f055be867097ac480c2d21f8163f449bde67266dda15022060fe38faed61d573db32ab5d48a3a9eff1f9e27f7adc51e86cb7b22878aad66a014730440220764c985c44e8ae0e303c46588090dea100c997b42ba9bdec7fa66bc68f5cc1fe02205200f62950b4ac4d8a297a97bb30fdc92edd43f5fccaf35b31a46e6963f42f4d0147522102b7c0c24f0a4ed6880289c17132f63c7a9ace2db1dfbc0baaf03a19916cfc867e210382323ae01328ab397c250a3120567531e76970a8c88795cac03e488dafe81b4252ae8ea0b720: [400] Unknown error (sendrawtransaction RPC error: {\"code\":-25,\"message\":\"bad-txns-inputs-missingorspent\"}) ``` The issue is that my database is incorrectly marking outputs as AVAILABLE when they have actually been spent. Therefore, we should verify the spend height and appropriately label them as spent. This change will help ensure that we correctly identify the status of each UTXO. Is it certain that the UTXO is spent? Is the current status incorrect? There might also be a chance that the status is correct. To confirm, we should double-check against an external explorer. To avoid adding an extra bitcoin core call just for this, I am adding a new dangerous dev method that will help to fix this problem, and I implemented the recovery strategy in folgore [1] This PR adds the necessary RPC methods to fix the issue. [1] coffee-tools/folgore@6215861 Link: ElementsProject#7172 Co-Developed-by: Rusty Russell <rusty@rustcorp.com.au> Co-Developer-by: @niftynei Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did not debug how this is possible but it is better to store this error somewhere
The text was updated successfully, but these errors were encountered: