Skip to content

Commit 97d2f02

Browse files
committed
Merge pull request bitcoin#354 from sipa/bip9fixes
Small improvements to BIP9
2 parents 1daefdb + bce835d commit 97d2f02

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

bip-0009.mediawiki

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ Each soft fork deployment is specified by the following per-chain parameters (fu
2828
# The '''starttime''' specifies a minimum median time past of a block at which the bit gains its meaning.
2929
# The '''timeout''' specifies a time at which the deployment is considered failed. If the median time past of a block >= timeout and the soft fork has not yet locked in (including this block's bit state), the deployment is considered failed on all descendants of the block.
3030
31-
The starttime should be set to some date in the future, coordinates with software release date. This is to prevent
32-
triggers as a result of parties running pre-release software. The timeout should be set a reasonable time after the
33-
starttime. A later deployment using the same bit is possible as long as the starttime is after the previous one's
34-
timeout or activation, though it is recommended to have a pause in between to detect buggy software.
31+
===Selection guidelines===
3532

36-
Setting the timeout to 3 years after the starttime allows at least 9 new deployments per year.
33+
The following guidelines are suggested for selecting these parameters for a soft fork:
3734

38-
====States====
35+
# '''bit''' should be selected such that no two concurrent softforks use the same bit.
36+
# '''starttime''' should be set to some date in the future, approximately one month after a software release date including the soft fork. This allows for some release delays, while preventing triggers as a result of parties running pre-release software.
37+
# '''timeout''' should be 1 year (31536000 seconds) after starttime.
38+
39+
A later deployment using the same bit is possible as long as the starttime is after the previous one's
40+
timeout or activation, but it is discouraged until necessary, and even then recommended to have a pause in between to detect buggy software.
41+
42+
===States===
3943

4044
With each block and soft fork, we associate a deployment state. The possible states are:
4145

@@ -45,7 +49,7 @@ With each block and soft fork, we associate a deployment state. The possible sta
4549
# '''ACTIVE''' for all blocks after the LOCKED_IN retarget period.
4650
# '''FAILED''' for one retarget period past the timeout time, if LOCKED_IN was not reached.
4751
48-
====Bit flags====
52+
===Bit flags===
4953

5054
Blocks in the STARTED state get an nVersion whose bit position bit is set to 1. The top 3 bits of such blocks must be
5155
001, so the range of actually possible nVersion values is [0x20000000...0x3FFFFFFF], inclusive.
@@ -59,11 +63,11 @@ bits are 0 for the purposes of deployments.
5963
Miners should continue setting the bit in LOCKED_IN phase so uptake is visible, though this has no effect on
6064
consensus rules.
6165

62-
====New consensus rules====
66+
===New consensus rules===
6367

6468
The new consensus rules for each soft fork are enforced for each block that has ACTIVE state.
6569

66-
====State transitions====
70+
===State transitions===
6771

6872
<img src="bip-0009/states.png" align="middle"></img>
6973

@@ -149,7 +153,7 @@ current retarget period (i.e. up to and including its ancestor with height block
149153
it is possible to implement the mechanism above efficiently and safely by caching the resulting state of every multiple-of-2016
150154
block, indexed by its parent.
151155

152-
====Warning mechanism====
156+
===Warning mechanism===
153157

154158
To support upgrade warnings, an extra "unknown upgrade" is tracked, using the "implicit bit" mask = (block.nVersion & ~expectedVersion) != 0. Mask will be non-zero whenever an unexpected bit is set in nVersion. Whenever LOCKED_IN for the unknown upgrade is detected, the software should warn loudly about the upcoming soft fork. It should warn even more loudly after the next retarget period (when the unknown upgrade is in the ACTIVE state).
155159

0 commit comments

Comments
 (0)