-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Detach wallet from miner #3762
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
Detach wallet from miner #3762
Conversation
884a21b to
f1fa2a4
Compare
|
Force-pushed because the no-op bracket change made by @LarryRuane in #3647 (which merged today) conflicted with this PR, and I hadn't updated my local master yet 😅 |
Eirik0
left a comment
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.
Looks good overall - just a couple of comments. One thing that I wondered while going through this was if it would have been easier to first revert 8e8b6d7 then do the cherry-picking and then reapply the things we needed from that commit separately - not sure about this, just a thought I had.
src/init.cpp
Outdated
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 is not part of the commit this is cherry-picked from, but it appears to be in code that is unique to us. Do you mind briefly explaining what this is doing?
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 is leveraging the fact that boost::signals2 executes connected handlers in-order. Further up, the wallet is connected to this signal if the wallet is enabled. The wallet handler was modified from upstream so that it does nothing if -mineraddress is set, and GetScriptForMinerAddress() does nothing if -mineraddress is not set (or set to an invalid address). The upshot is:
- If the wallet is enabled and
-mineraddressis not set, the passed-inCScriptis set to a wallet address. - If the wallet is enabled and
-mineraddressis set, the passed-inCScriptis set to-mineraddress. - If the wallet is disabled and
-mineraddressis set, the passed-inCScriptis set to-mineraddress. - If the wallet is disabled and
-mineraddressis not set, the passed-inCScriptis not modified; in practice this means it is empty, andGenerateBitcoins()returns an error.
src/miner.h
Outdated
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.
The commit this is cherry-picked from does not remove class CWallet. I guess that this would cause a compilation error if it were an actual problem.
src/miner.cpp
Outdated
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 could probably use a comment.
qa/rpc-tests/test_framework/util.py
Outdated
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 think it is a little confusing to have to pass in the expected_utxos to get the correct coinbase address. How did this work before when we just called getnewaddress() would it give us the either the oldest or the most recent address. Would it be possible to default to that if expected_utxos is not provided or do that instead.
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.
In a pairing, @Eirik0 and I decided that we would remove the expected_utxos argument, and just return the address that contains the most UTXOs. For all the RPC tests that use this function, this is sufficient (because either they call once targeting a large-UTXO address, or they call every time they need a single UTXO).
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 instead made it optional, because one of the RPC tests does rely on selecting specific coinbase addresses.
|
Addressed @Eirik0's comments. |
Eirik0
left a comment
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.
utACK
|
@zkbot try |
|
⌛ Trying commit bcb3d6ce39454c0e42ee9d60dc0121e4105df538 with merge e8d8897c620ad473bf85fc9ed1ad8e81dfee1a57... |
|
☀️ Test successful - pr-try |
|
@str4d I am seeing this fail to build with |
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.
Seeing the zcash-gtest binary fail using CONFIGURE_FLAGS="--enable-wallet=no" ' in build.sh`
- use one CReserveScript per mining thread
After upstream PR bitcoin/bitcoin#5994, the first call to getnewaddress after startup does not return the address being used by the miner.
bcb3d6c to
c233f6f
Compare
|
Rebased on master to fix the merge conflict. Addressing the |
This ensures it is accessible by the test suite when the wallet is disabled.
The code was already compiled as part of the wallet, but the tests were not, meaning that the tests would fail to compile when the wallet was disabled.
|
Fixed the compilation issues by moving code into the correct compilation units. |
|
Tested ACK per last commit to resolve binary issue with zcash-gtest |
Eirik0
left a comment
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.
reACK
|
@zkbot r+ |
|
📌 Commit 1fee150 has been approved by |
|
⌛ Testing commit 1fee150 with merge 224635bba7e380948f9a6d7f952eb6118c8e8dad... |
|
💔 Test failed - pr-merge |
|
The failures do not seem to be related to the PR, for example, CI got stuck waiting forever of a macOS build which was not happening. |
|
@zkbot retry |
Detach wallet from miner Cherry-picked from upstream PR bitcoin/bitcoin#5994. Part of #2074.
Cherry-picked from upstream PR bitcoin/bitcoin#5994.
Part of #2074.