-
Notifications
You must be signed in to change notification settings - Fork 37.7k
add unit tests for RBF rules in isolation #25674
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
Concept ACK and code looks good on first read.
|
b707bfe
to
645c593
Compare
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.
crACK 645c593
Just a few improvements suggested
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. |
645c593
to
433411a
Compare
reACK 433411a |
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.
Concept ACK
433411a
to
520657a
Compare
Concept ACK, will review soon |
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 520657a
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.
Still looking at this but seeing tests green with very different values for low_fee
and normal_fee
and high_fee
. Only when low_fee
> high_fee
do I start to see some red (which may make sense given the RBF rules, but then maybe use test values that highlight the minimum necessary value deltas). The tests pass with these values, for instance:
- const CAmount low_fee{100};
- const CAmount normal_fee{10000};
- const CAmount high_fee{1 * COIN};
+ const CAmount low_fee{1000000};
+ const CAmount normal_fee{100};
+ const CAmount high_fee{1000000};
Various minor comments follow, feel free to pick/choose/ignore.
@@ -117,6 +117,7 @@ BITCOIN_TESTS =\ | |||
test/prevector_tests.cpp \ | |||
test/raii_event_tests.cpp \ | |||
test/random_tests.cpp \ | |||
test/rbf_tests.cpp \ |
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.
Optional, feel free to ignore, maybe add this file to the RUN_TIDY include-what-you-use list in ci/test/06_script_b.sh
and update the headers with any relevant suggestions in the tidy CI output.
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 520657a
The fees should now be 10x apart each, so hopefully less arbitrary. Also, apologies for the confusion, I should have mentioned that I pulled this out of #25038 which includes a new check for ancestor feerate. The low-high fees are essentially CPFPs and make a significant difference there, but are largely ignored in the current rules (hence all the "notice how ancestor feerate is not checked here" test cases in this PR). There's probably still room to make the values tighter, but hopefully this background helps. |
520657a
to
2a29c84
Compare
Test each component of the RBF policy in isolation. Unlike the RBF functional tests, these do not rely on things like RPC results, mempool submission, etc.
2a29c84
to
c320cdd
Compare
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 c320cdd
reACK c320cdd |
This has 3 ACKs (thanks @w0xlt, @instagibbs, @jonatack) and the previous state had 2 other ACKs (thanks @darosior, @t-bast). This PR is just adding test coverage and doesn't conflict with anything other than my draft PR it's pulled out from. As such, it seems there is sufficient review to merge even though I am the author. |
c320cdd [unit tests] individual RBF Rules in isolation (glozow) Pull request description: Test each RBF rule more thoroughly and in isolation so we're not relying on things like overall mempool acceptance logic, ordering of mempool checks, RPC results, etc. RBF was pretty recently refactored out, so there isn't much unit test coverage. From https://marcofalke.github.io/btc_cov/test_bitcoin.coverage/src/policy/rbf.cpp.gcov.html:  ACKs for top commit: instagibbs: reACK bitcoin@c320cdd jonatack: ACK c320cdd w0xlt: ACK bitcoin@c320cdd Tree-SHA512: dab555214496255801b9ea92b7bf708bba1ff23edf055c85e29be5eab7d7a863440ee19588aacdce54b2c03feaa4b5963eb159ed89473560bd228737cbfec160
It seems review was insufficient. Adding wrong or low quality test coverage could lead to things not being tested but assumed to be tested. |
49db42c [test] make tx6 child of tx5, not tx3, in rbf_tests (glozow) Pull request description: A small overlooked oopsie from #25674. There is no effect on the test results because tx3 and tx5 pay the same fee, but this was the intended configuration, as the comment suggests. ACKs for top commit: instagibbs: ACK 49db42c darosior: Github diff ACK 49db42c. Should have catched this. :/ Tree-SHA512: 2f54337ac3edc38707115cde5b466a85b8a6ac0a0a507effa0e9fecb12c9be196ecd1b16702bc23ba617cfb6a3b5db27d3b71616b3c2dadb186c699c4609831e
49db42c [test] make tx6 child of tx5, not tx3, in rbf_tests (glozow) Pull request description: A small overlooked oopsie from bitcoin#25674. There is no effect on the test results because tx3 and tx5 pay the same fee, but this was the intended configuration, as the comment suggests. ACKs for top commit: instagibbs: ACK bitcoin@49db42c darosior: Github diff ACK 49db42c. Should have catched this. :/ Tree-SHA512: 2f54337ac3edc38707115cde5b466a85b8a6ac0a0a507effa0e9fecb12c9be196ecd1b16702bc23ba617cfb6a3b5db27d3b71616b3c2dadb186c699c4609831e
Test each RBF rule more thoroughly and in isolation so we're not relying on things like overall mempool acceptance logic, ordering of mempool checks, RPC results, etc.
RBF was pretty recently refactored out, so there isn't much unit test coverage. From https://marcofalke.github.io/btc_cov/test_bitcoin.coverage/src/policy/rbf.cpp.gcov.html:
