Skip to content

Commit

Permalink
Set HF 2.7.1 activation block
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPiechota committed Nov 16, 2023
1 parent 83cbacf commit 6dc7b68
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apps/arweave/src/ar_block.erl
Expand Up @@ -208,7 +208,7 @@ compute_next_vdf_difficulty(PrevB) ->
false ->
NextVDFDifficulty;
true ->
case Height < ar_fork:height_2_8() of
case Height < ar_fork:height_2_7_1() of
true ->
HistoryPart = lists:nthtail(?VDF_HISTORY_CUT,
lists:sublist(PrevB#block.block_time_history,
Expand Down
25 changes: 10 additions & 15 deletions apps/arweave/src/ar_fork.erl
Expand Up @@ -6,7 +6,7 @@

-export([height_1_6/0, height_1_7/0, height_1_8/0, height_1_9/0, height_2_0/0, height_2_2/0,
height_2_3/0, height_2_4/0, height_2_5/0, height_2_6/0, height_2_6_8/0,
height_2_7/0, height_2_8/0]).
height_2_7/0, height_2_7_1/0]).

-include_lib("arweave/include/ar.hrl").

This comment has been minimized.

Copy link
@Gilrod66

Gilrod66 Dec 15, 2023

have a good day

-include_lib("arweave/include/ar_consensus.hrl").
Expand Down Expand Up @@ -114,8 +114,8 @@ height_2_7() ->
?FORK_2_7_HEIGHT.
-else.
-ifdef(FORKS_RESET).
height_2_7() ->
0.
height_2_7() ->
0.
-else.
-ifdef(TESTNET).
height_2_7() ->
Expand All @@ -127,20 +127,15 @@ height_2_7() ->
-endif.
-endif.

-ifdef(FORK_2_8_HEIGHT).
height_2_8() ->
?FORK_2_8_HEIGHT.
-ifdef(FORK_2_7_1_HEIGHT).
height_2_7_1() ->
?FORK_2_7_1_HEIGHT.
-else.
-ifdef(FORKS_RESET).
height_2_8() ->
0.
height_2_7_1() ->
0.
-else.
-ifdef(TESTNET).
height_2_8() ->
1301000.
-else.
height_2_8() ->
infinity.
-endif.
height_2_7_1() ->
1316410. % Targeting 2023-12-05 14:00 UTC
-endif.
-endif.
4 changes: 2 additions & 2 deletions apps/arweave/src/ar_pricing.erl
Expand Up @@ -319,12 +319,12 @@ recalculate_price_per_gib_minute2(B) ->
scheduled_price_per_gib_minute = ScheduledPrice } = B,
Height = PrevHeight + 1,
Fork_2_7 = ar_fork:height_2_7(),
Fork_2_8 = ar_fork:height_2_8(),
Fork_2_7_1 = ar_fork:height_2_7_1(),
case Height of
Fork_2_7 ->
{?PRICE_PER_GIB_MINUTE_PRE_TRANSITION,
?PRICE_PER_GIB_MINUTE_PRE_TRANSITION};
Height when Height < Fork_2_8 ->
Height when Height < Fork_2_7_1 ->
case is_price_adjustment_height(Height) of
false ->
{Price, ScheduledPrice};
Expand Down
6 changes: 3 additions & 3 deletions apps/arweave/test/ar_pricing_tests.erl
Expand Up @@ -152,18 +152,18 @@ recalculate_price_per_gib_minute_2_7_test_() ->
ar_test_node:test_with_mocked_functions(
[{ar_fork, height_2_6, fun() -> -1 end},
{ar_fork, height_2_7, fun() -> -1 end},
{ar_fork, height_2_8, fun() -> infinity end}],
{ar_fork, height_2_7_1, fun() -> infinity end}],
fun() ->
B = recalculate_price_per_gib_minute_test_block(),
?assertEqual({15000, 8162}, ar_pricing:recalculate_price_per_gib_minute(B)),
ok
end).

recalculate_price_per_gib_minute_2_8_ema_test_() ->
recalculate_price_per_gib_minute_2_7_1_ema_test_() ->
ar_test_node:test_with_mocked_functions(
[{ar_fork, height_2_6, fun() -> -1 end},
{ar_fork, height_2_7, fun() -> -1 end},
{ar_fork, height_2_8, fun() -> -1 end}],
{ar_fork, height_2_7_1, fun() -> -1 end}],
fun() ->
B = recalculate_price_per_gib_minute_test_block(),
?assertEqual({15000, 14316}, ar_pricing:recalculate_price_per_gib_minute(B)),
Expand Down
6 changes: 3 additions & 3 deletions apps/arweave/test/ar_vdf_tests.erl
Expand Up @@ -215,18 +215,18 @@ compute_next_vdf_difficulty_2_7_test_()->
ar_test_node:test_with_mocked_functions(
[{ar_fork, height_2_6, fun() -> -1 end},
{ar_fork, height_2_7, fun() -> -1 end},
{ar_fork, height_2_8, fun() -> infinity end}],
{ar_fork, height_2_7_1, fun() -> infinity end}],
fun() ->
B = compute_next_vdf_difficulty_test_block(),
10465 = ar_block:compute_next_vdf_difficulty(B),
ok
end).

compute_next_vdf_difficulty_2_8_test_()->
compute_next_vdf_difficulty_2_7_1_test_()->
ar_test_node:test_with_mocked_functions(
[{ar_fork, height_2_6, fun() -> -1 end},
{ar_fork, height_2_7, fun() -> -1 end},
{ar_fork, height_2_8, fun() -> -1 end}],
{ar_fork, height_2_7_1, fun() -> -1 end}],
fun() ->
B = compute_next_vdf_difficulty_test_block(),
10046 = ar_block:compute_next_vdf_difficulty(B),
Expand Down

0 comments on commit 6dc7b68

Please sign in to comment.