From 8e3e5374dd5c5ce6ac27b4414b45c8f7954688cd Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Mon, 12 Aug 2024 15:32:32 +0000 Subject: [PATCH 1/2] bump epoch to 2 minutes --- api/src/consts.rs | 4 ++-- program/src/mine.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/consts.rs b/api/src/consts.rs index 1b31e4f..c2200ac 100644 --- a/api/src/consts.rs +++ b/api/src/consts.rs @@ -34,7 +34,7 @@ pub const ONE_ORE: u64 = 10u64.pow(TOKEN_DECIMALS as u32); pub const ONE_MINUTE: i64 = 60; /// The number of minutes in a program epoch. -pub const EPOCH_MINUTES: i64 = 1; +pub const EPOCH_MINUTES: i64 = 2; /// The duration of a program epoch, in seconds. pub const EPOCH_DURATION: i64 = ONE_MINUTE * EPOCH_MINUTES; @@ -46,7 +46,7 @@ pub const MAX_SUPPLY: u64 = ONE_ORE * 21_000_000; pub const TARGET_EPOCH_REWARDS: u64 = ONE_ORE * EPOCH_MINUTES as u64; /// The maximum quantity of ORE that can be mined per epoch. -/// Inflation rate ≈ 1 ORE / min (min 0, max 8) +/// Inflation target ≈ 1 ORE / min pub const MAX_EPOCH_REWARDS: u64 = TARGET_EPOCH_REWARDS * BUS_COUNT as u64; /// The quantity of ORE each bus is allowed to issue per epoch. diff --git a/program/src/mine.rs b/program/src/mine.rs index ea8949c..bcc44d4 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -160,9 +160,9 @@ pub fn process_mine<'a, 'info>(accounts: &'a [AccountInfo<'info>], data: &[u8]) // Limit payout amount to whatever is left in the bus. // - // Busses are limited to distributing 1 ORE per epoch. This is the maximum amount a miner can earn + // Busses are limited to distributing 1 ORE per epoch. This is also the maximum amount a miner can earn // for any given hash. - let reward_actual = reward.min(bus.rewards); + let reward_actual = reward.min(bus.rewards).min(ONE_ORE); // Update balances. // From 9d0da95bc88f7fe7b006aa5eb4fcccd205cd42f6 Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Mon, 12 Aug 2024 16:24:58 +0000 Subject: [PATCH 2/2] comment --- program/src/mine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/mine.rs b/program/src/mine.rs index bcc44d4..9a9c15d 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -160,7 +160,7 @@ pub fn process_mine<'a, 'info>(accounts: &'a [AccountInfo<'info>], data: &[u8]) // Limit payout amount to whatever is left in the bus. // - // Busses are limited to distributing 1 ORE per epoch. This is also the maximum amount a miner can earn + // Busses are limited to distributing 1 ORE per epoch. This is also the maximum amount that will be paid out // for any given hash. let reward_actual = reward.min(bus.rewards).min(ONE_ORE);