-
Notifications
You must be signed in to change notification settings - Fork 37.8k
miner: always treat SegWit as active #31625
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
The getblocktemplate RPC would check if SegWit has activated yet at the tip. This has been the case for more than seven years.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31625. ReviewsSee the guideline for information on the review process. ConflictsReviewers, 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. |
Not sure about this. If someone goes back in the main chain to an earlier block to mine on top of it for testing (or fun), this could lead to the mined block being rejected from the own node. Conceptually, there is an argument to be self-consistent, but I am not sure how to weight that against removing the lines of code. |
Currently But if you patched that check away, why would a SegWit block be rejected? You'd also need a (bunch of) ASIC(s) for such an experiment. |
Witness data is not allowed per consensus rules before segwit activation. |
Ok, so someone could roll back their node to before SegWit activation, patch If they then call They could get around that by changing |
I don't think a patch is needed. ibd will latch, so in theory one could use that. I am not claiming this is a valid use case, just that internal self-consistency was the reason why this hasn't been done previously, IIRC. |
It would be good if someone has a link to the earlier reasoning. |
Not sure if it was ever mentioned publicly where a link exists. Obviously, if you want to reproduce the inconsistency, it would be easier in regtest, and the change may theoretically break someone's test deployment. |
It seems useful to illustrate the change here by regenerating the alternative mainnet blocks introduced in #31583, switching their coinbase outputs to taproot addresses. Before this PR the last block, which spends a coinbase output, would fail with Marking as draft when that lands. |
It would also seem more consistent to drop the |
The
getblocktemplate
RPC would check if SegWit has activated yet at the tip. This has been the case for more than seven years.