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
AcceptMultipleTransactions: Fix workspace not being set as client_maxfeerate failure #29735
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. 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. |
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, verified that on master the test fails since the individual result wasn't populated and is "Valid"
5ae4dce
to
4f8407c
Compare
Added some fuzz coverage which would have likely caught this edit: yep, 3 minutes: |
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.
Sorry for the nits, still need to run the fuzzer but otherwise lgtm
b057d2b
to
14c86ba
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 14c86ba
Verified the fuzz test catches this problem, seems to run fine with the changes. Thanks for accepting the suggestions.
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 14c86ba with nits.
test_framework.generate(miniwallet, 1 + (num_of_batches * tx_batch_size)) | ||
|
||
# Mine 99 blocks so that the UTXOs are allowed to be spent | ||
test_framework.generate(node, 99) |
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.
In "Move fill_mempool to util function" (cc770e4):
Nit: If a commit is described as a move, I would expect no changes in the code beyond what’s necessary to update the callsites. While these changes are minor and obviously do not entail a functional change, I would have expected the updated commentary and refactor to be a separate commit—I’m wondering whether my understanding of the modus operandi is correct.
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.
split out the moving and docstring changes, should be minimal now?
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.
Nit: I don’t feel strongly about it, but the change that made me notice that there were code changes in the move originally was that COINBASE_MATURITY - 1
had gotten replaced with a 99
magic number.
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.
bit of an annoying circular reference issue(blocktools requiring utils) so for now at least make it grep-able what the magic value should be(and more greppable)
14c86ba
to
1d79aab
Compare
1d79aab
to
052c67d
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 052c67d
Please feel free to ignore nits
test_framework.generate(miniwallet, 1 + (num_of_batches * tx_batch_size)) | ||
|
||
# Mine 99 blocks so that the UTXOs are allowed to be spent | ||
test_framework.generate(node, 99) |
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.
Nit: I don’t feel strongly about it, but the change that made me notice that there were code changes in the move originally was that COINBASE_MATURITY - 1
had gotten replaced with a 99
magic number.
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
I will run the new fuzz test with and without 72425bd
"""Fill mempool until eviction.""" | ||
"""Fill mempool until eviction. | ||
|
||
Allows for simpler testing of scenarios with floating minfee > minrelay |
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.
In a466686 "test: expand docstring to fill_mempool"
nit:
Allows for simpler testing of scenarios with floating minfee > minrelay | |
Allows for simpler testing of scenarios with floating mempoolminfee > minrelayfee |
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
# And 1 more to verify that this tx does not get added to the mempool with a fee rate less than the mempoolminfee | ||
# And 2 more for the package cpfp test |
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.
In c93f790 " Move fill_mempool to util function"
There should be a commit that will first pull out these two lines from this scope to
bitcoin/test/functional/mempool_limit.py
Line 231 in f0794cb
Moving fill_mempool
to test_framework/util.py
makes it clear that the comments do not belong to this scope.
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, I think
It will not ensure mempools become synced as it | ||
is based on a single node and assumes -minrelaytxfee | ||
is 1 sat/vbyte. |
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.
Maybe assert for this at the beginning of the fill_mempool
assert_equal(node.getnetworkinfo()['relayfee'], Decimal('0.00001000'))
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.
looking at this again, what do you think about just restarting the node with the -datacarriersize=100000
, -maxmempool=5
, -minrelaytxfee=0.00001000
after filling the mempool we then restart the node with default node settings?
Are there any advantage of delegating setting this to the caller?
If not then this will reduce duplication of all callers of fill_mempool
settings this values.
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.
We can't restart the node after filling the memopool without resetting the floating minfee.
I could pull in the initial restart if we knew people didn't want any other extra_args.
Alternatively I could assert that datacarrier and maxmempool is set in extra_args?
I think documentation is enough for now, leaving as is.
4aa47e7
to
4fe7d15
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 4fe7d15
I've reviewed 73b68....4fe7d15
I've Ran the fuzz test without f28338b
And verified the crash
Test unit written to ./crash-7fd49c80d3088f672b4bf03ab8a1d7f1aedff0aa
Base64: q6sAIqsA/6sACQCrAAAAANr/+zUBAQENASUABAB5aKqgnQAAAAAlKv8tATUBAQENASUABAB5aKqgnQAAAAAluQAAAMP3AAAAAasAAAAAAAAA2v/7Kv8tATYBAQENASUABAB0aKKgle/f/wAA
I ran functional tests and rpc_packages.py
failed.
I then cherry-picked the patch f28338b and run the fuzz test again, it passed successfully.
INFO: seed corpus: files: 728 min: 1b max: 617355b total: 10276044b rss: 232Mb
#128 pulse cov: 10579 ft: 39305 corp: 108/4319b exec/s: 64 rss: 260Mb
#512 pulse cov: 11879 ft: 55511 corp: 356/67Kb exec/s: 36 rss: 283Mb
#925 INITED cov: 12041 ft: 66449 corp: 523/8522Kb exec/s: 20 rss: 550Mb
#925 DONE cov: 12041 ft: 66449 corp: 523/8522Kb lim: 617355 exec/s: 20 rss: 550Mb
Done 925 runs in 46 second(s)
Functional tests are also passing
test/functional/rpc_packages.py
Outdated
assert child["txid"] not in node.getrawmempool() | ||
|
||
# Reset maxmempool, datacarriersize, ,reset dynamic mempool minimum feerate, and empty mempool. | ||
self.restart_node(0, extra_args=["-persistmempool=0"]) |
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.
This should be in the extra args above to avoid writing mempool.dat.
Currently the test is fine, but this is because the new datacarriersize causes all the transactions to be rejected.
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.
moved and added assertion of empty mempool after restart
If we do not set the Failure for the workspace when there is a client_maxfeerate related error, we hit an Assume() to the contrary. Properly set it.
4fe7d15
to
4ba1d0b
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.
reACK 4ba1d0b
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 4ba1d0b
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.
Bug causes an
Assume()
failure due to the expectation that the individual result should be invalid when done oversubmitpackage
via rpc.Bug introduced by #28950 , and I discovered it rebasing #28984 since it's easier to hit in that test scenario.
Tests in place were only checking
AcceptSingleTransaction
-level checks due to package evaluation only triggering when minfee is too high for the parent transaction.Added test along with fix, moving the fill_mempool utility into a common area for re-use.