Refactor, this shouldn’t change functionality.
This is a step to get rid of Params().IsTestChain() which is currently used for 2 unrelated things.
Rename related to https://github.com/bitcoin/bitcoin/pull/16526
Refactor, this shouldn’t change functionality.
This is a step to get rid of Params().IsTestChain() which is currently used for 2 unrelated things.
Rename related to https://github.com/bitcoin/bitcoin/pull/16526
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, 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.
63@@ -64,6 +64,8 @@ class CChainParams
64 const CBlock& GenesisBlock() const { return genesis; }
65 /** Default value for -checkmempool and -checkblockindex argument */
66 bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }
67+ /** If it is allowed to set -acceptnonstdtxn=1 for this chain or not */
68+ bool AllowAcceptNonstd() const { return m_allow_accept_nonstd; }
69 /** Policy: Filter transactions that do not match well-defined patterns */
Something like
0 /** Default for -acceptnonstdtxn */
if (!Params().MineBlocksOnDemand())
in setmocktime
as well? Pretty much any MineBlocksOnDemand
that is not used in the miner is a candidate for IsTestChain
(according to me) or for a separate flag in the chainparams (according to everyone that is not me).
I asumed MineBlocksOnDemand() was renamed to the equivalent for fPowNoRetargeting against my deepest bike-shedding wishes, but, no, not the getter, only the internal variable. What was the rationale?
Why do we even have “candidates for IsTestChain”? Is that documented anywhere?
I understand the desire to simplify chainparams, but I don’t think the best path is to group them and couple them but to try to document them so it gets more obvious which ones aren’t really needed.
For example, IMO we don’t need Params().RequireStandard() as per #16527 Or, as you seem to agree, we didn’t need Params().IsFallbackFeeEnabled() as per #16402 and #16524
I understand the desire to simplify chainparams, but I don’t think the best path is to group them and couple them but to try to document them so it gets more obvious which ones aren’t really needed.
Those checks are there to prevent users from shooting themselves in the foot. Non std txs could mean they accidentally created an malformed tx, making all their funds go to miners. Incorrect mocktime means they get out of consensus (among other things, like braking tx relay). Same goes for a fallbackfee default, …
However the question “can you shoot yourself in the foot on regtest or testnet?” can always be answered with “no” for a test chain.
MineBlocksOnDemand()
check in setmocktime
should be either replaced with IsTestChain()
or something like CanSetMockTime()
, no?
That means that the MineBlocksOnDemand() check in setmocktime should be either replaced with IsTestChain() or something like CanSetMockTime(), no?
Perhaps CanSetMockTime(), but not IsTestChain, I think. That should be false for testnet, no? I mean, even if we wanted to group unrelated things under IsTestChain(), unless I’m missing something.
Perhaps CanSetMockTime(), but not IsTestChain, I think.
Fine with me.
That should be false for testnet, no?
Fine with me. (off-topic: While I think there is no risk to enable it for testnet)
I think @MarcoFalke and I agreed on IRC his nits would be solved with something like this:
Therefore we can focus on what’s at hand here, which is much less. @instagibbs you gave your utACK before #16524 when in my opinion it was more important, (because there was a functional coupling right there) it was actually decoupling rather than a simple rename, so feel free to re-utACK or meh or -0 or nack or whatever.
I think there was agreement to do this in the meeting when the topic was discussed, but I think no one had interest to review.
I hereby commit to reviewing this if at least one other person reviews this :)
I think it takes very little time to review this, probably even less time than in answering my last question to you. I mean, how much time does it get to give an utACK or even a concept ACK to this? 3 minutes?
But I’m not interested in this myself anymore, so don’t bother. I would be more interested in getting review for #17037 or even #17032 But even for those, I’m not even motivated to rebase #17037 or to answer/fix nits for #17032 So I guess don’t bother either. Use your time in something that has more chances of getting merged.
Thanks anyway.