diff options
author | Luke Dashjr <luke_github1@dashjr.org> | 2021-02-02 20:30:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 20:30:41 +0000 |
commit | 0aa8c3ae021cf9066f65b7cf7bd1f24a81350dd8 (patch) | |
tree | f3454e60ebb5cb9920b8c0d52527a6f962203e36 /bip-0008.mediawiki | |
parent | 79cd91ec98c82dea05873883f303974d2f9921ab (diff) | |
parent | afe97b2eeeeaf8cd1a0658bb191da15b36a4dd3a (diff) |
Merge pull request #1021 from ajtowns/202010-bip8-mustsignal-to-threshold
BIP8: allow some MUST_SIGNAL blocks to not signal
Diffstat (limited to 'bip-0008.mediawiki')
-rw-r--r-- | bip-0008.mediawiki | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bip-0008.mediawiki b/bip-0008.mediawiki index b2400af..d5cb191 100644 --- a/bip-0008.mediawiki +++ b/bip-0008.mediawiki @@ -85,7 +85,7 @@ Miners should continue setting the bit in LOCKED_IN phase so uptake is visible, The new consensus rules for each soft fork are enforced for each block that has ACTIVE state. -During the MUST_SIGNAL phase, blocks that fail to signal are invalid. +During the MUST_SIGNAL phase, if '''(2016 - threshold)''' blocks in the retarget period have already failed to signal, any further blocks that fail to signal are invalid. ===State transitions=== @@ -177,11 +177,23 @@ block, indexed by its parent. ===Mandatory signalling=== -Blocks received while in the MUST_SIGNAL phase must be checked to ensure that they signal. For example: +Blocks received while in the MUST_SIGNAL phase must be checked to ensure that they signal as required. For example: if (GetStateForBlock(block) == MUST_SIGNAL) { - if ((block.nVersion & 0xE0000000) != 0x20000000 || ((block.nVersion >> bit) & 1) != 1) { - return state.Invalid(BlockValidationResult::RECENT_CONSENSUS_CHANGE, "bad-version-bip8-must-signal"); + int nonsignal = 0; + int count = 1 + (block.nHeight % 2016); + walk = block; + while (count > 0) { + --count; + if ((walk.nVersion & 0xE0000000) != 0x20000000 || ((walk.nVersion >> bit) & 1) != 1) { + ++nonsignal; + if (nonsignal + threshold > 2016) { + return state.Invalid(BlockValidationResult::RECENT_CONSENSUS_CHANGE, "bad-version-bip8-must-signal"); + } + } else if (nonsignal == 0) { + break; + } + walk = walk.parent; } } |