diff --git a/evm_loader/program/src/account/state.rs b/evm_loader/program/src/account/state.rs index 1ab75378c..5e6044e1c 100644 --- a/evm_loader/program/src/account/state.rs +++ b/evm_loader/program/src/account/state.rs @@ -229,13 +229,16 @@ impl<'a> StateAccount<'a> { program_id: &Pubkey, info: &AccountInfo<'a>, accounts: &AccountsDB, + update_last_usage: bool, ) -> Result<(Self, AccountsStatus)> { let mut status = AccountsStatus::Ok; let mut state = Self::from_account(program_id, info)?; - let timeout = - solana_program::clock::Clock::get().map(|clock| clock.slot.as_u256().as_u64())?; - state.data.timeout = timeout; + if update_last_usage { + let timeout = + solana_program::clock::Clock::get().map(|clock| clock.slot.as_u256().as_u64())?; + state.data.timeout = timeout; + } let is_touched_account = |key: &Pubkey| -> bool { state diff --git a/evm_loader/program/src/instruction/transaction_cancel.rs b/evm_loader/program/src/instruction/transaction_cancel.rs index 69c383ee0..3316cff40 100644 --- a/evm_loader/program/src/instruction/transaction_cancel.rs +++ b/evm_loader/program/src/instruction/transaction_cancel.rs @@ -29,7 +29,7 @@ pub fn process<'a>( log_data(&[b"MINER", operator_balance.address().as_bytes()]); let accounts_db = AccountsDB::new(&accounts[3..], operator, Some(operator_balance), None, None); - let (storage, _) = StateAccount::restore(program_id, &storage_info, &accounts_db)?; + let (storage, _) = StateAccount::restore(program_id, &storage_info, &accounts_db, false)?; let current_timestamp = solana_program::clock::Clock::get().map(|clock| clock.slot.as_u256().as_u64())?; diff --git a/evm_loader/program/src/instruction/transaction_step_from_account.rs b/evm_loader/program/src/instruction/transaction_step_from_account.rs index 01207fed8..84ae0a658 100644 --- a/evm_loader/program/src/instruction/transaction_step_from_account.rs +++ b/evm_loader/program/src/instruction/transaction_step_from_account.rs @@ -106,7 +106,7 @@ pub fn process_inner<'a>( } TAG_STATE => { let (storage, accounts_status) = - StateAccount::restore(program_id, &holder_or_storage, &accounts_db)?; + StateAccount::restore(program_id, &holder_or_storage, &accounts_db, true)?; operator_balance.validate_transaction(storage.trx())?; let miner_address = operator_balance.miner(storage.trx_origin()); diff --git a/evm_loader/program/src/instruction/transaction_step_from_instruction.rs b/evm_loader/program/src/instruction/transaction_step_from_instruction.rs index 8de489773..af061a75f 100644 --- a/evm_loader/program/src/instruction/transaction_step_from_instruction.rs +++ b/evm_loader/program/src/instruction/transaction_step_from_instruction.rs @@ -77,7 +77,7 @@ pub fn process<'a>( } TAG_STATE => { let (storage, accounts_status) = - StateAccount::restore(program_id, &storage_info, &accounts_db)?; + StateAccount::restore(program_id, &storage_info, &accounts_db, true)?; operator_balance.validate_transaction(storage.trx())?; let miner_address = operator_balance.miner(storage.trx_origin());