This is a different approach to burying csv/segwit deployments – rather than converting them from Consensus::BIP9Deployment
to dedicated members, it uses a generalised Consensus::Deployment
type 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 getblockchaininfo
output. It now changes from:
The output of getblockchaininfo
changes from:
"softforks": [
{
"id": "bip34",
"version": 2,
"reject": {
"status": true
}
},
{
"id": "bip66",
"version": 3,
"reject": {
"status": true
}
},
{
"id": "bip65",
"version": 4,
"reject": {
"status": true
}
}
],
"bip9_softforks": {
"csv": {
"status": "active",
"startTime": 1462060800,
"timeout": 1493596800,
"since": 419328
},
"segwit": {
"status": "active",
"startTime": 1479168000,
"timeout": 1510704000,
"since": 481824
}
},
to
"softforks": {
"bip34": {
"status": "active",
"fixedHeight": 227931,
"since": 227931
},
"strictder": {
"status": "active",
"fixedHeight": 363725,
"since": 363725
},
"cltv": {
"status": "active",
"fixedHeight": 388381,
"since": 388381
},
"csv": {
"status": "active",
"fixedHeight": 419328,
"since": 419328
},
"segwit": {
"status": "active",
"fixedHeight": 481824,
"since": 481824
}
},
with this patch set, or, on regtest something like:
"softforks": {
"bip34": {
"status": "active",
"fixedHeight": 500,
"since": 500
},
"testdummy": {
"status": "started",
"bit": 28,
"startTime": 0,
"timeout": 9223372036854775807,
"since": 144,
"statistics": {
"period": 144,
"threshold": 108,
"elapsed": 141,
"count": 141,
"possible": true
}
},
"strictder": {
"status": "defined",
"fixedHeight": 1251,
"since": 0
},
"cltv": {
"status": "defined",
"fixedHeight": 1351,
"since": 0
},
"csv": {
"status": "started",
"bit": 0,
"startTime": 0,
"timeout": 9223372036854775807,
"since": 144,
"statistics": {
"period": 144,
"threshold": 108,
"elapsed": 141,
"count": 141,
"possible": true
}
},
"segwit": {
"status": "active",
"alwaysActive": true,
"since": 0
}
},