This reverts commit eaa8c67bde
.
This commit is contained in:
@@ -13,7 +13,6 @@ use {
|
||||
TransactionExecutionResult,
|
||||
},
|
||||
blockhash_queue::BlockhashQueue,
|
||||
cost_model::ExecutionCost,
|
||||
rent_collector::RentCollector,
|
||||
system_instruction_processor::{get_system_account_kind, SystemAccountKind},
|
||||
},
|
||||
@@ -115,7 +114,6 @@ pub struct LoadedTransaction {
|
||||
pub program_indices: TransactionProgramIndices,
|
||||
pub rent: TransactionRent,
|
||||
pub rent_debits: RentDebits,
|
||||
pub estimated_execution_cost: ExecutionCost,
|
||||
}
|
||||
|
||||
pub type TransactionLoadResult = (Result<LoadedTransaction>, Option<NonceFull>);
|
||||
@@ -233,7 +231,6 @@ impl Accounts {
|
||||
error_counters: &mut ErrorCounters,
|
||||
rent_collector: &RentCollector,
|
||||
feature_set: &FeatureSet,
|
||||
estimated_execution_cost: ExecutionCost,
|
||||
) -> Result<LoadedTransaction> {
|
||||
// Copy all the accounts
|
||||
let message = tx.message();
|
||||
@@ -377,7 +374,6 @@ impl Accounts {
|
||||
program_indices,
|
||||
rent: tx_rent,
|
||||
rent_debits,
|
||||
estimated_execution_cost,
|
||||
})
|
||||
} else {
|
||||
error_counters.account_not_found += 1;
|
||||
@@ -471,7 +467,7 @@ impl Accounts {
|
||||
txs.iter()
|
||||
.zip(lock_results)
|
||||
.map(|etx| match etx {
|
||||
(tx, (Ok(execution_cost), nonce)) => {
|
||||
(tx, (Ok(()), nonce)) => {
|
||||
let lamports_per_signature = nonce
|
||||
.as_ref()
|
||||
.map(|nonce| nonce.lamports_per_signature())
|
||||
@@ -491,7 +487,6 @@ impl Accounts {
|
||||
error_counters,
|
||||
rent_collector,
|
||||
feature_set,
|
||||
execution_cost,
|
||||
) {
|
||||
Ok(loaded_transaction) => loaded_transaction,
|
||||
Err(e) => return (Err(e), None),
|
||||
@@ -983,14 +978,11 @@ impl Accounts {
|
||||
pub fn lock_accounts<'a>(
|
||||
&self,
|
||||
txs: impl Iterator<Item = &'a SanitizedTransaction>,
|
||||
) -> Vec<Result<ExecutionCost>> {
|
||||
) -> Vec<Result<()>> {
|
||||
let keys: Vec<_> = txs.map(|tx| tx.get_account_locks()).collect();
|
||||
let account_locks = &mut self.account_locks.lock().unwrap();
|
||||
keys.into_iter()
|
||||
.map(|keys| {
|
||||
self.lock_account(account_locks, keys.writable, keys.readonly)
|
||||
.map(|_| 0)
|
||||
})
|
||||
.map(|keys| self.lock_account(account_locks, keys.writable, keys.readonly))
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -999,12 +991,12 @@ impl Accounts {
|
||||
pub fn lock_accounts_with_results<'a>(
|
||||
&self,
|
||||
txs: impl Iterator<Item = &'a SanitizedTransaction>,
|
||||
results: impl Iterator<Item = Result<ExecutionCost>>,
|
||||
) -> Vec<Result<ExecutionCost>> {
|
||||
results: impl Iterator<Item = Result<()>>,
|
||||
) -> Vec<Result<()>> {
|
||||
let key_results: Vec<_> = txs
|
||||
.zip(results)
|
||||
.map(|(tx, result)| match result {
|
||||
Ok(execution_cost) => Ok((tx.get_account_locks(), execution_cost)),
|
||||
Ok(()) => Ok(tx.get_account_locks()),
|
||||
Err(e) => Err(e),
|
||||
})
|
||||
.collect();
|
||||
@@ -1012,9 +1004,7 @@ impl Accounts {
|
||||
key_results
|
||||
.into_iter()
|
||||
.map(|key_result| match key_result {
|
||||
Ok((keys, execution_cost)) => self
|
||||
.lock_account(account_locks, keys.writable, keys.readonly)
|
||||
.map(|_| execution_cost),
|
||||
Ok(keys) => self.lock_account(account_locks, keys.writable, keys.readonly),
|
||||
Err(e) => Err(e),
|
||||
})
|
||||
.collect()
|
||||
@@ -1025,7 +1015,7 @@ impl Accounts {
|
||||
pub fn unlock_accounts<'a>(
|
||||
&self,
|
||||
txs: impl Iterator<Item = &'a SanitizedTransaction>,
|
||||
results: &[Result<ExecutionCost>],
|
||||
results: &[Result<()>],
|
||||
) {
|
||||
let keys: Vec<_> = txs
|
||||
.zip(results)
|
||||
@@ -1310,7 +1300,7 @@ mod tests {
|
||||
accounts.load_accounts(
|
||||
&ancestors,
|
||||
&[sanitized_tx],
|
||||
vec![(Ok(0), None)],
|
||||
vec![(Ok(()), None)],
|
||||
&hash_queue,
|
||||
error_counters,
|
||||
rent_collector,
|
||||
@@ -2458,9 +2448,9 @@ mod tests {
|
||||
let txs = vec![tx0, tx1, tx2];
|
||||
|
||||
let qos_results = vec![
|
||||
Ok(0),
|
||||
Ok(()),
|
||||
Err(TransactionError::WouldExceedMaxBlockCostLimit),
|
||||
Ok(0),
|
||||
Ok(()),
|
||||
];
|
||||
|
||||
let results = accounts.lock_accounts_with_results(txs.iter(), qos_results.into_iter());
|
||||
@@ -2553,7 +2543,6 @@ mod tests {
|
||||
program_indices: vec![],
|
||||
rent: 0,
|
||||
rent_debits: RentDebits::default(),
|
||||
estimated_execution_cost: 0,
|
||||
}),
|
||||
None,
|
||||
);
|
||||
@@ -2564,7 +2553,6 @@ mod tests {
|
||||
program_indices: vec![],
|
||||
rent: 0,
|
||||
rent_debits: RentDebits::default(),
|
||||
estimated_execution_cost: 0,
|
||||
}),
|
||||
None,
|
||||
);
|
||||
@@ -2658,7 +2646,7 @@ mod tests {
|
||||
accounts.load_accounts(
|
||||
&ancestors,
|
||||
&[tx],
|
||||
vec![(Ok(0), None)],
|
||||
vec![(Ok(()), None)],
|
||||
&hash_queue,
|
||||
&mut error_counters,
|
||||
&rent_collector,
|
||||
@@ -2994,7 +2982,6 @@ mod tests {
|
||||
program_indices: vec![],
|
||||
rent: 0,
|
||||
rent_debits: RentDebits::default(),
|
||||
estimated_execution_cost: 0,
|
||||
}),
|
||||
nonce.clone(),
|
||||
);
|
||||
@@ -3105,7 +3092,6 @@ mod tests {
|
||||
program_indices: vec![],
|
||||
rent: 0,
|
||||
rent_debits: RentDebits::default(),
|
||||
estimated_execution_cost: 0,
|
||||
}),
|
||||
nonce.clone(),
|
||||
);
|
||||
|
Reference in New Issue
Block a user