Skip to content

Conversation

@str4d
Copy link
Contributor

@str4d str4d commented Jan 4, 2019

Cherry-picked from upstream PR bitcoin/bitcoin#5994.

Part of #2074.

@str4d str4d added A-wallet Area: Wallet C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. A-pow Area: Proof-of-Work and mining labels Jan 4, 2019
@str4d str4d force-pushed the 2074-detach-wallet-from-miner branch from 884a21b to f1fa2a4 Compare January 4, 2019 00:04
@str4d
Copy link
Contributor Author

str4d commented Jan 4, 2019

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 😅

Copy link
Contributor

@Eirik0 Eirik0 left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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 -mineraddress is not set, the passed-in CScript is set to a wallet address.
  • If the wallet is enabled and -mineraddress is set, the passed-in CScript is set to -mineraddress.
  • If the wallet is disabled and -mineraddress is set, the passed-in CScript is set to -mineraddress.
  • If the wallet is disabled and -mineraddress is not set, the passed-in CScript is not modified; in practice this means it is empty, and GenerateBitcoins() returns an error.

src/miner.h Outdated
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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).

Copy link
Contributor Author

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.

@str4d
Copy link
Contributor Author

str4d commented Jan 28, 2019

Addressed @Eirik0's comments.

@mms710 mms710 requested review from daira and mdr0id January 29, 2019 18:09
Copy link
Contributor

@Eirik0 Eirik0 left a comment

Choose a reason for hiding this comment

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

utACK

@Eirik0
Copy link
Contributor

Eirik0 commented Jan 30, 2019

@zkbot try

@zkbot
Copy link
Contributor

zkbot commented Jan 30, 2019

⌛ Trying commit bcb3d6ce39454c0e42ee9d60dc0121e4105df538 with merge e8d8897c620ad473bf85fc9ed1ad8e81dfee1a57...

@zkbot
Copy link
Contributor

zkbot commented Jan 30, 2019

☀️ Test successful - pr-try
State: approved= try=True

@mdr0id
Copy link
Contributor

mdr0id commented Feb 20, 2019

@str4d I am seeing this fail to build with NO_WALLET=1. Can you please confirm what is used to build this?

Copy link
Contributor

@mdr0id mdr0id left a 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`

@str4d str4d force-pushed the 2074-detach-wallet-from-miner branch from bcb3d6c to c233f6f Compare March 5, 2019 20:29
@str4d
Copy link
Contributor Author

str4d commented Mar 5, 2019

Rebased on master to fix the merge conflict. Addressing the zcash-gtest compilation issue now...

str4d added 2 commits March 6, 2019 09:41
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.
@str4d
Copy link
Contributor Author

str4d commented Mar 5, 2019

Fixed the compilation issues by moving code into the correct compilation units.

@mdr0id mdr0id self-requested a review March 6, 2019 05:14
@mdr0id mdr0id requested a review from Eirik0 March 6, 2019 05:14
@mdr0id
Copy link
Contributor

mdr0id commented Mar 6, 2019

Tested ACK per last commit to resolve binary issue with zcash-gtest

Copy link
Contributor

@Eirik0 Eirik0 left a comment

Choose a reason for hiding this comment

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

reACK

@Eirik0
Copy link
Contributor

Eirik0 commented Mar 12, 2019

@zkbot r+

@zkbot
Copy link
Contributor

zkbot commented Mar 12, 2019

📌 Commit 1fee150 has been approved by Eirik0

@zkbot
Copy link
Contributor

zkbot commented Mar 12, 2019

⌛ Testing commit 1fee150 with merge 224635bba7e380948f9a6d7f952eb6118c8e8dad...

@zkbot
Copy link
Contributor

zkbot commented Mar 12, 2019

💔 Test failed - pr-merge

@Eirik0
Copy link
Contributor

Eirik0 commented Mar 12, 2019

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.

@Eirik0
Copy link
Contributor

Eirik0 commented Mar 12, 2019

@zkbot retry

@zkbot
Copy link
Contributor

zkbot commented Mar 12, 2019

⌛ Testing commit 1fee150 with merge 1cbe507...

zkbot added a commit that referenced this pull request Mar 12, 2019
Detach wallet from miner

Cherry-picked from upstream PR bitcoin/bitcoin#5994.

Part of #2074.
@zkbot
Copy link
Contributor

zkbot commented Mar 12, 2019

☀️ Test successful - pr-merge
Approved by: Eirik0
Pushing 1cbe507 to master...

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

Labels

A-pow Area: Proof-of-Work and mining A-wallet Area: Wallet C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants