Conversation
Work towards using a single structure to describe deployments rather than separate ones for each deployment method. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" -o -name "*.h" | xargs perl -i -pe 's/BIP9Deployment/Deployment/g' -END VERIFY SCRIPT-
Helper function that encapsulates the logic to check if a version bits deployment is active.
(This does not include pre-CSV soft-forks however, due to special casing in the loop that calls BIP9SoftForkDescPushBack)
|
This is an alternative approach to #16060 |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
|
I did like the RPC changes in the other pull. It seems odd to return |
I've added an extra commit to change the RPC results to something similar to 16060. |
|
I prefer the approach in #16060. The changes in this PR seem more complex for achieving a similar goal (+110 lines here vs -70 lines in 16060)
Softfork activation/burials are sufficiently rare that I don't think we have to optimize to minimize the code changes when they do happen.
I like the new RPC return object We've been trying to bury these deployments for almost two years now (see #11398), so I just want to see it done. If people prefer this approach, I'm happy to close 16060 in favour of this. |
I think the reason it's taken that long is because burying deployments isn't trivial. "Optimising to minimise the code changes when they do happen" makes them trivial -- after the upfront work to setup Consensus::Deployment, burying segwit is just two one-line changes (one for mainnet, one for testnet): |
To expand on those numbers:
I think that's pretty representative: there's a chunk of new infrastructure in chainparams/versionbits with this PR, versus a bunch of dropped test code that's not compatible with hardcode fixed height deployments in 16060; versionbitsinfo is kind of verbose; and 16060 makes a few other choices that saves lines of code that aren't in this PR. |
|
Thanks for running the numbers! Yes, 16060 removes both node and test code that are no longer required/relevant once the deployment heights are hard-coded. |
|
#16060 is more straightforward for burying csv/segwit, and it doesn't really make things any more difficult to generalise than they already are, so abandoning this PR in favour of it |
This is a different approach to burying csv/segwit deployments -- rather than converting them from
Consensus::BIP9Deploymentto dedicated members, it uses a generalisedConsensus::Deploymenttype to cover both BIP9 activations and fixed height activations.I think this should make future burials much simpler (it becomes a one-line change), but there's two other benefits: it doesn't change RPC or tests much, and I think it will make it easier to make future changes to activation methods should we wish to do so. The downside is that the activations aren't hardcoded anymore, so there's a function call and a few indirect lookups to determine a fixed-height activation is enabled, rather than just a direct test.
I've added some extra commits to tidy up the
getblockchaininfooutput. It now changes from:The output of
getblockchaininfochanges from:to
with this patch set, or, on regtest something like: