-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Improve prioritisetransaction test coverage #12079
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
|
src/rpc/mining.cpp
Outdated
@@ -249,8 +249,6 @@ UniValue prioritisetransaction(const JSONRPCRequest& request) | |||
+ HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000") | |||
); | |||
|
|||
LOCK(cs_main); |
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.
Why is this being removed? It's not obvious to me that this wouldn't result in some kind of race with AcceptToMemoryPool.
Generally I think of cs_main as required to make any changes to the mempool, while mempool.cs is sufficient for read-only access to the mempool... PrioritiseTransaction
changes the mempool (re-sorting it), though I guess doesn't add or remove anything -- so it's not clear to me whether this would be problematic or not, with our current code. But it seems safer to me to not remove the lock here, because even if there's no race condition now, it seems like it could result in a future bug.
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 I can remove that commit, it's not entirely related to this PR. I guess it can be revisited later after annotations are in place.
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.
Done.
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.
I'd prefer if we document such assumptions in the code. Preferably with a clang static annotation but maybe also with a short description about the locking requirements for that method/class, if needed.
416826c
to
7f67dd0
Compare
utACK |
utACK 7f67dd0 |
7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
Summary: 7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86 Backport of Core [[bitcoin/bitcoin#12079 | PR12079]] bitcoin/bitcoin#12079 Test Plan: test_runner.py mining_prioritisetransaction Reviewers: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D5292
7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
No description provided.