Skip to content

Commit 1e5da20

Browse files
committed
Merge #717: Add legacy pak arg for custom chains
8f6266d Add legacy pak arg for custom chains (Gregory Sanders) Pull request description: Needs backport for 0.18.1 release Tree-SHA512: ca9a14f8ff97dc7c6f7587527aa53f4ad3767faf1077c680e3316ca71df7d9b5e5a37d0001e0f9469aab66e26afc9a8530e7bd0a9000034a29c7df9161f733a0
2 parents 3c8aace + 8f6266d commit 1e5da20

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/chainparams.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,15 @@ class CCustomParams : public CRegTestParams {
487487
consensus.defaultAssumeValid = uint256S(args.GetArg("-con_defaultassumevalid", "0x00"));
488488
// TODO: Embed in genesis block in nTime field with new genesis block type
489489
consensus.dynamic_epoch_length = args.GetArg("-dynamic_epoch_length", 10);
490-
// TODO: pass in serialized vector of byte vectors, parse into extension space
491-
// Junk keys for testing
490+
// Default junk keys for testing
492491
consensus.first_extension_space = {ParseHex("02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f")};
492+
std::vector<std::string> pak_list_str = args.GetArgs("-pak");
493+
if (!pak_list_str.empty()) {
494+
consensus.first_extension_space.clear();
495+
for (const auto& entry : pak_list_str) {
496+
consensus.first_extension_space.push_back(ParseHex(entry));
497+
}
498+
}
493499

494500
nPruneAfterHeight = (uint64_t)args.GetArg("-npruneafterheight", nPruneAfterHeight);
495501
fDefaultConsistencyChecks = args.GetBoolArg("-fdefaultconsistencychecks", fDefaultConsistencyChecks);

src/chainparamsbase.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void SetupChainParamsBaseOptions()
4444

4545
gArgs.AddArg("-fedpegscript", "The script for the federated peg enforce from genesis block. This script may stop being enforced once dynamic federations activates.", false, OptionsCategory::CHAINPARAMS);
4646
gArgs.AddArg("-enforce_pak", "Causes standardness checks to enforce Pegout Authorization Key(PAK) validation before dynamic federations, and consensus enforcement after.", false, OptionsCategory::ELEMENTS);
47+
gArgs.AddArg("-pak", "Sets the 'first extension space' field to the pak entries ala pre-dynamic federations. Only used for testing in custom chains.", false, OptionsCategory::ELEMENTS);
4748
gArgs.AddArg("-multi_data_permitted", "Allow relay of multiple OP_RETURN outputs. (default: -enforce_pak)", false, OptionsCategory::ELEMENTS);
4849
gArgs.AddArg("-con_csv_deploy_start", "Starting height for CSV deployment. (default: -1, which means ACTIVE from genesis)", false, OptionsCategory::ELEMENTS);
4950
gArgs.AddArg("-con_dyna_deploy_start", "Starting height for Dynamic Federations deployment. Once active, signblockscript becomes a BIP141 WSH scriptPubKey of the original signblockscript. All other dynamic parameters stay constant.(default: -1, which means ACTIVE from genesis)", false, OptionsCategory::ELEMENTS);

0 commit comments

Comments
 (0)