Versionbits extensions for BIP-110#1
Open
dathonohm wants to merge 7 commits into
Open
Conversation
This comment was marked as spam.
This comment was marked as spam.
…eight and set vbrequired during mandatory signaling
2865025 to
144e71e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Also submitted upstream as bitcoin#34929.)
This PR implements the Deployment portion of BIP-110. There is a second PR (upstream), built on this one, that implements the BIP-110 consensus changes and deployment parameters. I have split these two features into separate PRs in order to facilitate review.
This first PR is a generic extension of the pre-existing BIP9 framework to add the BIP8-style activation and temporary deployment pieces BIP-110 needs, namely:
max_activation_height: mandatory activation deadline - forces LOCKED_IN one period before the specified height, regardless of miner signaling (similar to BIP8'slockinontimeout=true)active_duration: number of blocks a deployment remains active after activation, after which it transitions to a new terminal EXPIRED state[max_activation_height - 2*period, max_activation_height - period)), withvbrequiredset ingetblocktemplateoutput (similar to BIP8'sMUST_SIGNALphase)Regtest command-line support for
max_activation_height,active_duration, andthresholdhave also been added to aid in testing.These features may be reused as necessary for future softforks.
Background and Motivation
See the corresponding sections on the dependent PR (upstream).
Features
New
BIP9Deploymentfieldsmax_activation_height(default:INT_MAX= disabled)active_duration(default:INT_MAX= permanent)State machine changes
height >= max_activation_height - periodheight >= activation_height + active_duration(new terminal state)active_durationmust be a multiple ofperiodMandatory signaling
max_activation_height - 2*periodthroughmax_activation_height - period - 1) are rejectedgetblocktemplatesetsvbrequiredbits during this windowRPC
getdeploymentinfo: newmax_activation_heightfield inbip9object when setgetdeploymentinfo: newheight_endfield when ACTIVE withactive_durationstatusfield now includes"expired"as a possible valueRegtest
-vbparamssupportdeployment:start:end[:min_activation_height[:max_activation_height[:active_duration[:threshold]]]]timeoutandmax_activation_heightactive_durationis a multiple ofperiodTests
feature_bip9_max_activation_height.py): mandatory activation, normal signaling, early activation, permanent vs temporary deployments, custom threshold, and mandatory signaling enforcement (non-signaling block rejected)active_durationand EXPIRED stateNote: enforcement-level testing (consensus rules activating/deactivating via
DeploymentActiveAfter) is in PR 2 (upstream), which provides a real deployment (REDUCED_DATA) to test against. TESTDUMMY has no consensus enforcement.Size
~175 lines non-test C++/H. This puts these deployment changes for BIP-110 at about half the size of the deployment changes required for CSV (BIP-68/112/113), which weighed in at 371 lines.