This commit is contained in:
Hardhat Chad
2025-10-03 09:19:23 -07:00
parent 9d4bc355e4
commit 3c4d7c6258
3 changed files with 6 additions and 3 deletions

View File

@@ -29,6 +29,9 @@ pub const ONE_MINUTE_SLOTS: u64 = 150;
/// The number of slots in one hour. /// The number of slots in one hour.
pub const ONE_HOUR_SLOTS: u64 = 60 * ONE_MINUTE_SLOTS; pub const ONE_HOUR_SLOTS: u64 = 60 * ONE_MINUTE_SLOTS;
/// The number of slots in 12 hours.
pub const TWELVE_HOURS_SLOTS: u64 = 12 * ONE_HOUR_SLOTS;
/// The number of slots in one day. /// The number of slots in one day.
pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS; pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS;

View File

@@ -53,8 +53,8 @@ pub fn process_checkpoint(accounts: &[AccountInfo<'_>], _data: &[u8]) -> Program
// Calculate bot fee. // Calculate bot fee.
let mut bot_fee = 0; let mut bot_fee = 0;
if clock.slot >= round.expires_at - ONE_DAY_SLOTS { if clock.slot >= round.expires_at - TWELVE_HOURS_SLOTS {
// The round expires in less than 24h. // The round expires in less than 12h.
// Anyone may checkpoint this account and collect the bot fee. // Anyone may checkpoint this account and collect the bot fee.
bot_fee = miner.checkpoint_fee; bot_fee = miner.checkpoint_fee;
miner.checkpoint_fee = 0; miner.checkpoint_fee = 0;

View File

@@ -38,7 +38,7 @@ pub fn process_deploy(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResul
if board.end_slot == u64::MAX { if board.end_slot == u64::MAX {
board.start_slot = clock.slot; board.start_slot = clock.slot;
board.end_slot = board.start_slot + 150; board.end_slot = board.start_slot + 150;
round.expires_at = board.end_slot + ONE_WEEK_SLOTS; round.expires_at = board.end_slot + ONE_DAY_SLOTS;
} }
// Check if signer is the automation executor. // Check if signer is the automation executor.