Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Jun 12, 2021

This change allows to make the GUI startup process more granular, and, eventually, to move the appInitStartClients call from
BitcoinCore::initialize into LoadWalletsActivity (see bitcoin-core/gui#342) and fix bitcoin-core/gui#247.

No behavior change.

@hebasto
Copy link
Member Author

hebasto commented Jun 13, 2021

Updated e734449 -> 3268fcc (pr22231.01 -> pr22231.02, diff):

This change allows to make the GUI startup process more granular, and,
eventually, to move the appInitStartClients call from
BitcoinCore::initialize into another thread with better user feedback.

No behavior change.
@hebasto
Copy link
Member Author

hebasto commented Jul 22, 2021

Rebased 3268fcc -> 32aad05 (pr22231.02 -> pr22231.03) due to the conflict with bitcoin-core/gui#381.

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.

This seems ok. I tend to think an alternate approach where bitcoin node and wallet starts up by itself and sends more frequent notifications to the GUI would be better than having GUI code drive bitcoin node and wallet loading from the outside like this.

Code review ACK 3268fcc in any case

@maflcko
Copy link
Member

maflcko commented Jul 22, 2021

How is this a refactor when the behaviour changes? Previously StartupNotify would be called after the wallets are started, now it is called before.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 25, 2021

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

Conflicts

No conflicts as of last run.

@ryanofsky
Copy link
Contributor

How is this a refactor when the behaviour changes? Previously StartupNotify would be called after the wallets are started, now it is called before.

I'm not sure this is a problem, since I think it's just moving wallet postInit calls, not wallet loading calls. So wallets should still be loaded and RPCs should function. But this would be good to mention in the PR description. And if there actually are user-visible changes in behavior, it would probably be good to add release notes and update -startupnotify documentation, or to update the PR to avoid them.

This seems ok. I tend to think an alternate approach where bitcoin node and wallet starts up by itself and sends more frequent notifications to the GUI would be better than having GUI code drive bitcoin node and wallet loading from the outside like this.

Note that 71d5240 from #10102 makes a similar change as this PR, but takes the alternate approach of adding a new init notification instead of adding a new init method, so common init code is driving itself and notifying the GUI, instead of the GUI driving the init.

71d5240 and this PR are both complementary and both have a similar motivation of making GUI startup more responsive. For comparison, 71d5240 moves WalletClient construction (wallet process spawning) from the GUI thread to the init executor thread, while this PR moves WalletClient::start calls from earlier in init executor thread to later in the same thread.

@maflcko
Copy link
Member

maflcko commented Sep 8, 2021

It is absolutely a behaviour change if -startupnotify previously waited for the wallet txs mempool state to be updated, and now it doesn't.

@ryanofsky
Copy link
Contributor

It is absolutely a behaviour change if -startupnotify previously waited for the wallet txs mempool state to be updated, and now it doesn't.

Makes sense and I also wonder if this doesn't really have an impact on bitcoin-core/gui#247, contrary to the description:

This change allows to make the GUI startup process more granular, and, eventually, to move the appInitStartClients call from
BitcoinCore::initialize into LoadWalletsActivity (see bitcoin-core/gui#342) and fix the bitcoin-core/gui#247.

No behavior change.

This PR only affects wallet postinit (client->start), not wallet loading (client->load), or GUI WalletModel loading.

@hebasto hebasto marked this pull request as draft September 9, 2021 20:35
@hebasto hebasto changed the title refactor: Separate AppInitStartClients from AppInitMain Separate AppInitStartClients from AppInitMain Sep 9, 2021
@hebasto
Copy link
Member Author

hebasto commented Sep 12, 2021

@ryanofsky

It is absolutely a behaviour change if -startupnotify previously waited for the wallet txs mempool state to be updated, and now it doesn't.

Makes sense and I also wonder if this doesn't really have an impact on bitcoin-core/gui#247, contrary to the description:

This change allows to make the GUI startup process more granular, and, eventually, to move the appInitStartClients call from
BitcoinCore::initialize into LoadWalletsActivity (see bitcoin-core/gui#342) and fix the bitcoin-core/gui#247.
No behavior change.

This PR only affects wallet postinit (client->start), not wallet loading (client->load), or GUI WalletModel loading.

You're right. This PR does not have an impact on bitcoin-core/gui#247.

Closing.

@hebasto hebasto closed this Sep 12, 2021
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bitcoin-qt stays at "Done loading" for a long time

4 participants