-
Notifications
You must be signed in to change notification settings - Fork 725
[Refactoring] CValidationState logging #1670
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
[Refactoring] CValidationState logging #1670
Conversation
f128da2 to
281cb2d
Compare
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!, liked it a lot. code review ACK 10cba02 . Can be merged at any time for me.
10cba02 to
8b375c7
Compare
|
Rebased on master due to conflicts after merging #1673 |
- backports bitcoin/bitcoin@fbf44e6 Add a field `strDebugMessage` which can be passed to DoS or Invalid, and queried using GetDebugMessage() to add extra troubleshooting information to the validation state.
- backports bitcoin/bitcoin@dc58258 Add status codes specific to AcceptToMempool procession of transactions. These can never happen due to block validation, and must never be sent over the P2P network. Add assertions where appropriate.
- backports bitcoin/bitcoin@9003c7c It is necessary to be able to concisely log a validation state. Convert CValidationState to a human-readable message for logging.
- backports bitcoin/bitcoin@6cab808 Remove unnecessary direct logging in CheckTransaction, AcceptToMemoryPool, CheckTxInputs, CScriptCheck::operator() All status information should be returned in the CValidationState. Relevant debug information is also added to the CValidationState using the recently introduced debug message. Do keep the "BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags" error as it is meant to appear as bug in the log.
- backports bitcoin/bitcoin@66daed5 Add detailed state information to the errors, as it is no longer being logged downstream. Also add the state information to mempool rejection debug message in ProcessMessages.
Move mempool rejections to debug category `mempoolrej`, to make it possible to show them without enabling the entire category `mempool` which is high volume.
8b375c7 to
ca489c9
Compare
|
Rebased again due to conflicts with #1668 just merged. |
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ca489c9
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re ACK ca489c9 and merging
a0de4da [Wallet] Abandon tx in CommitTransaction if ATMP fails (random-zebra) f3e07f7 Expose FormatStateMessage (Alex Morcos) Pull request description: This is an alternative to #1664. It takes the opposite approach. When ATMP fails in `CommitTransaction`, instead of just returning the txid (hoping that the failure is not permanent) try to directly abandon the transaction. Save the result of these operations in a new struct `CWallet::CommitResult`, and use it to give a detailed feedback to the user (via log lines, JSON-RPC errors and GUI dialogs). Based on top of: - [x] #1670 This PR also cherry-picks 5f12263 from bitcoin#6898, in order to use `FormatStateMessage` outside of main. ACKs for top commit: furszy: ACK a0de4da Fuzzbawls: ACK a0de4da Tree-SHA512: 5ae372f97eeed017002628646eee3f559af6dc488e1b24541b29f5ce763412fb569e057933468fc828a2aec3f2c17e2d818130b72d41c73524cfa90680877d23
CValidationState::chRejectCodeto intCValidationState::strDebugMessagefor optional informationFormatStateMessagefunction to convert CValidationState to a human-readable messageCheckTransaction,AcceptToMemoryPool,CheckTxInputs,CScriptCheck::operator()CheckBlockandConnectBlockBackported from: