From 6dc7b68431fbd451cd83fa11ddab19dffe107eb1 Mon Sep 17 00:00:00 2001 From: James Piechota Date: Thu, 16 Nov 2023 15:24:08 +0000 Subject: [PATCH] Set HF 2.7.1 activation block --- apps/arweave/src/ar_block.erl | 2 +- apps/arweave/src/ar_fork.erl | 25 ++++++++++--------------- apps/arweave/src/ar_pricing.erl | 4 ++-- apps/arweave/test/ar_pricing_tests.erl | 6 +++--- apps/arweave/test/ar_vdf_tests.erl | 6 +++--- 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/apps/arweave/src/ar_block.erl b/apps/arweave/src/ar_block.erl index 5ebc62699..e3c77021b 100644 --- a/apps/arweave/src/ar_block.erl +++ b/apps/arweave/src/ar_block.erl @@ -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, diff --git a/apps/arweave/src/ar_fork.erl b/apps/arweave/src/ar_fork.erl index fdad468f8..99174840f 100644 --- a/apps/arweave/src/ar_fork.erl +++ b/apps/arweave/src/ar_fork.erl @@ -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"). -include_lib("arweave/include/ar_consensus.hrl"). @@ -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() -> @@ -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. diff --git a/apps/arweave/src/ar_pricing.erl b/apps/arweave/src/ar_pricing.erl index d3c755f01..a94bebf22 100644 --- a/apps/arweave/src/ar_pricing.erl +++ b/apps/arweave/src/ar_pricing.erl @@ -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}; diff --git a/apps/arweave/test/ar_pricing_tests.erl b/apps/arweave/test/ar_pricing_tests.erl index 3d4de5fb9..e7bf669a0 100644 --- a/apps/arweave/test/ar_pricing_tests.erl +++ b/apps/arweave/test/ar_pricing_tests.erl @@ -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)), diff --git a/apps/arweave/test/ar_vdf_tests.erl b/apps/arweave/test/ar_vdf_tests.erl index 00f906cbc..75e39a64a 100755 --- a/apps/arweave/test/ar_vdf_tests.erl +++ b/apps/arweave/test/ar_vdf_tests.erl @@ -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),