Skip to content

Conversation

@jtimon
Copy link
Contributor

@jtimon jtimon commented Aug 31, 2019

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 #16526

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 31, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

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.

@instagibbs
Copy link
Member

utACK e1960b1

@jtimon jtimon force-pushed the b19-chainparams-allownonstd branch from e1960b1 to b3cd182 Compare October 2, 2019 22:38
@jtimon jtimon changed the title Chainparams: Decouple AllowAcceptNonstd() from IsTestChain() Chainparams: Rename IsTestChain() to AllowAcceptNonstd() Oct 2, 2019
@jtimon
Copy link
Contributor Author

jtimon commented Oct 2, 2019

After #16524 has been merged, this doesn't decouple anything anymore, it's just a rename. Which means we can also remove the old names: updated.

@maflcko
Copy link
Member

maflcko commented Oct 2, 2019

I know this has been discussed in the meeting and everyone was meh or +1 for this and I was the only one against it. But to be consistent, shouldn't you update the 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).

@jtimon
Copy link
Contributor Author

jtimon commented Oct 3, 2019

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

@maflcko
Copy link
Member

maflcko commented Oct 3, 2019

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.

@jtimon
Copy link
Contributor Author

jtimon commented Oct 3, 2019

Sorry, I don't see how that says anything against what I'm saying. The checks and functionalities can be the same independently of them being documented in different chainparams fields or grouped and coupled into a single field named IsTestChain despite being unrelated functionalities.
In any case, if I can read more about discussions around "candidates for IsTestChain()", that would be awesome.

@maflcko
Copy link
Member

maflcko commented Oct 3, 2019

Right, the only difference is the amount of code needed in chainparams

@maflcko
Copy link
Member

maflcko commented Oct 3, 2019

Long-term I don't care which option we pick, but we should be consistent. That means that the MineBlocksOnDemand() check in setmocktime should be either replaced with IsTestChain() or something like CanSetMockTime(), no?

@jtimon
Copy link
Contributor Author

jtimon commented Oct 3, 2019

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.

@maflcko
Copy link
Member

maflcko commented Oct 3, 2019

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)

@maflcko
Copy link
Member

maflcko commented Oct 8, 2019

@jtimon Are you working on the CanSetMockTime or nah? #16770 (comment)

@jtimon
Copy link
Contributor Author

jtimon commented Oct 8, 2019

No, I'm not working on CanSetMockTime. I'm still not sure what do you want to do about it or what's the relation to this PR.

@maflcko
Copy link
Member

maflcko commented Oct 8, 2019

What is the high level goal of this pull request then?

@jtimon
Copy link
Contributor Author

jtimon commented Oct 8, 2019

Get rid of IsTestChain renaming it to something that describes what it does better.

@jtimon
Copy link
Contributor Author

jtimon commented Oct 9, 2019

There's a label that says "waiting for author". I don't understand, waiting for author to do what?

@jtimon
Copy link
Contributor Author

jtimon commented Oct 11, 2019

I think @MarcoFalke and I agreed on IRC his nits would be solved with something like this:

#17106

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.

@jtimon
Copy link
Contributor Author

jtimon commented Feb 4, 2020

@MarcoFalke Do you agree with what I said or did I misunderstood our chat discussion?

@jtimon jtimon force-pushed the b19-chainparams-allownonstd branch from b3cd182 to 698c6e6 Compare February 19, 2020 20:13
@jtimon
Copy link
Contributor Author

jtimon commented Feb 19, 2020

Rebased.

@MarcoFalke note it seems #18037 decouples whether the chain is mockable or not from MineBlocksOnDemand like #17106 (and it does more things), so if I understood you well, your concerns should be solved, right?

@jtimon
Copy link
Contributor Author

jtimon commented May 6, 2020

Closing due to lack of interest.

@jtimon jtimon closed this May 6, 2020
@maflcko
Copy link
Member

maflcko commented May 6, 2020

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

@jtimon
Copy link
Contributor Author

jtimon commented May 6, 2020

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.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants