Skip to content

Commit

Permalink
one test remains
Browse files Browse the repository at this point in the history
  • Loading branch information
2501babe committed Jan 15, 2025
1 parent 85c09bf commit c55b594
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
23 changes: 17 additions & 6 deletions core/src/banking_stage/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1622,17 +1622,23 @@ mod tests {
Blockstore::destroy(ledger_path.path()).unwrap();
}

// HANA TODO this should be changed to conflict on simd83
// it is testing retryable and some recorder stuff. just need to unpack the bam setup
// #[test]
fn _test_bank_process_and_record_transactions_account_in_use() {
#[test_case(false; "old")]
#[test_case(true; "simd83")]
fn test_bank_process_and_record_transactions_account_in_use(
relax_intrabatch_account_locks: bool,
) {
solana_logger::setup();
let GenesisConfigInfo {
genesis_config,
mint_keypair,
..
} = create_slow_genesis_config(10_000);
let (bank, _bank_forks) = Bank::new_no_wallclock_throttle_for_tests(&genesis_config);
let mut bank = Bank::new_for_tests(&genesis_config);
if !relax_intrabatch_account_locks {
bank.deactivate_feature(&feature_set::relax_intrabatch_account_locks::id());
}
bank.ns_per_slot = u128::MAX;
let (bank, _bank_forks) = bank.wrap_with_bank_forks_for_tests();
let pubkey = solana_pubkey::new_rand();
let pubkey1 = solana_pubkey::new_rand();

Expand Down Expand Up @@ -1674,8 +1680,14 @@ mod tests {
);
let consumer = Consumer::new(committer, recorder, QosService::new(1), None);

let conflicting_transaction = SanitizedTransaction::from_transaction_for_tests(
system_transaction::transfer(&Keypair::new(), &pubkey1, 1, genesis_config.hash()),
);

bank.try_lock_accounts(&[conflicting_transaction.clone()]);
let process_transactions_batch_output =
consumer.process_and_record_transactions(&bank, &transactions, 0);
bank.unlock_accounts([(&conflicting_transaction, &Ok(()))].into_iter());

poh_recorder
.read()
Expand All @@ -1691,7 +1703,6 @@ mod tests {
..
} = process_transactions_batch_output.execute_and_commit_transactions_output;

// HANA here
assert_eq!(
transaction_counts,
LeaderProcessedTransactionCounts {
Expand Down
5 changes: 0 additions & 5 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3111,11 +3111,6 @@ fn test_filter_program_errors_and_collect_priority_fee() {
);
}

// HANA NOTE the original version of this test means well but is unsound
// it seems like the idea is that in an entry the second tx should be invalid because the txes are *not serialized*
// but in reality the only reason it fails is because of locks. ie it would fail even if keypair had a balance
// on the other hand it is a perfectly valid simd83 batch because the first transaction funds the second
// i wanted to change rather than delete it tho since i dunno how much coverage the tx count functions have
#[test]
fn test_debits_before_credits() {
let (genesis_config, mint_keypair) =
Expand Down

0 comments on commit c55b594

Please sign in to comment.