-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Added rescan option for import descriptors #31668
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
base: master
Are you sure you want to change the base?
Added rescan option for import descriptors #31668
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31668. ReviewsSee the guideline for information on the review process. ConflictsNo conflicts as of last run. |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
This needs a test and the tests fixed |
Moved to draft for now. You'll need to squash your commits, and address the various review feedback. |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
54a20e6
to
c353883
Compare
@fanquake code has been updated as per the discussions and all checks are now passing. |
0b6addc
to
e77515a
Compare
Cloned fresh bitcoin src, then "gh pr checkout 31668" and built on Ubuntu WSL2. |
630210e
to
1ac3559
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.
It would be good to add test cases for the "never" option.
1ac3559
to
8ebba0a
Compare
8ebba0a
to
7f3bb5c
Compare
ec8e5df
to
5c21359
Compare
import_res = restorewo_wallet.importdescriptors( | ||
[ | ||
{"desc": wo1_desc, "timestamp": "now"}, | ||
{"desc": wo2_desc, "timestamp": "now"}, | ||
{"desc": wo2_desc, "timestamp": "never"}, | ||
{"desc": wo3_desc, "timestamp": "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.
This test with now
is basically the same as never
. Since the distinction is that now
does actually rescan a little bit, it would be good to add in the setup for these tests a transaction that would be scanned by now
but not never
.
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.
hi @achow101 I've added more test cases.
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.
Hi @achow101 could you please share your thoughts with the latest changes.
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, but your latest test changes do not really implement what I was suggesting.
My point was that you need to distinguish between now
and never
, and currently the tests do not do that. The outcome of rescanning due to "timestamp": "now"
should be different from the outcome of not rescanning due to "timestamp": "never"
. As it is now, both tests have the same outcome due to the setup, so we don't know whether there is a bug in the handling of now
or never
.
My suggestion is not to make yet another copy of the same import and balance check as you have done. Rather, my suggestion is that you should change the setup such that rescanning with now
produces a different result (i.e. balance) than with never
.
One way you might do this is to change the above set_node_times
so that the time used for now
overlaps with some of the transactions that are made earlier in the test. An alternative could be to create a transaction after set_node_times
but before any imports as such a transaction would definitely fall within the now
rescan range. However, it may require other changes to the test as balances may change.
You may have a different idea on how to do that test, it's up to you to decide how to approach writing that. Either way, the difference in behavior between now
and never
should be tested here that demonstrates how now
and never
can have different outcomes.
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.
Hi @achow101 Thanks for your suggestion, I hope i understand it correctly and I updated the test cases. Kindly review it again.
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.
Hi @achow101 any update on the fix I provided.
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.
hi @achow101 can you please review it again.
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.
Hi @achow101 kindly give some update on this.
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.
HI @achow101 can you please approve this PR
5c21359
to
2fd0fd5
Compare
e7ee990
to
8a67868
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
Hello, is possible to review it again? It should be all good now. |
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits |
assert_equal(restorewo_wallet.getbalance(), 0) | ||
assert_equal(len(restorewo_wallet.listtransactions()), 0) | ||
|
||
# rescan will continue if any of the descriptors has now as timestamp |
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.
“if any of the descriptors has now as timestamp” → “have” [plural agreement]
“if any of the descriptors has now or valid timestamp” → “have” [plural agreement]
8a67868
to
8d625b8
Compare
8d625b8
to
43ec169
Compare
43ec169
to
6e523bd
Compare
Hello, anything still pending or can now be merged? |
All PRs must be reviewed prior to being merged. This PR does not have sufficient review, so it cannot be merged. |
Hi all, could you please complete the review I've resolved all the comments of the previous review comments. |
Hi @furszy kindly acknowledge this review its been waiting for very long time. |
Fix related to issue: #31263