log: Properly log txs rejected from mempool#18990
Merged
maflcko merged 1 commit intobitcoin:masterfrom Jul 14, 2020
Merged
Conversation
Contributor
|
utACK fa9f20b |
luke-jr
reviewed
Jun 2, 2020
| 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, |
Member
There was a problem hiding this comment.
Is this something we want to log the peer for?
Contributor
There was a problem hiding this comment.
yes (and we already do, in the MaybePunishNodeForTx() call)
Contributor
|
Concept ACK. Compiled and ran tests. |
Contributor
|
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. |
Contributor
|
code review ACK fa9f20b |
Member
Author
|
re-run ci |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Jul 14, 2020
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
deadalnix
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Aug 31, 2021
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.