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
test: Use MiniWallet in mempool_limit.py #22543
test: Use MiniWallet in mempool_limit.py #22543
Conversation
0acb21e
to
8ac10d8
Compare
approach ACK :) |
Concept ACK |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
Concept ACK |
78de7bf
to
4beb43c
Compare
Concept ACK |
1 similar comment
Concept ACK |
4cc1c96
to
a2e4555
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.
Concept and Approach ACK and Tested dcd75d8
Checked that:
- Running
test/functional/mempool_limit.py
after compiling bitcoin core from source with--disable-wallet
leads to Test Skips:Test Skipped: wallet has not been compiled.
- Running the same test with the same flag with the PR paches now successfully runs the tests:
Tests successful
Just had a few comments to add :)
dcd75d8
to
c6b17eb
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.
tACK dcd75d8
tested on Ubuntu 20.04
On Master Branch:
$ time ./test/functional/mempool_limit.py
...
real 0m17.054s
user 0m3.117s
sys 0m0.515s
On PR Branch:
$ time ./test/functional/mempool_limit.py
...
real 0m7.905s
user 0m2.777s
sys 0m0.139s
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 and Approach ACK and Tested c6b17eb
Compiled Bitcoin core with this PR patch and --disable-wallet flag and ran the test/functional/mempool_limit.py test: Test successful
Compiled Bitcoin core without this PR patch with the same --disable-wallet flag and ran the test: Test Skipped
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 bec7849
Tested it and looks good! A few suggestions
bec7849
to
4a6d379
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.
thanks for taking the suggestion for send_large_transactions
! one small pep8 fix suggested
ACK e8a3ff3 nicely done, happy to see the |
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.
re-ACK e8a3ff3
LGTM 💾
e8a3ff3
to
22c7392
Compare
PR ready for reviewThank you to everybody who has reviewed it. However, the recent suggestions made the PR better and more helpful hence the changes as suggested have been implemented. |
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.
review ACK 22c7392 🍚
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
review ACK 22c73921c5c753c2e97fefbd207b163e610af15 🍚
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUiNiQwAlZ9W+JInYlneTbs9NDBJWdFX+6yy4GyhGTls+oxQZa+f4AM7uNK28ak1
oja9zQn9c/xTfOO3k2C3W6ly0M7aonKgW09++7AWtSGT3vKQmQN0ElvZdPJVH+gb
0aOxetJQrVHxBvwvFmiS2mq9WqmHLMPCOKZ9Rkj/36hMH5ItI/ylkBccqfq3RS/9
1XidxJWmtFVBai2nqmVrRfYIJenpplxDFMJXevMV9oq0iSsC1DL2boB3wBCtp0uY
OGlI1ghPWFO3kACX+oI+ruHIqxGuyA7lChhIs/D+dDckXeyk5rKwtaBPXS08qbuu
wYk71Co0wq2tlj3lI7LsRZwaQ1Zovhhdw2iwPe6Q1KPaRCO9wn7eCtHEenn7gS7v
8CEBAtqaOGL11JBq9IyIGnHfo5cMERUdyeuY0lb34RCsieMoDXlMT9OgBD9JXEhw
hdoJnrBwWZ5T39/gdmmsSJUs5MpF2nP+9Mk2YN5zI+kTRzCIwVPFo15FfOK+HO1z
aUF/Ov9m
=3RiU
-----END PGP SIGNATURE-----
Timestamp of file with hash 668a0177b4b7850b6d72a3a9f719e35848f7d38faaf8b37423b4d77b70903b93 -
lmk if you want this merged or address the nits |
@MarcoFalke the nits have been addressed! PTAL. |
ack |
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 find the git commit breakup a bit confusing - I think the last commit 41fa226 should be merged into the first commit cdf1bf6, because it's cleaning up the code that was introduced in this PR. It makes more sense to just introduce it correctly in the first place- it simplifies review & git blame history in the future.
Also, I'd prefer if the git commit messages were more descriptive & adhered to the conventions of this codebase. For example, I've never seen the prefix feat:
. I used the command git log -S "miniwallet"
to see that most of the miniwallet refactors use the prefix test:
or maybe refactor:
. A more common prefix instead of replace:
or fix:
would probably be style:
. In terms of descriptiveness, commit messages are the most useful when you explain why the change is being made. While this is fine to skip on self-evident changes (like fixing a typo or renaming to node
), the first commit could describe the motivation. If you're interested in learning more, check out https://chris.beams.io/posts/git-commit/.
All that said, I think the code introduced looks reasonable, so review ACK 41fa226. If you decide to clean up the git history, I'm happy to reack- it should not produce a code diff.
Co-authored-by: ShubhamPalriwala <spalriwalau@gmail.com> Co-authored-by: stackman27 <sishirg27@gmail.com> Signed-off-by: ShubhamPalriwala <spalriwalau@gmail.com>
41fa226
to
08634e8
Compare
Thank you for the git suggestions @amitiuttarwar The PR is once again up for review. Hopefully one last time |
ACK 08634e8, only git changes since last push (and one new line). |
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 08634e8 🧉
Thanks for taking the feedback. Looks good now. |
Note that the helper |
@theStack See also #22543 (comment) , where I mentioned in-lining helps. I think we should pick the simplest/shortest code to achieve the goal of creating txs with different fee levels. The feerate doesn't need to be exact for the purposes of mempool eviction. The current code achieves its goal, but improvements are welcome if there are any. |
@MarcoFalke: Sure, but in this case the fee-rate is not just "not exact", but off by several orders of magnitute, considering that the tx's vsize changes from 96 to 67552 vbytes (>700x), and MiniWallet only calculates the fee based on the 96 vbytes. So the value passed to this function is neither really a fee-rate nor an absolute fee, but something weird in-between that has just been increased (by 10x) until the test passes. I tried to increase the clarity of the test in #22972. |
…_limit.py 2600db6 test: fix misleading fee unit in mempool_limit.py (Sebastian Falbesoner) Pull request description: The PR is a follow-up to #22543. The helper `send_large_txs` in its current interface has a fee_rate parameter, implying that it would create a transaction with exactly that rate. Unfortunately, this fee rate is only passed to MiniWallet's `create_self_transfer` method, which can't know that we append several tx outputs after, increasing the tx's vsize and decreasing it's fee rate accordingly. In our case, the fee rate is off by several orders of magnitude, as the tx's vsize changes changes from 96 to 67552 vbytes (>700x), i.e. the value passed to this function is neither really a fee rate nor an absolute fee, but something in-between, which is very confusing. It was suggested to simply in-line this helper as it's currently only used in this single test (bitcoin/bitcoin#22543 (comment), bitcoin/bitcoin#22543 (comment)), but I could imagine that this helper may also become useful for other tests and may be moved to a library (e.g. wallet.py) in the future. Clarify the interface by passing an absolute fee that is deducted in the end (and also verified, via testmempoolaccept) and also describe how we come up with the value passed. On master, the comment says that the fee rate needs to increased "massively"; this word is also removed because the fee rate only needs to be higher for the test to succeed. ACKs for top commit: stratospher: ACK 2600db6. Tree-SHA512: 0bfacc3fa87603970d86c1d0186e51511f6c20c64b0559e19e7e12a68647f79dcb4f436000dee718fd832ce6a68e3bbacacb29145e0287811f1cb03d2f316843
This is a PR proposed in #20078
This PR enables running another non-wallet functional test even when the wallet is disabled thanks to the MiniWallet, i.e. it can be run even when bitcoin-core is compiled with --disable-wallet.
It also includes changes in wallet.py in the form of a new method,
create_large_transactions()
for the MiniWallet to create large transactions.Efforts for this feature started in #20874 but were not continued and that PR was closed hence I picked this up.
To test this PR locally, compile and build bitcoin-core without the wallet and run: