-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
multiprocess: Add bitcoin-gui -ipcconnect option #19461
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
This still happens on 5f91aa3. Same setup as above: node and wallet running on Ubuntu 23.04 with a GUI client connecting from macOS using a unix socket of SSH. But now I've notice this happens even if you don't connect to it, i.e. starting without After letting the chain sync (a few days worth of blocks), I shut it down. At that point the log (on Ubuntu):
I then have to restart the node and sync again. (update: it's unrelated to the commits in this PR, I added a comment on #10102 (comment)) |
I'm able to produce another crash that may be related to this PR. When using an external signer that's connected to the Ubuntu machine, and trying to spend with it from the macOs GUI. After I click Sign on device, and hit "send":
It also crashes if I create a PSBT (options -> wallet -> enable psbt controls) instead, just a different line
Both nodes were configured with have These asserts happen after calling |
Thanks Sjors, I'm trying to reproduce the shutdown error but didn't succeed yet. Will try again with a mainnet node. I didn't look into the external signer bug yet, but maybe that is more straightforward. In both cases running with -debug=ipc could make it clearer what's going on, especially in the shutdown case. Probably what is happening in that case is that some thread is trying make an IPC call after the socket is closed, so an ipc::Exception is raised which is uncaught. Fix might be synchronizing the IPC call & socket close, or just catching the exception and handling it |
🐙 This pull request conflicts with the target branch and needs rebase. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
…ode (partial revert bitcoin#10244) 519cae8 gui: Delay interfaces::Node initialization (Russell Yanofsky) 102abff gui: Replace interface::Node references with pointers (Russell Yanofsky) 91aced7 gui: Remove unused interfaces::Node references (Russell Yanofsky) e133631 gui: Partially revert bitcoin#10244 gArgs and Params changes (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This is a partial revert of bitcoin#10244. It changes gui code to go back to using gArgs and Params() functions directly instead of using interfaces::Node to handle arguments. These changes were originally pushed as part of bitcoin#19461. Motivation is to support a new GUI process connecting to an already running node process. Details are explained in commit messages, but in addition to spawning a new bitcoin-node process, we want bitcoin-gui to connect to an existing bitcoin-node process. So for that reason it should be able to parse its own parameters, rather than rely on the node. ACKs for top commit: MarcoFalke: re-ACK 519cae8, only change is rebase and addressed nits of my previous review last week 🌄 Tree-SHA512: 9c339dd82ba78bcc7b887b84d872f35ccc7dfa3d271691e6eafe8a2048cbbe3bdde1e810ce33d0714d75d048c9de3470e9e9b6f8306a6047d1cb3548f6858dc8
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
This is a draft PR because it is based on #10102 + #19460. The non-base commits are:
5f91aa3d8b47
multiprocess: Add bitcoin-gui -ipcconnect optionBuilding on #10102, this adds an
-ipcconnect
option tobitcoin-gui
that connects the GUI to an existingbitcoin-node
process already running in the background instead of spawning a newbitcoin-node
process. This allows the GUI to be started and stopped independently of the node. By default with this change,bitcoin-gui
will check if a<datadir>/sockets/node.sock
socket exists and try to connect to that. If that doesn't work, it will spawn a new node process and start up the same way it did before this PR.The default
bitcoin-gui
connect option is-ipcconnect=auto
, which tries to connect if possible as described above, and spawns a newbitcoin-node
process if not possible. Other supported options are-noipcconnect
to never connect to an existing node and always spawn a new one,-ipcconnect
to require a connection and fail if it can't be established, and-ipcconnect=unix:<socket>
to require a connection and use a custom socket path.With this PR, basic functionality works and gui instances can connect and disconnect from a running node. But there are rough edges: If a gui process doesn't shut down cleanly, the node can see unhandled IpcExceptions, and if node command line options are passed to
bitcoin-gui
andbitcoin-gui
connects to an exiting bitcoin-node process instead of spawning a new one, the node options will be silently ignored.These changes require multiprocess support and this PR has no effect unless bitcoin is configured with
--enable-multiprocess
as described in doc/multiprocess.mdThis PR is part of the process separation project.