Skip to content

Conversation

@luke-jr
Copy link
Member

@luke-jr luke-jr commented Nov 10, 2013

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.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link

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

@laanwj
Copy link
Member

laanwj commented Nov 11, 2013

I'd propose to implement this slightly differently, more straightforward: set the default to invalid values (such as -1 or MAXINT or 0, whatever is most useless) then check for valid values in IsMiningSetup() instead of probing the arguments.

@luke-jr
Copy link
Member Author

luke-jr commented Nov 11, 2013

That'd probably make it clearer too, okay...

@luke-jr
Copy link
Member Author

luke-jr commented Nov 11, 2013

@laanwj That'd need making the variables globals again.. so maybe this is better after all?

@laanwj
Copy link
Member

laanwj commented Nov 11, 2013

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.
At least I now understand your reasoning for doing it that way in IsMiningSetup.

@mikehearn
Copy link
Contributor

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.

@luke-jr
Copy link
Member Author

luke-jr commented Nov 12, 2013

"We" shouldn't be setting defaults anyway. That's the point.

@gmaxwell
Copy link
Contributor

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.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 3, 2013

Rebased without "&& true"

@BitcoinPullTester
Copy link

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:

  1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
  2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
  3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
  4. The test suite fails on either Linux i386 or Win32
  5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

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/
Contact BlueMatt on freenode if something looks broken.

@laanwj
Copy link
Member

laanwj commented Dec 8, 2013

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.
We wouldn't want them to just put some nonsense values.

@jgarzik
Copy link
Contributor

jgarzik commented Dec 13, 2013

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.

@laanwj
Copy link
Member

laanwj commented Jan 10, 2014

Seems consensus is against this (at least in the current state), so closing for now.

@laanwj laanwj closed this Jan 10, 2014
@luke-jr
Copy link
Member Author

luke-jr commented Feb 5, 2014

Huh? Most people seemed to support this from the comments... Just realised this was closed without merging :(

@laanwj laanwj reopened this Jul 23, 2015
@luke-jr luke-jr force-pushed the mineropts_check branch 2 times, most recently from e2bd8e7 to a265a0f Compare July 23, 2015 15:45
@luke-jr
Copy link
Member Author

luke-jr commented Jul 23, 2015

Rebased

@gavinandresen
Copy link
Contributor

This probably breaks a bunch of qa/rpc-tests (which run -regtest and which rely on defaults).

@jgarzik
Copy link
Contributor

jgarzik commented Jul 23, 2015

The same objections remain...

@luke-jr
Copy link
Member Author

luke-jr commented Jul 23, 2015

@jgarzik This does give a randomised selection of not-unreasonable settings.

@jgarzik
Copy link
Contributor

jgarzik commented Jul 23, 2015

@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?

@luke-jr
Copy link
Member Author

luke-jr commented Jul 23, 2015

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

@jgarzik
Copy link
Contributor

jgarzik commented Jul 23, 2015

NAK maintained.

This would seem to increase the barrier to entry for p2pool etc. miners and knowingly break currently-working configurations.

Copy link
Contributor

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?

@jgarzik
Copy link
Contributor

jgarzik commented Jul 24, 2015

Just seems like way too many problems or oddities with this patch:

  • Raises the bar for getting p2pool working: Breaks current documentation + requires users to perform lots of research vs. simply taking a useful default.
  • Breaks existing, working configs.
  • Picking random values for key settings is just odd, and runs counter to normal engineering practice. Less deterministic, makes testing more difficult, and more.

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.

@luke-jr
Copy link
Member Author

luke-jr commented Jan 28, 2016

Closing due to inactivity.

@luke-jr luke-jr closed this Jan 28, 2016
@laanwj
Copy link
Member

laanwj commented Jan 28, 2016

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.

Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Apr 8, 2020
…itcoin#3229)

* Update release notes with notable changes and changelog

* Add bitcoin#3230 to changelog
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants