Skip to content

Commit

Permalink
height_2_7_0
Browse files Browse the repository at this point in the history
  • Loading branch information
chives-network committed Jan 11, 2024
1 parent e81ed98 commit 0ad3ed6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ metrics_master
metrics_slave
release/output
mainnet_data_dir
mainnet_data_dir2
_build
2 changes: 1 addition & 1 deletion apps/chivesweave/include/ar.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-define(CLIENT_VERSION, 5).

%% The current build number -- incremented for every release.
-define(RELEASE_NUMBER, 66).
-define(RELEASE_NUMBER, 67).

-define(DEFAULT_REQUEST_HEADERS,
[
Expand Down
6 changes: 3 additions & 3 deletions apps/chivesweave/src/ar_fork.erl
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ height_2_6_8() ->

-ifdef(FORKS_RESET).
height_2_7_0() ->
15.
65000.
-else.
-ifdef(TESTNET).
height_2_7_0() ->
15.
65000.
-else.
height_2_7_0() ->
15. % Targeting 2023-05-30 16:00 UTC
65000. % Targeting 2023-05-30 16:00 UTC
-endif.
-endif.

Expand Down
3 changes: 2 additions & 1 deletion apps/chivesweave/src/ar_http_iface_middleware.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4377,7 +4377,8 @@ return_info(Req) ->
erlang:process_info(whereis(ar_node_worker), message_queue_len)
)
},
{node_state_latency, (Time + Time2) div 2}
{node_state_latency, (Time + Time2) div 2},
{type, <<"miningnode">>}
]
}
),
Expand Down
12 changes: 5 additions & 7 deletions apps/chivesweave/src/ar_retarget.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ is_retarget_block(Block) ->
?IS_RETARGET_BLOCK(Block).

maybe_retarget(Height, CurDiff, TS, LastRetargetTS, PrevTS) ->
?LOG_INFO([{calculate_difficulty_2_7_0_Height_________________________________, Height}]),
?LOG_INFO([{calculate_difficulty_2_7_0_maybe_retarget_________________________, ar_retarget:is_retarget_height(Height)}]),
case ar_retarget:is_retarget_height(Height) of
true ->
calculate_difficulty(CurDiff, TS, LastRetargetTS, Height, PrevTS);
Expand Down Expand Up @@ -168,9 +166,9 @@ calculate_difficulty_2_7_0(OldDiff, TS, Last, Height) ->
TargetTime = ?RETARGET_BLOCKS * Target_Time,
ActualTime = max(TS - Last, ar_block:get_max_timestamp_deviation()),
Difficulty_2_7_0_factor = calculate_difficulty_2_7_0_factor(ActualTime, TargetTime),
?LOG_INFO([{calculate_difficulty_2_7_0_TargetTime, TargetTime}]),
%% ?LOG_INFO([{calculate_difficulty_2_7_0_TargetTime, TargetTime}]),
?LOG_INFO([{calculate_difficulty_2_7_0_ActualTime, ActualTime}]),
?LOG_INFO([{calculate_difficulty_2_7_0_Difficulty_2_7_0_factor, Difficulty_2_7_0_factor}]),
%% ?LOG_INFO([{calculate_difficulty_2_7_0_Difficulty_2_7_0_factor, Difficulty_2_7_0_factor}]),
case ActualTime < (?RETARGET_BLOCKS * Target_Time + Target_Time)
andalso ActualTime > (?RETARGET_BLOCKS * Target_Time - Target_Time) of
true ->
Expand All @@ -179,9 +177,9 @@ calculate_difficulty_2_7_0(OldDiff, TS, Last, Height) ->
MaxDiff = ?MAX_DIFF,
MinDiff = min_difficulty(Height),
DiffInverse = (MaxDiff - OldDiff) * ActualTime * Difficulty_2_7_0_factor div (TargetTime * 10),
?LOG_INFO([{calculate_difficulty_2_7_0_MaxDiff, MaxDiff}]),
?LOG_INFO([{calculate_difficulty_2_7_0_MinDiff, MinDiff}]),
?LOG_INFO([{calculate_difficulty_2_7_0_DiffInverse, DiffInverse}]),
%% ?LOG_INFO([{calculate_difficulty_2_7_0_MaxDiff, MaxDiff}]),
%% ?LOG_INFO([{calculate_difficulty_2_7_0_MinDiff, MinDiff}]),
%% ?LOG_INFO([{calculate_difficulty_2_7_0_DiffInverse, DiffInverse}]),
between(
MaxDiff - DiffInverse,
MinDiff,
Expand Down

0 comments on commit 0ad3ed6

Please sign in to comment.