Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
glozow
left a comment
There was a problem hiding this comment.
concept ACK thanks! Maybe p2p_invalid_tx.py would be a good file but no strong opinion
e9122b7 to
27a5a5f
Compare
|
This PR is based on #29735 now in order to take use of the |
|
concept ack, will review once parent PR is merged |
27a5a5f to
cdc8283
Compare
glozow
left a comment
There was a problem hiding this comment.
CI failure looks related to the lines added here (I haven't debugged though)
0c3dca4 to
01b17b6
Compare
instagibbs
left a comment
There was a problem hiding this comment.
ACK 01b17b62cbeb168629d17eb2a54d547628e16759
There was a problem hiding this comment.
is this strictly necessary since the mempool is empty?
fine to me to add as belt and suspenders either way
There was a problem hiding this comment.
is this strictly necessary since the mempool is empty?
Good point. Without that change the test fails, but not for the reason I thought it does. I think the problem is that MiniWallet is not aware of restarts between nodes and still holds mempool UTXOs that it tries to spend. Will force-push in a bit with a fix that does a self.wallet.rescan_utxos() after restarts, which should tackle the problem as the root.
There was a problem hiding this comment.
micro-nit: this line can be removed safely now 🥳
Co-authored-by: Sebastian Falbesoner <[email protected]>
01b17b6 to
433cdbf
Compare
433cdbf to
60ca5d5
Compare
|
ACK 60ca5d5 🍳 Show signatureSignature: |
instagibbs
left a comment
There was a problem hiding this comment.
ACK 60ca5d5
please don't feel obligated to touch due to nit
There was a problem hiding this comment.
micro-nit: this line can be removed safely now 🥳
…c (`m_recent_rejects` filter) 60ca5d5 test: p2p: add test for rejected tx request logic (`m_recent_rejects` filter) (Sebastian Falbesoner) e9dc511 fixup: get all utxos up front in fill_mempool, discourage wallet mixing (glozow) Pull request description: Motivated by the discussion in bitcoin#28970 (bitcoin#28970 (comment)), this PR adds test coverage for the logic around the `m_recent_rejects` filter, in particular that the filter is cleared after a new block comes in: https://github.com/bitcoin/bitcoin/blob/f0794cbd405636a7f528a60f2873050b865cf7e8/src/net_processing.cpp#L2199-L2206 As expected, the second part of the test fails if the following patch is applied: ```diff diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6996af3..5cb1090e70 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2202,7 +2202,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid) // or a double-spend. Reset the rejects filter and give those // txs a second chance. hashRecentRejectsChainTip = m_chainman.ActiveChain().Tip()->GetBlockHash(); - m_recent_rejects.reset(); + //m_recent_rejects.reset(); } const uint256& hash = gtxid.GetHash(); ``` I'm still not sure in which file this test fits best, and if there is already test coverage for the first part of the test somewhere. Happy for any suggestions. ACKs for top commit: maflcko: ACK 60ca5d5 🍳 glozow: code review ACK 60ca5d5 instagibbs: ACK 60ca5d5 Tree-SHA512: 9cab43858e8f84db04a708151e6775c9cfc68c20ff53096220eac0b2c406f31aaf9223e8e04be345e95bf0a3f6dd15efac50b0ebeb1582a48a4560b3ab0bcba5
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
merged, I think there is a github error 67c0d93 |
|
Seeing a failure of this test in my other PR, though I can't make heads or tails of the failure: https://cirrus-ci.com/task/6740372997537792 |
| # the next trickle relay event happens. | ||
| for test in [self.test_in_flight_max, self.test_inv_block, self.test_tx_requests]: | ||
| for test in [self.test_in_flight_max, self.test_inv_block, self.test_tx_requests, | ||
| self.test_rejects_filter_reset]: |
There was a problem hiding this comment.
Putting this here will spin up NUM_INBOUND * self.num_nodes, which seems confusing, because they are not needed.
Also, it will cause the test thread to sync all generated blocks, blocking shutdown, and causing intermittent test failures.
Fixed in #29933
…ng, use in `fill_mempool` dd8fa86 test: use tagged ephemeral MiniWallet instance in fill_mempool (Sebastian Falbesoner) b2037ad test: add MiniWallet tagging support to avoid UTXO mixing (Sebastian Falbesoner) c8e6d08 test: refactor: eliminate COINBASE_MATURITY magic number in fill_mempool (Sebastian Falbesoner) 4f34714 test: refactor: move fill_mempool to new module mempool_util (Sebastian Falbesoner) Pull request description: Different MiniWallet instances using the same mode (either ADDRESS_OP_TRUE, RAW_OP_TRUE or RAW_P2PK) currently always create and spend UTXOs with identical output scripts, which can cause unintentional tx dependencies (see e.g. the discussion in #29827 (comment)). In order to avoid mixing of UTXOs between instances, this PR introduces the possibility to provide a MiniWallet tag name, that is used to derive a different internal key for the taproot construction, leading to a different P2TR output script. Note that since we use script-path spending and only the key-path is changed here, no changes in the MiniWallet spending logic are needed. The new tagging option is then used in the `fill_mempool` helper to create an ephemeral wallet for the filling txs, as suggested in #29827 (comment). To avoid circular dependencies, `fill_mempool` is moved to a new module `mempool_util.py` first. I'm still not sure if a generic word like "tag" is the right term for what this tries to achieve, happy to pick up better suggestions. Also, maybe passing a tag name is overkill and a boolean flag like "random_output_script" is sufficient? ACKs for top commit: glozow: ACK dd8fa86 achow101: ACK dd8fa86 rkrux: tACK [dd8fa86](dd8fa86) brunoerg: utACK dd8fa86 Tree-SHA512: 5ef3558c3ef5ac32cfa79c8f751972ca6bceaa332cd7daac7e93412a88e30dec472cb041c0845b04abf8a317036d31ebddfc3234e609ed442417894c2bdeeac9
Motivated by the discussion in #28970 (#28970 (comment)), this PR adds test coverage for the logic around the
m_recent_rejectsfilter, in particular that the filter is cleared after a new block comes in:bitcoin/src/net_processing.cpp
Lines 2199 to 2206 in f0794cb
As expected, the second part of the test fails if the following patch is applied:
I'm still not sure in which file this test fits best, and if there is already test coverage for the first part of the test somewhere. Happy for any suggestions.