Skip to content

Commit 323a46e

Browse files
committed
Merge #10463: Names: BIP9 vs versionbits
b463bc9 scripted-diff: s/BIP9DeploymentInfo/VBDeploymentInfo/ (Jorge Timón) 29c0719 Rename -bip9params to -vbparams (shaolinfry) Tree-SHA512: a8a2bf6e24a4a7fc82f784c78c0cd92472e9ba55ce3fb22dafef3eccdcfccb2da5a6078fbeec1a8a4b6ab1f1b226976c5aba964dd5e3d029a21b109a7c044374
2 parents 9fec4da + b463bc9 commit 323a46e

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits
5555
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
5656
}
5757

58-
void CChainParams::UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
58+
void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
5959
{
6060
consensus.vDeployments[d].nStartTime = nStartTime;
6161
consensus.vDeployments[d].nTimeout = nTimeout;
@@ -356,8 +356,7 @@ void SelectParams(const std::string& network)
356356
globalChainParams = CreateChainParams(network);
357357
}
358358

359-
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
359+
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
360360
{
361-
globalChainParams->UpdateBIP9Parameters(d, nStartTime, nTimeout);
361+
globalChainParams->UpdateVersionBitsParameters(d, nStartTime, nTimeout);
362362
}
363-

src/chainparams.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CChainParams
7676
const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
7777
const CCheckpointData& Checkpoints() const { return checkpointData; }
7878
const ChainTxData& TxData() const { return chainTxData; }
79-
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
79+
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
8080
protected:
8181
CChainParams() {}
8282

@@ -116,8 +116,8 @@ const CChainParams &Params();
116116
void SelectParams(const std::string& chain);
117117

118118
/**
119-
* Allows modifying the BIP9 regtest parameters.
119+
* Allows modifying the Version Bits regtest parameters.
120120
*/
121-
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
121+
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
122122

123123
#endif // BITCOIN_CHAINPARAMS_H

src/init.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ std::string HelpMessage(HelpMessageMode mode)
449449
strUsage += HelpMessageOpt("-limitancestorsize=<n>", strprintf("Do not accept transactions whose size with all in-mempool ancestors exceeds <n> kilobytes (default: %u)", DEFAULT_ANCESTOR_SIZE_LIMIT));
450450
strUsage += HelpMessageOpt("-limitdescendantcount=<n>", strprintf("Do not accept transactions if any ancestor would have <n> or more in-mempool descendants (default: %u)", DEFAULT_DESCENDANT_LIMIT));
451451
strUsage += HelpMessageOpt("-limitdescendantsize=<n>", strprintf("Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT));
452-
strUsage += HelpMessageOpt("-bip9params=deployment:start:end", "Use given start/end times for specified BIP9 deployment (regtest-only)");
452+
strUsage += HelpMessageOpt("-vbparams=deployment:start:end", "Use given start/end times for specified version bits deployment (regtest-only)");
453453
}
454454
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
455455
_("If <category> is not supplied or if <category> = 1, output all debugging information.") + " " + _("<category> can be:") + " " + ListLogCategories() + ".");
@@ -1104,16 +1104,16 @@ bool AppInitParameterInteraction()
11041104
fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end());
11051105
}
11061106

