Skip to content

Commit

Permalink
Delete RETARGET_TOLERANCE_UPPER_BOUND
Browse files Browse the repository at this point in the history
  • Loading branch information
chives-network committed Jan 9, 2024
1 parent eb69171 commit 61380e8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
13 changes: 0 additions & 13 deletions apps/chivesweave/include/ar.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@
-define(RETARGET_BLOCKS, 10).
-endif.

%% We only do retarget if the time it took to mine ?RETARGET_BLOCKS is bigger than
%% or equal to ?RETARGET_TOLERANCE_UPPER_BOUND or smaller than or equal to
%% ?RETARGET_TOLERANCE_LOWER_BOUND.
%% -define(RETARGET_TOLERANCE_UPPER_BOUND, ((?TARGET_TIME * ?RETARGET_BLOCKS) + ?TARGET_TIME)).

%% We only do retarget if the time it took to mine ?RETARGET_BLOCKS is bigger than
%% or equal to ?RETARGET_TOLERANCE_UPPER_BOUND or smaller than or equal to
%% ?RETARGET_TOLERANCE_LOWER_BOUND.
%% -define(RETARGET_TOLERANCE_LOWER_BOUND, ((?TARGET_TIME * ?RETARGET_BLOCKS) - ?TARGET_TIME)).

%% We only do retarget if the time it took to mine ?RETARGET_BLOCKS is more than
%% 1.1 times bigger or smaller than ?TARGET_TIME * ?RETARGET_BLOCKS. Was used before
%% the fork 2.5 where we got rid of the floating point calculations.
-define(RETARGET_TOLERANCE, 0.1).

-define(JOIN_CLOCK_TOLERANCE, 15).
Expand Down
3 changes: 0 additions & 3 deletions apps/chivesweave/include/ar_inflation.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
-define(FORK_15_HEIGHT, ?FORK_1_6).
-endif.

%% BLOCK_PER_YEAR macro prior to 1.5.0.0 release.
-define(PRE_15_BLOCK_PER_YEAR, 525600 / (?TARGET_TIME / 60) ).

%% The number of extra tokens to grant for blocks between the 1.5.0.0 release
%% and the end of year one.
-define(POST_15_Y1_EXTRA, 0).
Expand Down
11 changes: 0 additions & 11 deletions apps/chivesweave/src/ar_inflation.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ calculate_post_15_y1_extra() ->
%%% Private functions.
%%%===================================================================

%% @doc Pre-1.5.0.0 style reward calculation.
pre_15_calculate(Height) when Height =< ?REWARD_DELAY ->
1;
pre_15_calculate(Height) ->
?WINSTON_PER_AR
* 0.2
* ?GENESIS_TOKENS
* math:pow(2, -(Height - ?REWARD_DELAY) / ?PRE_15_BLOCK_PER_YEAR)
* math:log(2)
/ ?PRE_15_BLOCK_PER_YEAR.

calculate_base(Height) ->
{Ln2Dividend, Ln2Divisor} = ?LN2,
Dividend = Height * Ln2Dividend,
Expand Down

0 comments on commit 61380e8

Please sign in to comment.