Skip to content
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

rpc: Drop migratewallet experimental warning #28037

Merged
merged 2 commits into from Feb 16, 2024

Conversation

achow101
Copy link
Member

@achow101 achow101 commented Jul 6, 2023

The migration process itself hasn't fundamentally changed since it was added, so I think it's reasonable to say that it is no longer experimental.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 6, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK josibake, furszy, maflcko, ryanofsky, willcl-ark

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a small bug in the addressbook migration code (fixed by #26836) that we might want to fix before removing the experimental warning.

Probably, I could decouple the fix and test coverage into an standalone PR so we can get more attention there.

@maflcko
Copy link
Member

maflcko commented Jul 10, 2023

Would it make sense to document that this is expected to take a long time on spinning storage? For me a freshly created BDB wallet takes ~5 minutes to migrate. Another one I wasn't sure about, see #28057 (comment).

Also, there seem to be outstanding bugs with the RPC, see same thread as above.

@maflcko
Copy link
Member

maflcko commented Sep 21, 2023

Would it make sense to document that this is expected to take a long time on spinning storage? For me a freshly created BDB wallet takes ~5 minutes to migrate.

Are you still working on this? If not, it would be good to leave a reply here.

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to document that this is expected to take a long time on spinning storage? For me a freshly created BDB wallet takes ~5 minutes to migrate.

Created #28574 to improve the situation. Let me know how it goes with it.

@willcl-ark
Copy link
Member

Is the plan here to review #28574 and try and get that in, if it improves things, or should we remove the warning as proposed here and add a note that it may take more time?

I'd be happy to review/test either when I know which approach we'd prefer.

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan here to review #28574 and try and get that in, if it improves things, or should we remove the warning as proposed here and add a note that it may take more time?

I'd be happy to review/test either when I know which approach we'd prefer.

I would rather leave this warning for another release just so the process undergoes an entire release cycle without issues prior to dropping the "experimental" label. I don't think that keeping it for another cycle would modify the legacy wallet removal schedule at all.

The reality is that, even though they may seem harmless, we continue encountering issues with this process.. e.g. #28609 and #28610. And I think that we should try to avoid, as much as possible, any unexpected behavior resulting from the wallet migration process as it could be quite alarming for our users.

Other than that, after reviews on #28609 and #28610, I would be happy to receive you on #28574. A process which its execution takes +5 minutes on a spinning disk hard drive seems pretty impractical for me (and could also be tagged as an issue).

@achow101
Copy link
Member Author

I don't think that keeping it for another cycle would modify the legacy wallet removal schedule at all.

I'd prefer that the RPC is not marked as experimental for one release before we drop the legacy wallet entirely. We have the legacy wallet scheduled to be removed for 27.0, but if migration is still experimental for 26.0, then the schedule should be pushed back by a release.

@maflcko
Copy link
Member

maflcko commented Oct 19, 2023

At a minimum, I'd prefer if the doc said that this RPC could take a long time, and that bumping the client timeout is recommended. Otherwise users will call the RPC and only see the timeout error message with no way to get further feedback.

@bitcoin bitcoin deleted a comment Oct 19, 2023
@bitcoin bitcoin deleted a comment Oct 19, 2023
@achow101
Copy link
Member Author

I've pushed a commit that mentions the time in the RPC doc.

@stickies-v
Copy link
Contributor

We have the legacy wallet scheduled to be removed for 27.0

According to #20160, it seems we're only stopping creation of new wallets in 27.0, and removing BDB in 28.0? Given that there still are outstanding bugs (even if not necessarily super critical), removing the experimental label for 26.0 is unnecessarily risky in my view

@achow101 achow101 modified the milestones: 26.0, 27.0 Oct 23, 2023
@achow101
Copy link
Member Author

Moved to the 27.0 milestone.

"\nMigrate the wallet to a descriptor wallet.\n"
"A new wallet backup will need to be made.\n"
"\nThe migration process will create a backup of the wallet before migrating. This backup\n"
"file will be named <wallet name>-<timestamp>.legacy.bak and can be found in the directory\n"
"for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet."
"\nEncrypted wallets must have the passphrase provided as an argument to this call.",
"\nEncrypted wallets must have the passphrase provided as an argument to this call.\n"
"\nThis RPC may take a long time to complete. Increasing the RPC client timeout is recommended.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another problem is that (I presume) large single-keys-bag wallets may take hundred times longer to load. Not saying that this is a common use case, but I don't think the RPC is non-experimental for users before this is fixed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we then include #26008 and maybe #28574 in 27.0?

@murchandamus
Copy link
Contributor

Hey, I was taking a look at this PR. What is the status on this? Are we aiming to get this into 27.0? What about the two PRs, that @S3RK mentioned, they are open and in draft. Does this PR here depend on them?

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I was taking a look at this PR. What is the status on this? Are we aiming to get this into 27.0? What about the two PRs, that @S3RK mentioned, they are open and in draft. Does this PR here depend on them?

#28574 is in draft because it is the parent PR. It consolidates the entire work in a single location, allowing tests and benchmarks to be performed against the end goal as well.
This work was decoupled into three independent PRs: #28894 (merged), #28987, #26836. There is no specific order required for the review.

I think we should aim to get this one in for v27. The process shouldn't take ~5 minutes to complete (#28037 (comment)). Since there is no feedback during the process, users might end up aborting it, thinking it has stalled, and leave their wallet in an inconsistent state, requiring manual recovery from the backup.

@furszy
Copy link
Member

furszy commented Jan 31, 2024

Also, we do have other bug fixes that should be included in v27 to deprecate this warning.
See #28976, #28868, #29112, #29367. Would be nice to bring more attention to them.

Copy link
Member

@josibake josibake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f1684bb

Looks like all the known bugs have been fixed and most of the performance improvements have been merged. The only two outstanding performance improvements are #28987 and #26008, both of which seem close/RFM. Given that we are also including a warning that this process is expected to take longer, I think its safe to drop the warning even without #28987 and #26008 (obviously, better if we can also get those in with v27).

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f1684bb

The only two outstanding performance improvements are #28987 and #26008

There are actually more. #28987, and also #29403, are prerequisites for further performance improvements on #28574.

That being said, while I would like to reach that goal (same as getting closer in #26008), I also think that we should move forward with this one.

@achow101
Copy link
Member Author

I tested yesterday a bdb testnet3 wallet with 1000 txs on spinning storage, and I aborted the migration after 20 minutes.

Can you profile that so we can see where it is actually spending the most time?

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last batching changes might help but.. it smells like you are facing another issue apart from those. Profiling results would help diagnose the problem.

@maflcko
Copy link
Member

maflcko commented Feb 13, 2024

Not sure how to create a flame-graph, since it takes too long. But it may be eating time in fdatasync in

#9  0x0000559cb227c624 in wallet::SQLiteBatch::TxnCommit (this=0x7f5b24178fc0) at wallet/sqlite.cpp:668
#10 0x0000559cb21cff66 in wallet::DescriptorScriptPubKeyMan::TopUp (this=0x7f5b24178970, size=<optimized out>) at wallet/scriptpubkeyman.cpp:2148
#11 0x0000559cb21cb6d3 in wallet::LegacyScriptPubKeyMan::MigrateToDescriptor (this=0x7f5b24ee3900) at wallet/scriptpubkeyman.cpp:1925
#12 0x0000559cb222b2f7 in wallet::CWallet::GetDescriptorsForLegacy (this=0x7f5b2517cc70, error=...) at wallet/wallet.cpp:3922
#13 0x0000559cb222e8fa in wallet::DoMigration (wallet=..., context=..., error=..., res=...) at wallet/wallet.cpp:4155

@achow101
Copy link
Member Author

@maflcko Can you provide any more details about the wallet? The output of getwalletinfo would be helpful.

@maflcko
Copy link
Member

maflcko commented Feb 13, 2024

It is just a normal testnet3 wallet:

{
  "walletname": "-1707752467.legacy.bak-1707848638.legacy.bak-1707849652.legacy.bak-1707855504.legacy.bak",
  "walletversion": 60000,
  "format": "bdb",
  "balance": 1.26999586,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 661,
  "keypoololdest": 1515426721,
  "keypoolsize": 999,
  "unlocked_until": 0,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": false,
  "external_signer": false,
  "blank": false,
  "birthtime": 1,
  "lastprocessedblock": {
    "hash": "0000000000000093bcb68c03a9a168ae252572d348a2eaeba2cdf9231d73206f",
    "height": 2500000
  }
}

@achow101
Copy link
Member Author

How long does it take to migrate if you just let it complete?

@maflcko
Copy link
Member

maflcko commented Feb 13, 2024

Ok, I can try that. I wonder if anyone else can try the HDD+BDB combo to double check. Or if really no one else has a HDD+BDB for testing, it can be declared unsupported?

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the chain sync, reindex or any indexing procedure taking that long as well?

@maflcko
Copy link
Member

maflcko commented Feb 14, 2024

Not sure. I am using the spinning storage only to test migratewallet. It finished after 2 hours.

I don't want to block this pull request, but I wanted to share what I am seeing when running the migration on a slow storage. Migration is a one-time cost, so I'll leave it up to others whether to improve it, and by how much. However, if migratewallet is expected to take long for other wallets if they reside on slow storage, it may be good to add a note to the RPC? Something like, "Depending on the size of your wallet and the speed of your storage device, migration may take several hours. Make sure to disable the client RPC timeout. Otherwise, the migration RPC result will not make it back to you."

Another problem is that (I presume) large single-keys-bag wallets may take hundred times longer to load after migration, even on fast storage, IIRC. If this is still the case, it seems like a higher priority to fix, because this is a cost to be paid every time the wallet is loaded.

@maflcko
Copy link
Member

maflcko commented Feb 14, 2024

I guess time loadwallet will be improved by #26008 (comment)

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I am using the spinning storage only to test migratewallet.

I'm asking because if other processes are equally slow, then this could be "ok" (and we could declare the hardware unsupported for core entirely...). But if only this process takes forever, then we are sure that there is an issue.

It finished after 2 hours.

We are definitely not expecting this process to take that long. The wallet you shared is really small.

Another problem is that (I presume) large single-keys-bag wallets may take hundred times longer to load after migration, even on fast storage, IIRC. If this is still the case, it seems like a higher priority to fix, because this is a cost to be paid every time the wallet is loaded.
I guess time loadwallet will be improved by #26008 (comment)

It will, but #26008's current implementation comes with higher memory costs, which is not that good if your wallet is running on a resource-constrained system. Yet, (personal view) it will be nice to tackle one issue at a time. Users need to be able to migrate their wallet in a decent amount of time before reaching the point of running a big single-key-bag wallet.


Continuing with the issue investigation, could you measure how much it takes to create a fresh wallet? It would be good to know how much it takes to top up the new key pool for the 8k default keys (the same process is executed during migration).

Also, how much available memory (ram) does your system have?.

And, just in case, try running #28574 too.

@furszy
Copy link
Member

furszy commented Feb 14, 2024

Update: I'm cooking another set of improvements.. will try to have them for tonight.

@furszy
Copy link
Member

furszy commented Feb 14, 2024

Or well, I just crafted a simple version of what I'm doing (I'm planning to create a statement builder around this work, and that will take me some more time).

Could you please try this branch: https://github.com/furszy/bitcoin-core/tree/2024_wallet_batch_migration_multi_insert and share the results?

It is essentially #28574 + 506b738. The new commit introduces a raw multi-insert statement. Locally, this shows a significant speedup but I'm on a SSD.

@willcl-ark
Copy link
Member

I tried to reproduce using a wallet with ~1k tx located on a spinning disk -- although this time on regtest -- but I found migratewallet to be pleasantly fast:

will@will-ubuntu in ~/src/bitcoin on  master [$?⇡] : C v17.0.2-clang : 🐍 3.9.18
₿ time /home/will/src/bitcoin/src/bitcoin-cli -regtest -datadir=/media/will/PEPSI/big-wallet-900-tx-original migratewallet big
{
  "wallet_name": "big",
  "backup_path": "/media/will/PEPSI/big-wallet-900-tx-original/regtest/wallets/big/big-1707927351.legacy.bak"
}

________________________________________________________
Executed in    8.14 secs      fish           external
   usr time    1.69 millis  226.00 micros    1.46 millis
   sys time    0.45 millis   45.00 micros    0.40 millis


will@will-ubuntu in ~/src/bitcoin on  master [$?⇡] : C v17.0.2-clang : 🐍 3.9.18
₿ /home/will/src/bitcoin/src/bitcoin-cli -regtest -datadir=/media/will/PEPSI/big-wallet-900-tx-original getwalletinfo
{
  "walletname": "big",
  "walletversion": 169900,
  "format": "sqlite",
  "balance": 13606.24414485,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 515.63072317,
  "txcount": 952,
  "keypoolsize": 4000,
  "keypoolsize_hd_internal": 4000,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": true,
  "external_signer": false,
  "blank": false,
  "birthtime": 0,
  "lastprocessedblock": {
    "hash": "16632672917b708d311b8197d7be852c9a5ce41413b04ecfc2ca72637148766b",
    "height": 634
  }
}

The BDB wallet getwalletinfo (slightly smaller keypool size):

will@will-ubuntu in ~/src/bitcoin on  master [$?⇡] : C v17.0.2-clang : 🐍 3.9.18
₿ /home/will/src/bitcoin/src/bitcoin-cli -regtest -datadir=/media/will/PEPSI/big-wallet-900-tx-original getwalletinfo
{
  "walletname": "/home/will/bitcoin-chains/big-wallet-900-tx-original/regtest/wallets/big",
  "walletversion": 169900,
  "format": "bdb",
  "balance": 13606.24414485,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 515.63072317,
  "txcount": 952,
  "keypoololdest": 1707925846,
  "keypoolsize": 1000,
  "hdseedid": "f48cadf402473b7726449f7e50c836466970299e",
  "keypoolsize_hd_internal": 1000,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": false,
  "external_signer": false,
  "blank": false,
  "birthtime": 1707925845,
  "lastprocessedblock": {
    "hash": "16632672917b708d311b8197d7be852c9a5ce41413b04ecfc2ca72637148766b",
    "height": 634
  }
}

@maflcko
Copy link
Member

maflcko commented Feb 14, 2024

  "walletversion": 169900,

Yes, HD wallets are fine. The issue is only about pre-HD wallets. My version is 60000.

@achow101
Copy link
Member Author

I made a non-HD legacy wallet with double the number of transactions, put it on an external hdd, and migrated it. Migration took 230 seconds, which, while slow, is certainly not multiple hours.

$ src/bitcoin-cli -regtest -rpcwallet=/run/media/ava/F5CD-B8E0/big_nonhd_wallet getwalletinfo
{
  "walletname": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet",
  "walletversion": 60000,
  "format": "bdb",
  "balance": 251.59681094,
  "unconfirmed_balance": 49.00000000,
  "immature_balance": 0.07643467,
  "txcount": 1351,
  "keypoololdest": 1707936916,
  "keypoolsize": 1000,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": false,
  "external_signer": false,
  "blank": false,
  "birthtime": 1707936495,
  "lastprocessedblock": {
    "hash": "6c96458f7db633ef353ff78fb92dae6c92539e733dae4b2cd48db814571ea299",
    "height": 2524
  }
}
$ time src/bitcoin-cli -regtest -rpcwallet=/run/media/ava/F5CD-B8E0/big_nonhd_wallet migratewallet
{
  "wallet_name": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet",
  "backup_path": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet-1707949293.legacy.bak"
}

________________________________________________________
Executed in  230.95 secs      fish           external
   usr time    5.21 millis    0.00 micros    5.21 millis
   sys time    0.41 millis  414.00 micros    0.00 millis

How many keys does that wallet have (it'll be in the debug log, look for "Legacy Wallet Keys")? This one I just made is 2333 keys.

@willcl-ark
Copy link
Member

I was able to reproduce it with wallet version 60000 and 1k keys/tx I also see 30 mins...

₿ /home/will/src/bitcoin/src/bitcoin-cli -regtest -datadir=/media/will/PEPSI/regtest-v60000 getwalletinfo
{
  "walletname": "",
  "walletversion": 60000,
  "format": "bdb",
  "balance": 14716.40625000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 78.12500000,
  "txcount": 1000,
  "keypoololdest": 1707941916,
  "keypoolsize": 1000,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": false,
  "external_signer": false,
  "blank": false,
  "birthtime": 1707941702,
  "lastprocessedblock": {
    "hash": "369d42451890f636c521f3d3d70241aa524eb36cfa53c4cd16248d3b9f772538",
    "height": 1000
  }
}

will@will-ubuntu in ~ : 🐍 3.11.6
₿ time /home/will/src/bitcoin/src/bitcoin-cli -regtest -datadir=/media/will/PEPSI/regtest-v60000 -rpcclienttimeout=9999999999 migratewallet ""
{
  "wallet_name": "",
  "backup_path": "/media/will/PEPSI/regtest-v60000/regtest/-1707945979.legacy.bak"
}

________________________________________________________
Executed in   32.20 mins      fish           external
   usr time    2.44 millis    0.00 micros    2.44 millis
   sys time    0.37 millis  374.00 micros    0.00 millis

I was trying to get a flamegraph but something seems to have broken with my perf tool after upgrading kernels...

@furszy
Copy link
Member

furszy commented Feb 14, 2024

q: the wallet to be migrated, is already loaded by the time you call migratewallet? Or you are migrating a non-loaded wallet?

Because, if the wallet wasn't loaded by the newer version yet, it will run the UpgradeKeyMetadata process during migration too. Which involves performing writes for 2 times the number of your key pool.

I just updated my branch batching that process too. In case someone want to test: https://github.com/furszy/bitcoin-core/tree/2024_wallet_batch_migration_multi_insert.
Will try to get an hdd tomorrow if this is not solved by then.

@achow101
Copy link
Member Author

I'm not entirely convinced that migration is actually spending most of the time in disk I/O for these big wallets.

This is a flamegraph of the migration of my big nonhd wallet on master:
master-migrate-big-nonhd-perf

Ignoring the locking stuff since I didn't turn off the lock debugging, it seems like a big chunk of time is spent in IsMine after the descriptors have been created. This suggests to me that #26008 would provide a significant speedup there.

Here's a flamegraph of migration of the same wallet with #26008:
ismine-cache-migrate-big-nonhd-perf

You can see that almost no time is spent in IsMine, so I think #26008 should make migration of such wallets much faster:

$ src/bitcoin-cli -regtest -rpcwallet=/run/media/ava/F5CD-B8E0/big_nonhd_wallet migratewallet
{
  "wallet_name": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet",
  "backup_path": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet-1707974252.legacy.bak"
}

________________________________________________________
Executed in  150.25 secs      fish           external
   usr time    4.69 millis    0.00 micros    4.69 millis
   sys time    0.41 millis  414.00 micros    0.00 millis

If I turn off debugging, migration of my test wallet is also way faster:

$ src/bitcoin-cli -regtest -rpcwallet=/run/media/ava/F5CD-B8E0/big_nonhd_wallet migratewallet
{
  "wallet_name": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet",
  "backup_path": "/run/media/ava/F5CD-B8E0/big_nonhd_wallet-1707974585.legacy.bak"
}

________________________________________________________
Executed in   82.31 secs      fish           external
   usr time    0.00 millis    0.00 micros    0.00 millis
   sys time    4.33 millis  407.00 micros    3.92 millis

@maflcko @willcl-ark Can you say how many keys (or descriptors after migration) the wallet has? Can you also try migrating it using #26008?

@achow101
Copy link
Member Author

I'm any case, I didn't think the performance issues should be a blocker for this PR. It's clear that migration works, it may just take a while.

Missing this release will push back the timeline another release cycle, if not more.

@maflcko
Copy link
Member

maflcko commented Feb 15, 2024

I'm any case, I didn't think the performance issues should be a blocker for this PR. It's clear that migration works, it may just take a while.

Missing this release will push back the timeline another release cycle, if not more.

Yes, I agree. Sorry for not being clear.

Since it appears that at least one other person could reproduce a longer migrate time (30 minutes), why not mention that the user should take care to disable the client rpc timeout? Something along the lines of:

"Depending on the size of your wallet and the speed of your storage device, migration may take several hours. Make sure to disable the client RPC timeout. Otherwise, the migration RPC result will not make it back to you."

@maflcko
Copy link
Member

maflcko commented Feb 15, 2024

Ok, I didn't see that you already did that. 😅

lgtm ACK f1684bb

@maflcko
Copy link
Member

maflcko commented Feb 15, 2024

How many keys does that wallet have (it'll be in the debug log, look for "Legacy Wallet Keys")? This one I just made is 2333 keys.

There are more keys than transactions, and they are encrypted, the debug log says:

Wallet file version = 10500, last client version = 269900
Legacy Wallet Keys: 0 plaintext, 4998 encrypted, 4998 w/ metadata, 4998 total.
Descriptors: 0, Descriptor Keys: 0 plaintext, 0 encrypted, 0 total.
Wallet completed loading in             229ms
setKeyPool.size() = 999
mapWallet.size() = 661
m_address_book.size() = 3524

q: the wallet to be migrated, is already loaded by the time you call migratewallet? Or you are migrating a non-loaded wallet?

It should be loaded.

I'm not entirely convinced that migration is actually spending most of the time in disk I/O for these big wallets.

I think it does, at least for me, because on the SSD it was faster.

@maflcko @willcl-ark Can you say how many keys (or descriptors after migration) the wallet has? Can you also try migrating it using #26008?

Sure, I'll try to write a functional test for this.

@maflcko
Copy link
Member

maflcko commented Feb 15, 2024

Done in #29438 . Maybe move the discussion there, so that this can move forward and be merged?

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK f1684bb

"This RPC may take a long time to complete" seems like much more helpful and accurate documentation than "This call may not work as expected and may be changed in future releases" at this point.

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f1684bb

Agree that this should no longer be marked as experimental in the next release even though some migrations do appear to take a(n unexpectedly) long time.

@fanquake fanquake merged commit 3cbc8cb into bitcoin:master Feb 16, 2024
15 of 16 checks passed
@willcl-ark
Copy link
Member

@achow101 for context my test wallet has 8016 descriptors after migration:

will@will-ubuntu in ~ : 🐍 3.11.6
₿ /home/will/src/bitcoin/src/bitcoin-cli -regtest -datadir=/media/will/PEPSI/regtest-v60000 listdescriptors | jq '.descriptors | length'
8016

I have also in the meantime tested a branch from @furszy which reduced migration time from 30 mins to 80 seconds 👀

@furszy
Copy link
Member

furszy commented Feb 19, 2024

I have also in the meantime tested a branch from @furszy which reduced migration time from 30 mins to 80 seconds 👀

That's great! Sounds like a bug fix :).
@maflcko could you also try it please?.

Branch: https://github.com/furszy/bitcoin-core/tree/2024_wallet_batch_migration_multi_insert.

(Most of the changes are already inside #28574)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet