Create epoch length chainparam

This commit is contained in:
Gregory Sanders 2019-05-31 13:38:34 -04:00
parent b996a425e1
commit d10c42a26e
3 changed files with 6 additions and 0 deletions

View file

@ -482,6 +482,8 @@ class CCustomParams : public CRegTestParams {
consensus.nMinimumChainWork = uint256S(args.GetArg("-con_nminimumchainwork", "0x0"));
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
consensus.first_extension_space = {ParseHex("02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f")};

View file

@ -47,6 +47,7 @@ void SetupChainParamsBaseOptions()
gArgs.AddArg("-pak", "Entries in the PAK list. Order of entries matter.", 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("-dynamic_epoch_length", "Per-chain parameter that sets how many blocks dynamic federation voting and enforcement are in effect for.", false, OptionsCategory::ELEMENTS);
// END ELEMENTS
//
}

View file

@ -100,6 +100,9 @@ struct Params {
CScript signblockscript;
uint32_t max_block_signature_size;
// g_signed_blocks - Whether blocks are signed or not, get around circular dep
// Set positive to avoid division by 0
// for non-dynafed chains and unit tests
uint32_t dynamic_epoch_length = std::numeric_limits<uint32_t>::max();
// Used to seed the extension space for first dynamic blocks
std::vector<std::vector<unsigned char>> first_extension_space;
};