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 for simple doublespend sub-test in feature_rbf.py #22330
test: use MiniWallet for simple doublespend sub-test in feature_rbf.py #22330
Conversation
Concept ACK |
ACK c582546 |
Needs rebase |
c582546
to
9f2a53d
Compare
Done. Took the new sub-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.
tACK 9f2a53d.
nit: I agree with https://github.com/bitcoin/bitcoin/pull/22330/files#r674195638 that it is not necessary to scan 3 blocks
9f2a53d
to
48e5b1f
Compare
@ShubhamPalriwala @sriramdvt: Thanks for your reviews! You are right, in total we only need two blocks to scan -- in the second commit one UTXO in MiniWallet to start with is enough (both sub-tests |
Concept 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.
tACK 48e5b1f
I ran the tests of master and then off the PR to confirm everything still passes as expected. Left some optional feedback in the comments.
# Ensure nodes are synced | ||
self.sync_all() | ||
self.wallet = MiniWallet(self.nodes[0]) | ||
self.wallet.scan_blocks(start=76, num=2) |
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.
Initially, I was confused by these parameters and noted that the test would fail if I picked a start
less than 70, but would run for starts greater than 76. I dug through the comments and found the explanation on a previous PR, but considering this test is meant to be a proof of concept to motivate re-writing all the tests to use miniwallet, it might be worth adding a small comment explaining why 76 and 2 are chosen.
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.
Good point, extended the second commit with an explanation about why we start at block 76, with reference to the test framework's method where the chain is pre-mined.
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 48e5b1f
tested and works fine on Ubuntu 21.04 48e5b1f However, I agree with @josibake here:
Adding a comment explaining the 2 blocks would help to understand the code even further |
…tests also document on why we start scanning blocks at height 76
48e5b1f
to
c1c0768
Compare
Force-pushed with changes suggested by josibake (#22330 (comment), #22330 (comment)). Thanks for the valuable reviews so far :) |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
ACK c1c0768 thanks for adding the comment! it will make it much easier for others to followup and refactor the remaining tests to use miniwallet |
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 c1c0768 🌴
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
ACK c1c0768b619ab463a00052d0a584fba191eb02a9 🌴
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUi2Fwv/ZxETYQ3y9g77WwtNwVdqsHBrnHUaGAdjmEL1sF9HoCIwN1Ag92X0cVZV
0thS0WL81c/c7jWDG7H4XGAMfA254XvIWsA8vOjrx48YmbFxUZU0BNbtonT7iY04
arLwF4NsAg++ZmZni+Ofqyt90moqnlNLdtUvU8IQjm3fqZ2mu+SMM4WVxuD9rP8J
cxoAq7R5B+QuLKpL+S6fvbZHHrtn0aAIv8C58kDMJDvQasrsI1Pn9gzmPmu0Kg5T
/zbLextjgQcQwMU3IBOCYkiENU1akjxJ9OMF5F6rsdILJ52hbqpAHJP3QxmgUXUB
83smxjrBzaLf3sBBvSbiUplfDpGdjhPIoGcs2rV1wPPJAHtaLmTk4LHMwsTI46S8
ulDmutPrXKOdzXTTg0MhvRksve+5sXOq+4HnEke4qbGp0ij2qabYwFJ0rOdZ7gM7
Vpbkufy2U4fSrOO+amRCR0/JTznFIOyymij/UWhfC0G9p/XRSGvKVFIr0XA4qoJS
IvWqeNPN
=LPRU
-----END PGP SIGNATURE-----
Timestamp of file with hash 86af1901202bc55a0ba833a2df907819403554b0cc025a2c2c40822d8fff1ade -
c1c0768
to
aa02c64
Compare
Force-pushed with simplification suggestions by MarcoFalke (#22330 (comment), #22330 (comment)) in the last commit. |
re-ACK aa02c64 🌯 Show signature and timestampSignature:
Timestamp of file with hash |
This PR's goal is to prepare the functional test
feature_rbf.py
for more MiniWallet usage. It first gets rid of unused initialization code (I guess that was needed at times when the nodes were still in IBD at the start of tests?), then makes the MiniWallet instance introduced in #22210 available for all sub-tests, and finally, uses that instance in the first sub-testtest_simple_doublespend
.Note that the same idea of replacing the
make_utxo
calls with MiniWallet can be also applied to other sub-tests too; this just serves as a first proof-of-concept.