Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion programs/hpl-crons/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hpl-crons"
version = "0.1.1"
version = "0.1.2"
# Trigger deployment - timestamp: 03-31-2025 #3
description = "Created with Anchor"
edition = "2021"
Expand Down
14 changes: 8 additions & 6 deletions programs/hpl-crons/src/instructions/queue_delegation_claim_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use voter_stake_registry::state::PositionV0;

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

pub const TEN_MINUTES: i64 = 60 * 10;
pub const FIFTEEN_MINUTES: i64 = 60 * 15;

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

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

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

// Pay for the tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tuktuk_program::{
TaskQueueAuthorityV0, TaskQueueV0, TransactionSourceV0, TriggerV0,
};

use super::TEN_MINUTES;
use super::FIFTEEN_MINUTES;
use crate::{error::ErrorCode, DelegationClaimBotV0, EPOCH_LENGTH};

#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
Expand Down Expand Up @@ -129,7 +129,7 @@ pub fn handler(
let curr_epoch = ctx.accounts.delegated_position.last_claimed_epoch + 1;
ctx.accounts.delegation_claim_bot.last_claimed_epoch =
ctx.accounts.delegated_position.last_claimed_epoch;
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - TEN_MINUTES as u64;
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - FIFTEEN_MINUTES as u64;
ctx.accounts.delegation_claim_bot.next_task = ctx.accounts.task.key();
queue_task_v0(
CpiContext::new_with_signer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use tuktuk_program::{
TaskQueueAuthorityV0, TaskQueueV0, TaskV0, TransactionSourceV0, TriggerV0,
};

use super::TEN_MINUTES;
use super::FIFTEEN_MINUTES;
use crate::{error::ErrorCode, DelegationClaimBotV0, StartDelegationClaimBotArgsV0, EPOCH_LENGTH};

const HNT_EPOCH: u64 = 20117;
Expand Down Expand Up @@ -164,7 +164,7 @@ pub fn handler(
let curr_epoch = ctx.accounts.delegated_position.last_claimed_epoch + 1;
ctx.accounts.delegation_claim_bot.last_claimed_epoch =
ctx.accounts.delegated_position.last_claimed_epoch;
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - TEN_MINUTES as u64;
let trigger_time = ((curr_epoch + 1) * EPOCH_LENGTH) - FIFTEEN_MINUTES as u64;
queue_task_v0(
CpiContext::new_with_signer(
ctx.accounts.tuktuk_program.to_account_info(),
Expand Down
Loading