Skip to content

Commit

Permalink
Add MaxMagnitudeUnit to chain parameters
Browse files Browse the repository at this point in the history
This establishes an upper clamp on the magnitude unit. Currently set at 5.
  • Loading branch information
jamescowens committed Jan 12, 2025
1 parent d3b3a43 commit c1a67bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class CMainParams : public CChainParams {
consensus.MRCZeroPaymentInterval = 14 * 24 * 60 * 60;
consensus.MaxMandatorySideStakeTotalAlloc = Fraction(1, 4);
consensus.DefaultMagnitudeUnit = Fraction(1, 4);
consensus.MaxMagnitudeUnit = Fraction(5, 1);
consensus.DefaultMagnitudeWeightFactor = Fraction(100, 567);
consensus.StandardContractReplayLookback = 180 * 24 * 60 * 60;
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
Expand Down Expand Up @@ -192,6 +193,7 @@ class CTestNetParams : public CChainParams {
consensus.MRCZeroPaymentInterval = 10 * 60;
consensus.MaxMandatorySideStakeTotalAlloc = Fraction(1, 4);
consensus.DefaultMagnitudeUnit = Fraction(1, 4);
consensus.MaxMagnitudeUnit = Fraction(5, 1);
consensus.DefaultMagnitudeWeightFactor = Fraction(100, 567);
consensus.StandardContractReplayLookback = 180 * 24 * 60 * 60;
consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
Expand Down
13 changes: 13 additions & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ struct Params {
int ProjectV2Height;
/**
* @brief The default GRC paid for a constant block reward.
*
* Note that the GRC paid for CBR can be specified by an administrative protocol entry with the key name "blockreward1" for
* V13+ blocks. The value is specified in HALFORDS.
*/
int64_t DefaultConstantBlockReward;
/**
Expand All @@ -67,11 +70,21 @@ struct Params {
Fraction MaxMandatorySideStakeTotalAlloc;
/**
* @brief The multiplier applied to network magnitude to determine the rate of accrual. Nominally 1/4 from Fern onwards.
*
* Note that the magnitude unit can be set by an administrative protocol entry with the key name "magnitudeunit" for
* V13+ blocks. The value is specified as a whole number or fraction. For example, 0.25 would be "1/4", 5 would be "5".
*/
Fraction DefaultMagnitudeUnit;
/**
* @brief The maximum magnitude unit allowed to be specified. This is an upper clamp that is set at 5.
*/
Fraction MaxMagnitudeUnit;
/**
* @brief The multiplier applied to (money supply / network magnitude) to scale the network magnitude into equivalent GRC
* for purposes of computing voting weight. Nominally 1 / 5.67 from Fern onwards.
*
* The magnitude weight factor can be set by an administrative protocol entry with the key name "magnitudeweightfactor" for
* V13+ blocks. The value is specified as a whole number or fraction. For example, 1 / 5.67 would be "100/567", 2 would be "2".
*/
Fraction DefaultMagnitudeWeightFactor;
/** The "standard" contract replay lookback for those contract types that do not have a registry db.
Expand Down

0 comments on commit c1a67bf

Please sign in to comment.