Skip to content

Commit

Permalink
Merge #717: Add legacy pak arg for custom chains
Browse files Browse the repository at this point in the history
8f6266d Add legacy pak arg for custom chains (Gregory Sanders)

Pull request description:

  Needs backport for 0.18.1 release

Tree-SHA512: ca9a14f8ff97dc7c6f7587527aa53f4ad3767faf1077c680e3316ca71df7d9b5e5a37d0001e0f9469aab66e26afc9a8530e7bd0a9000034a29c7df9161f733a0
  • Loading branch information
stevenroose committed Sep 25, 2019
2 parents 3c8aace + 8f6266d commit 1e5da20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,15 @@ class CCustomParams : public CRegTestParams {
consensus.defaultAssumeValid = uint256S(args.GetArg("-con_defaultassumevalid", "0x00"));
// TODO: Embed in genesis block in nTime field with new genesis block type
consensus.dynamic_epoch_length = args.GetArg("-dynamic_epoch_length", 10);
// TODO: pass in serialized vector of byte vectors, parse into extension space
// Junk keys for testing
// Default junk keys for testing
consensus.first_extension_space = {ParseHex("02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f")};
std::vector<std::string> pak_list_str = args.GetArgs("-pak");
if (!pak_list_str.empty()) {
consensus.first_extension_space.clear();
for (const auto& entry : pak_list_str) {
consensus.first_extension_space.push_back(ParseHex(entry));
}
}

nPruneAfterHeight = (uint64_t)args.GetArg("-npruneafterheight", nPruneAfterHeight);
fDefaultConsistencyChecks = args.GetBoolArg("-fdefaultconsistencychecks", fDefaultConsistencyChecks);
Expand Down
1 change: 1 addition & 0 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void SetupChainParamsBaseOptions()

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);
gArgs.AddArg("-enforce_pak", "Causes standardness checks to enforce Pegout Authorization Key(PAK) validation before dynamic federations, and consensus enforcement after.", false, OptionsCategory::ELEMENTS);
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);
gArgs.AddArg("-multi_data_permitted", "Allow relay of multiple OP_RETURN outputs. (default: -enforce_pak)", false, OptionsCategory::ELEMENTS);
gArgs.AddArg("-con_csv_deploy_start", "Starting height for CSV deployment. (default: -1, which means ACTIVE from genesis)", false, OptionsCategory::ELEMENTS);
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);
Expand Down

0 comments on commit 1e5da20

Please sign in to comment.