From 3c4d7c6258fedcbbc8161316c3dcf087f4a6c4e7 Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Fri, 3 Oct 2025 09:19:23 -0700 Subject: [PATCH] expiry --- api/src/consts.rs | 3 +++ program/src/checkpoint.rs | 4 ++-- program/src/deploy.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/src/consts.rs b/api/src/consts.rs index 0704c6c..2886be3 100644 --- a/api/src/consts.rs +++ b/api/src/consts.rs @@ -29,6 +29,9 @@ pub const ONE_MINUTE_SLOTS: u64 = 150; /// The number of slots in one hour. 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. pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS; diff --git a/program/src/checkpoint.rs b/program/src/checkpoint.rs index f3d553d..f50a59e 100644 --- a/program/src/checkpoint.rs +++ b/program/src/checkpoint.rs @@ -53,8 +53,8 @@ pub fn process_checkpoint(accounts: &[AccountInfo<'_>], _data: &[u8]) -> Program // Calculate bot fee. let mut bot_fee = 0; - if clock.slot >= round.expires_at - ONE_DAY_SLOTS { - // The round expires in less than 24h. + if clock.slot >= round.expires_at - TWELVE_HOURS_SLOTS { + // The round expires in less than 12h. // Anyone may checkpoint this account and collect the bot fee. bot_fee = miner.checkpoint_fee; miner.checkpoint_fee = 0; diff --git a/program/src/deploy.rs b/program/src/deploy.rs index 843c76b..a7b2643 100644 --- a/program/src/deploy.rs +++ b/program/src/deploy.rs @@ -38,7 +38,7 @@ pub fn process_deploy(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResul if board.end_slot == u64::MAX { board.start_slot = clock.slot; 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.