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

Debug.log file Flooding (low impact) #71

Open
MarcelusCH opened this issue Oct 19, 2022 · 3 comments
Open

Debug.log file Flooding (low impact) #71

MarcelusCH opened this issue Oct 19, 2022 · 3 comments

Comments

@MarcelusCH
Copy link
Member

By the node version 2.0.7-10 we added the possibility to add an OP code with an Hex encoded string in the transactions that also give an unexpected output format if it is used. This unexpected output format is OP_RETURN _<HEX-STRING>_ .

This was added in the Raw Transaction class:

if (name_ == "data") {

An example of the Raw DATA can be found in this transaction :
https://explorer.btcz.app/tx/b8b29ff7f76e40d01990fad1a8d51d830a66c9f533c3b1768f78fcaf26888ef4

Now, when the Insight option is activated, the node try to find the spent index information about this OP_RETURN code that are not existing as the spent amount is zero (0). And this trigger an error in the debug.log file for each Raw DATA.

Error in the log file for Insight : ERROR: Unable to get spent index information
Triggered here:

return error("Unable to get spent index information");

Also a similar error happen in the wallet functions.
Error for the Wallet functions : CWalletTx::GetAmounts: Unknown transaction type found, txid <The_TX_ID>
Triggered here:

LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",

After some time, the log is flooded by this badly returned error information's !

The solution is to check if the output is encoded as usually, with an OP_DUP OP_HASH160 scriptPubKey, or with an Raw DATA field with OP_RETURN . This should be done before calling the function that trigger the error. A check could also be done just before the error is triggered but I guess this will probably have an affect on the performance.

@MarcelusCH MarcelusCH added the bug label Oct 19, 2022
MarcelusCH added a commit to MarcelusCH/bitcoinz that referenced this issue Oct 19, 2022
@MarcelusCH MarcelusCH mentioned this issue Oct 19, 2022
@MarcelusCH
Copy link
Member Author

MarcelusCH commented Oct 20, 2022

The issue in the wallet class can be fixed easely by adding a check : TX_NULL_DATA

In the main class, a check should be added and awoid error return only if the fInsightExplorer param is active. But this will not resolve the log flooding in every case. Also it's needed to find a way to check the OP code.

(See draft PR)

MarcelusCH added a commit to MarcelusCH/bitcoinz that referenced this issue Oct 21, 2022
@MarcelusCH MarcelusCH linked a pull request Oct 21, 2022 that will close this issue
@cryptorex
Copy link
Member

@MarcelusCH thanks for the write up - I've yet to test, but hope to get to it this week!

MarcelusCH added a commit to MarcelusCH/bitcoinz that referenced this issue Nov 11, 2022
MarcelusCH added a commit to MarcelusCH/bitcoinz that referenced this issue Dec 3, 2022
@rfsales
Copy link

rfsales commented Nov 28, 2023

same issue

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

Successfully merging a pull request may close this issue.

3 participants