-
Notifications
You must be signed in to change notification settings - Fork 38.7k
log: Properly log txs rejected from mempool #18990
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
Conversation
|
utACK fa9f20b |
| LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s\n", orphanHash.ToString()); | ||
| LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s from peer=%d. %s\n", | ||
| orphanHash.ToString(), | ||
| fromPeer, |
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.
Is this something we want to log the peer for?
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.
yes (and we already do, in the MaybePunishNodeForTx() call)
|
Concept ACK. Compiled and ran tests. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
code review ACK fa9f20b |
|
re-run ci |
fa9f20b log: Properly log txs rejected from mempool (MarcoFalke) Pull request description: Currently `CheckTxInputs` rejections from the mempool are the only rejections that log directly and unconditionally to debug.log instead of leaving it to the caller. This has multiple issues: * A rejected RPC transaction will log a redundant failure reason to debug log. All other failures are merely reported to the RPC user. * A rejected p2p transaction will log the failure twice. Once with the `MEMPOOLREJ` flag, and once unconditionally. * A rejected orphan transaction will log no failure. Fix all issues by simply returning the state to the caller, like it is done for all other rejections. The patch includes whitespace fixups to highlight relevant parts of the codebase and simplify review. ACKs for top commit: naumenkogs: utACK fa9f20b rajarshimaitra: Concept ACK. Compiled and ran tests. `fa9f20b` jnewbery: code review ACK fa9f20b Tree-SHA512: 86cc17b2a9239c01c4fc3f254ad48ee1d3883266966b9811030176338b9ac3deaea7ea5babfb8bbf739d7440154e30011fede8f9313175f199d4a062af6494f7
Summary: > Currently CheckTxInputs rejections from the mempool are the only rejections that log directly and unconditionally to debug.log instead of leaving it to the caller. This has multiple issues: > > - A rejected RPC transaction will log a redundant failure reason to debug log. All other failures are merely reported to the RPC user. > - A rejected p2p transaction will log the failure twice. Once with the MEMPOOLREJ flag, and once unconditionally. > - A rejected orphan transaction will log no failure. > > Fix all issues by simply returning the state to the caller, like it is done for all other rejections. This is a backport of [[bitcoin/bitcoin#18990 | core#18990]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D9996
Currently
CheckTxInputsrejections from the mempool are the only rejections that log directly and unconditionally to debug.log instead of leaving it to the caller. This has multiple issues:MEMPOOLREJflag, and once unconditionally.Fix all issues by simply returning the state to the caller, like it is done for all other rejections.
The patch includes whitespace fixups to highlight relevant parts of the codebase and simplify review.