1107-
if (gArgs.IsArgSet("-bip9params")) {
1108-
// Allow overriding BIP9 parameters for testing
1107+
if (gArgs.IsArgSet("-vbparams")) {
1108+
// Allow overriding version bits parameters for testing
11091109
if (!chainparams.MineBlocksOnDemand()) {
1110-
return InitError("BIP9 parameters may only be overridden on regtest.");
1110+
return InitError("Version bits parameters may only be overridden on regtest.");
11111111
}
1112-
for (const std::string& strDeployment : gArgs.GetArgs("-bip9params")) {
1112+
for (const std::string& strDeployment : gArgs.GetArgs("-vbparams")) {
11131113
std::vector<std::string> vDeploymentParams;
11141114
boost::split(vDeploymentParams, strDeployment, boost::is_any_of(":"));
11151115
if (vDeploymentParams.size() != 3) {
1116-
return InitError("BIP9 parameters malformed, expecting deployment:start:end");
1116+
return InitError("Version bits parameters malformed, expecting deployment:start:end");
11171117
}
11181118
int64_t nStartTime, nTimeout;
11191119
if (!ParseInt64(vDeploymentParams[1], &nStartTime)) {
@@ -1126,9 +1126,9 @@ bool AppInitParameterInteraction()
11261126
for (int j=0; j<(int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j)
11271127
{
11281128
if (vDeploymentParams[0].compare(VersionBitsDeploymentInfo[j].name) == 0) {
1129-
UpdateBIP9Parameters(Consensus::DeploymentPos(j), nStartTime, nTimeout);
1129+
UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout);
11301130
found = true;
1131-
LogPrintf("Setting BIP9 activation parameters for %s to start=%ld, timeout=%ld\n", vDeploymentParams[0], nStartTime, nTimeout);
1131+
LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld\n", vDeploymentParams[0], nStartTime, nTimeout);
11321132
break;
11331133
}
11341134
}

src/rpc/mining.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static UniValue BIP22ValidationResult(const CValidationState& state)
303303
}
304304

305305
std::string gbt_vb_name(const Consensus::DeploymentPos pos) {
306-
const struct BIP9DeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
306+
const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
307307
std::string s = vbinfo.name;
308308
if (!vbinfo.gbt_force) {
309309
s.insert(s.begin(), '!');
@@ -515,7 +515,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
515515
// TODO: Maybe recheck connections/IBD and (if something wrong) send an expires-immediately template to stop miners?
516516
}
517517

518-
const struct BIP9DeploymentInfo& segwit_info = VersionBitsDeploymentInfo[Consensus::DEPLOYMENT_SEGWIT];
518+
const struct VBDeploymentInfo& segwit_info = VersionBitsDeploymentInfo[Consensus::DEPLOYMENT_SEGWIT];
519519
// If the caller is indicating segwit support, then allow CreateNewBlock()
520520
// to select witness transactions, after segwit activates (otherwise
521521
// don't).
@@ -629,7 +629,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
629629
// FALL THROUGH to get vbavailable set...
630630
case THRESHOLD_STARTED:
631631
{
632-
const struct BIP9DeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
632+
const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
633633
vbavailable.push_back(Pair(gbt_vb_name(pos), consensusParams.vDeployments[pos].bit));
634634
if (setClientRules.find(vbinfo.name) == setClientRules.end()) {
635635
if (!vbinfo.gbt_force) {
@@ -642,7 +642,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
642642
case THRESHOLD_ACTIVE:
643643
{
644644
// Add to rules only
645-
const struct BIP9DeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
645+
const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
646646
aRules.push_back(gbt_vb_name(pos));
647647
if (setClientRules.find(vbinfo.name) == setClientRules.end()) {
648648
// Not supported by the client; make sure it's safe to proceed

src/versionbits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "versionbits.h"
66
#include "consensus/params.h"
77

8-
const struct BIP9DeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
8+
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
99
{
1010
/*.name =*/ "testdummy",
1111
/*.gbt_force =*/ true,

src/versionbits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ enum ThresholdState {
3030
// will either be NULL or a block with (height + 1) % Period() == 0.
3131
typedef std::map<const CBlockIndex*, ThresholdState> ThresholdConditionCache;
3232

33-
struct BIP9DeploymentInfo {
33+
struct VBDeploymentInfo {
3434
/** Deployment name */
3535
const char *name;
3636
/** Whether GBT clients can safely ignore this rule in simplified usage */
@@ -45,7 +45,7 @@ struct BIP9Stats {
4545
bool possible;
4646
};
4747

48-
extern const struct BIP9DeploymentInfo VersionBitsDeploymentInfo[];
48+
extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];
4949

5050
/**
5151
* Abstract class that implements BIP9-style threshold logic, and caches results.

test/functional/p2p-compactblocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self):
9898
self.setup_clean_chain = True
9999
# Node0 = pre-segwit, node1 = segwit-aware
100100
self.num_nodes = 2
101-
self.extra_args = [["-bip9params=segwit:0:0"], ["-txindex"]]
101+
self.extra_args = [["-vbparams=segwit:0:0"], ["-txindex"]]
102102
self.utxos = []
103103

104104
def build_block_on_tip(self, node, segwit=False):

test/functional/p2p-segwit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(self):
114114
super().__init__()
115115
self.setup_clean_chain = True
116116
self.num_nodes = 3
117-
self.extra_args = [["-whitelist=127.0.0.1"], ["-whitelist=127.0.0.1", "-acceptnonstdtxn=0"], ["-whitelist=127.0.0.1", "-bip9params=segwit:0:0"]]
117+
self.extra_args = [["-whitelist=127.0.0.1"], ["-whitelist=127.0.0.1", "-acceptnonstdtxn=0"], ["-whitelist=127.0.0.1", "-vbparams=segwit:0:0"]]
118118

119119
def setup_network(self):
120120
self.setup_nodes()

0 commit comments

Comments
 (0)