Skip to content

Commit a313dac

Browse files
authored
15 minutes (#1096)
* 15 minutes * bump version
1 parent afa4ba5 commit a313dac

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

programs/hpl-crons/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hpl-crons"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
# Trigger deployment - timestamp: 03-31-2025 #3
55
description = "Created with Anchor"
66
edition = "2021"

programs/hpl-crons/src/instructions/queue_delegation_claim_v0.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use voter_stake_registry::state::PositionV0;
1717

1818
use crate::{hpl_crons::CIRCUIT_BREAKER_PROGRAM, DelegationClaimBotV0, EPOCH_LENGTH};
1919

20-
pub const TEN_MINUTES: i64 = 60 * 10;
20+
pub const FIFTEEN_MINUTES: i64 = 60 * 15;
2121

2222
#[derive(Accounts)]
2323
pub struct QueueDelegationClaimV0<'info> {
@@ -196,14 +196,16 @@ pub fn handler(ctx: Context<QueueDelegationClaimV0>) -> Result<RunTaskReturnV0>
196196
};
197197
let (compiled_reschedule_tx, _) = compile_transaction(vec![reschedule_ix], seeds).unwrap();
198198

199-
// Trigger the claim 10m after the epoch closes
200-
let after_epoch_trigger =
201-
TriggerV0::Timestamp(max(Clock::get()?.unix_timestamp, epoch_ts + TEN_MINUTES));
199+
// Trigger the claim 15m after the epoch closes
200+
let after_epoch_trigger = TriggerV0::Timestamp(max(
201+
Clock::get()?.unix_timestamp,
202+
epoch_ts + FIFTEEN_MINUTES,
203+
));
202204

203-
// Trigger the transaction that schedules the next claim 10m before the next epoch ends
205+
// Trigger the transaction that schedules the next claim 15m before the next epoch ends
204206
let before_epoch_trigger = TriggerV0::Timestamp(max(
205207
Clock::get()?.unix_timestamp,
206-
epoch_ts + (EPOCH_LENGTH as i64) - TEN_MINUTES,
208+
epoch_ts + (EPOCH_LENGTH as i64) - FIFTEEN_MINUTES,
207209
));
208210

209211
// Pay for the tasks

programs/hpl-crons/src/instructions/start_delegation_claim_bot_v0.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use tuktuk_program::{
1414
TaskQueueAuthorityV0, TaskQueueV0, TransactionSourceV0, TriggerV0,
1515
};
1616

17-
use super::TEN_MINUTES;
17+
use super::FIFTEEN_MINUTES;
1818
use crate::{error::ErrorCode, DelegationClaimBotV0, EPOCH_LENGTH};
1919

2020
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
@@ -129,7 +129,7 @@ pub fn handler(
129129
let curr_epoch = ctx.accounts.delegated_position.last_claimed_epoch + 1;
130130
ctx.accounts.delegation_claim_bot.last_claimed_epoch =
131131
ctx.accounts.delegated_position.last_claimed_epoch;
132-
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - TEN_MINUTES as u64;
132+
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - FIFTEEN_MINUTES as u64;
133133
ctx.accounts.delegation_claim_bot.next_task = ctx.accounts.task.key();
134134
queue_task_v0(
135135
CpiContext::new_with_signer(

programs/hpl-crons/src/instructions/start_delegation_claim_bot_v1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use tuktuk_program::{
1818
TaskQueueAuthorityV0, TaskQueueV0, TaskV0, TransactionSourceV0, TriggerV0,
1919
};
2020

21-
use super::TEN_MINUTES;
21+
use super::FIFTEEN_MINUTES;
2222
use crate::{error::ErrorCode, DelegationClaimBotV0, StartDelegationClaimBotArgsV0, EPOCH_LENGTH};
2323

2424
const HNT_EPOCH: u64 = 20117;
@@ -165,7 +165,7 @@ pub fn handler(
165165
let curr_epoch = ctx.accounts.delegated_position.last_claimed_epoch + 1;
166166
ctx.accounts.delegation_claim_bot.last_claimed_epoch =
167167
ctx.accounts.delegated_position.last_claimed_epoch;
168-
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - TEN_MINUTES as u64;
168+
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - FIFTEEN_MINUTES as u64;
169169
queue_task_v0(
170170
CpiContext::new_with_signer(
171171
ctx.accounts.tuktuk_program.to_account_info(),

0 commit comments

Comments
 (0)