Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to get data set size estimate based on 15 days of data #549

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/arweave/src/ar_pricing.erl
Expand Up @@ -84,7 +84,7 @@ get_v2_price_per_gib_minute_two_difficulty(
}
end,
{0, 0, 0, 0},
BlockTimeHistory
lists:sublist(BlockTimeHistory, (15 * 30 * 24))
),
%% The intent of the SolutionsPerPartitionPerVDFStep is to estimate network replica
%% count (how many copies of the weave are stored across the network).
Expand Down Expand Up @@ -172,7 +172,7 @@ get_v2_price_per_gib_minute_two_difficulty(
IntervalTotal * max(1, HashRateTotal) * (?PARTITION_SIZE)
),
log_price_metrics(get_v2_price_per_gib_minute_two_difficulty,
Height, length(LockedRewards), HashRateTotal, RewardTotal,
Height, (15 * 30 * 24), HashRateTotal, RewardTotal,
IntervalTotal, VDFIntervalTotal, OneChunkCount, TwoChunkCount,
SolutionsPerPartitionPerVDFStep, PricePerGiBPerMinute),
PricePerGiBPerMinute.
Expand Down Expand Up @@ -410,6 +410,12 @@ recalculate_price_per_gib_minute(B) ->
_ ->
case is_price_adjustment_height(Height) of
false ->
?LOG_DEBUG([{event, checking_price}]),
LockedRewards = ar_rewards:get_locked_rewards(B),
BlockTimeHistory2 = lists:sublist(BlockTimeHistory,
?BLOCK_TIME_HISTORY_BLOCKS),
get_price_per_gib_minute(Height,
LockedRewards, BlockTimeHistory2, Denomination),
{Price, ScheduledPrice};
true ->
%% price_per_gib_minute = scheduled_price_per_gib_minute
Expand Down