-
Notifications
You must be signed in to change notification settings - Fork 179
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
Wallet no history sync #444
Conversation
538b6d5
to
1325e24
Compare
All tests are passing, the travis test is failing for some other reason. |
tests are failing because flake8 has complaints |
1325e24
to
100dc6e
Compare
I pushed an edit to fix one of flake8's complaints. The other errors are because of the file |
Did you base this off the wrong branch maybe? Because clearly there are changes to that file and relating to the flake8 errors. |
Yes you're right. I didn't rebase off the wrong branch I just forgot my own code :p |
100dc6e
to
0c1dc2e
Compare
Fixed now, thanks for the help |
dfa678a
to
470f1f4
Compare
1b86587
to
ae7bd90
Compare
As of ae7bd90 tests seem to show the functionality is correct, including recovering from seed then specifying -g <number above max index> --recoversync after setting *no-history in config. There are a few other tests we should try of course. |
ae7bd90
to
278797c
Compare
I've dealt with some of the review comments, waiting for more discussion on the others. Commit left unsquished while the review is in progress. |
Added edits to fix all the review points. |
jmclient/jmclient/wallet_service.py
Outdated
@@ -334,7 +335,8 @@ def sync_wallet(self, fast=True): | |||
# before startup | |||
self.old_txs = [x['txid'] for x in self.bci.list_transactions(100) | |||
if "txid" in x] | |||
self.bci.post_sync_wallet_callback(self.wallet) | |||
if self.bci.__class__ == BitcoinCoreNoHistoryInterface: |
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 believe isinstance()
is more technically correct, since it'd handle the case that self.bci
was an instance of a child class of BitcoinCoreNoHistoryInterface
. This is of course just theoretical for now, so I wouldn't be upset if you don't change it :)
Apart from that one (very minor) comment, everything else seems clear. I'll just do another quick test but this seems fine. |
OK tested an old and a brand new wallet; balance on old recovered exactly correctly. New behaved as expected without any errors (displaying 0 of course). Both utxo set scans take a little over 30s here but probably that's on the quick side because of hardware. Anyway everything is good afaict so tACK, feel free to merge. |
No-history is a method for synchronizing a wallet by scanning the UTXO set. It can be useful for checking whether seed phrase backups have money on them before committing the time and effort required to rescanning the blockchain. No-history sync is compatible with pruning. The sync method cannot tell which empty addresses have been used, so cannot guarentee avoidance of address reuse. For this reason no-history sync disables wallet address generation and can only be used with wallet-tool and for sending transactions without change addresses.
c5f6690
to
f5e27c3
Compare
This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring.
This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring.
This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring.
This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring.
This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring.
This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring.
Update no-history-sync code: This updates the new functionality in jmclient.wallet_utils in the no-history-sync PR #444 to be compatible with the python-bitcointx refactoring. Remove all future/py2 compatibility code remaining: This is in line with #525 and corrects erroneous addition of more compatibility code. Addresses all flake8 complaints (ununsed imports etc) Addresses review of @dgpv Addresses review of @kristapsk
81982c7 Drop support for pre-0.17 Bitcoin Core (Kristaps Kaupe) Pull request description: Simplifies code, resolves #452. I would like also drop official support for versions older than 0.18 (still support 0.17 at first, but put 0.18 as a requirement in docs), as 0.18 is minimum required for [wallet no history sync](#444). In future that would allow [some more optimizations](#462). Asked it [here](#452 (comment)), want to hear some comments about that. In any case, these would be changes on top of this anyway. Tested by running test suite with 0.17.1 (where 4 of tests of `jmclient/test/test_core_nohistory_sync.py` fail as expected) and 0.20.1. Top commit has no ACKs. Tree-SHA512: 240a0dc0887465ecc5545dffa3759e9b03cc41fc54a759c6757328949d4b40621e029b7f3acfe6d456b659d3d62a9d1df1c6a39594dd2c94ee66b71a267a65bb
No-history is a method for synchronizing a wallet by scanning the UTXO
set. It can be useful for checking whether seed phrase backups have
money on them before committing the time and effort required to
rescanning the blockchain. No-history sync is compatible with pruning.
The sync method cannot tell which empty addresses have been used, so
cannot guarentee avoidance of address reuse. For this reason no-history
sync disables wallet address generation and can only be used with
wallet-tool and for sending coinjoins without change addresses.
This PR can be easily tested by setting
blockchain_source = bitcoin-rpc-no-history
, importing a seed phrase to create a new wallet file (with$ python3 wallet-tool.py recover
) then running$ python3 wallet-tool.py --recoversync -g 500 newwalletfile.jmdat
and checking that all your money appears. Make sure to increase the gap limit to an appropriate value so that all the addresses which might have coin on them are scanned.