-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Require configuration of mining before creating blocks #3229
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
Conversation
src/rpcmining.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.
I'm not a C++ programmer, I don't see why this last "&& true" exists.
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 am a C++ programmer but... huh 🐷 🐨 🐮 Thinking about it it may be a way to temporary switch the result for testing, like #if 0. In any case, it shouldn't be there in the final code.
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.
It makes the list of arguments consistent per-line.
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.
My vote, don't do this...
|
I'd propose to implement this slightly differently, more straightforward: set the default to invalid values (such as |
|
That'd probably make it clearer too, okay... |
|
@laanwj That'd need making the variables globals again.. so maybe this is better after all? |
|
Ugh, yes I now see that CreateNewBlock also queries and parse the arguments every time. That's the same as using globals, just in a hidden way. |
|
The obvious downside of this approach being ..... once a miner has set them, we lose the ability to select smarter defaults, because whatever they pick could end up being used indefinitely. |
|
"We" shouldn't be setting defaults anyway. That's the point. |
|
If we think that the common settings become wrong for an option there is always the possibility of just renaming the option to force resetting it. |
|
Rebased without "&& true" |
|
Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/03528791ea2b870595723642dbac74bfa4f0923e for binaries and test log. This could happen for one of several reasons:
If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ |
|
I think this needs a documentation update too. Miners upgrading to 0.9.0 will have no idea what to set the defaults to, so the documentation could suggest some sane default values (I get the irony here) and to sources of information with regard to setting the values. |
|
NAK This is fundamentally "force X to think" which is unfriendly. We want miners to be thinking about this, agreed; But I see nothing wrong and much good by continuing to provide a sane default mining policy. Let's continue to play nice with our miner friends. |
|
Seems consensus is against this (at least in the current state), so closing for now. |
|
Huh? Most people seemed to support this from the comments... Just realised this was closed without merging :( |
e2bd8e7 to
a265a0f
Compare
|
Rebased |
|
This probably breaks a bunch of qa/rpc-tests (which run -regtest and which rely on defaults). |
|
The same objections remain... |
|
@jgarzik This does give a randomised selection of not-unreasonable settings. |
|
@luke-jr AFAICS this change requires miners to have something set in their configs, which they may not have set before, by checking mapArgs.count() Thus it breaks e.g. every miner, including p2pool miners, which do not have those settings in their config file. Am I missing something? |
|
@jgarzik No, that sounds about right. It breaks miners who have thus far been too negligent to configure their node, until they do so. @gavinandresen Fixed QA tests by skipping config check on regtest/testnet. |
|
NAK maintained. This would seem to increase the barrier to entry for p2pool etc. miners and knowingly break currently-working configurations. |
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.
Can't you just use the defaults here and log a warning when the miner hasn't configured certain options instead of throwing a JSONRPCError for now? @jgarzik would that be acceptable?
|
Just seems like way too many problems or oddities with this patch:
More generally, "pushy" changes that halt software operation until the user educates themselves to a higher degree are distasteful. Bullying the user into learning the intricacies of mining policy is not the way to go. It is a lot of headache just to avoid providing a sane default. |
|
Closing due to inactivity. |
|
Yes, while I philosophically agree with this pull, and I'd rather get rid of any unnecessary default values any day, it's so inconvenient to miners that we can't really merge it. |
…itcoin#3229) * Update release notes with notable changes and changelog * Add bitcoin#3230 to changelog
As discussed on IRC, this removes the "defaults" miners often use as an excuse to not make mining decisions.
getblocktemplate is disabled unless bitcoind is explicitly configured with mining settings.