How does BIP9 handle expiration dates over retargeting periods?

2

Suppose a BIP9 feature is set to expire on day T. Suppose further that the retargeting period before T actually ends on day T+5, but the retargeting period (2016 blocks) actually signals for the BIP9 feature 95%+. Does the feature get activated or not?

I ask as this is a realistic scenario should BIP148 gain traction.

Jimmy Song

Posted 2017-05-30T02:53:38.590

Reputation: 7 067

Answers

3

As per BIP 9, the transition to FAILED takes precendence. Which means that the feature will not be activated via BIP09. The relevant part of the code.

case STARTED: if (GetMedianTimePast(block.parent) >= timeout) { return FAILED; } int count = 0; walk = block; for (i = 0; i < 2016; i++) { ...

sanket1729

Posted 2017-05-30T02:53:38.590

Reputation: 755

Well, here's the weird thing, can you just mine with timestamps that are on time T-1? GetMedianTimePast is the average of the last 10. Does it check that it's actually near the time the blocks got relayed?Jimmy Song 2017-05-30T04:04:59.783

1From bitcoin Wiki: A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you. As a result, block timestamps are not exactly accurate, and they do not even need to be in order. Block times are accurate only to within an hour or two. The difference is about 2 hours.sanket1729 2017-05-30T04:16:16.370