From 690c831abc51e5b516be714cf3a382c1651c44f1 Mon Sep 17 00:00:00 2001 From: Yaroslav Khodakovskij Date: Wed, 3 Apr 2024 17:48:21 +0300 Subject: [PATCH] Remove recent timestamp check --- rfq/program/src/instructions/rfq/create_rfq.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/rfq/program/src/instructions/rfq/create_rfq.rs b/rfq/program/src/instructions/rfq/create_rfq.rs index d19ef8a5..35e19f32 100644 --- a/rfq/program/src/instructions/rfq/create_rfq.rs +++ b/rfq/program/src/instructions/rfq/create_rfq.rs @@ -11,8 +11,6 @@ use crate::{ use anchor_lang::prelude::*; use solana_program::hash::hash; -const RECENT_TIMESTAMP_VALIDITY: u64 = 120; // slightly higher then the recent blockhash validity - #[derive(Accounts)] #[instruction( expected_legs_size: u16, @@ -112,18 +110,6 @@ fn validate_legs<'a, 'info: 'a>( Ok(()) } -fn validate_recent_timestamp(recent_timestamp: u64) -> Result<()> { - let current_timestamp = Clock::get()?.unix_timestamp as u64; - let time_offset = recent_timestamp.abs_diff(current_timestamp); - - require!( - time_offset < RECENT_TIMESTAMP_VALIDITY, - ProtocolError::InvalidRecentTimestamp - ); - - Ok(()) -} - fn validate_whitelist(whitelist: &Whitelist, creator: Pubkey) -> Result<()> { require_keys_eq!( whitelist.associated_rfq, @@ -161,7 +147,7 @@ pub fn create_rfq_instruction<'info>( fixed_size: FixedSize, active_window: u32, settling_window: u32, - recent_timestamp: u64, + _recent_timestamp: u64, ) -> Result<()> { let protocol = &ctx.accounts.protocol; let mut remaining_accounts = ctx.remaining_accounts.iter(); @@ -178,7 +164,6 @@ pub fn create_rfq_instruction<'info>( &legs, print_trade_provider.is_some(), )?; - validate_recent_timestamp(recent_timestamp)?; validate_print_trade_provider(protocol, print_trade_provider)?; let CreateRfqAccounts { taker,