rename MAX_NUM_TRANSACTIONS_PER_BATCH (#32023)

This commit is contained in:
Andrew Fitzgerald 2023-06-09 15:05:28 -07:00 committed by GitHub
parent 4ebec905c5
commit 450e7c2395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -33,7 +33,8 @@ use {
},
};
pub const MAX_NUM_TRANSACTIONS_PER_BATCH: usize = 64;
/// Consumer will create chunks of transactions from buffer with up to this size.
pub const TARGET_NUM_TRANSACTIONS_PER_BATCH: usize = 64;
pub struct ProcessTransactionBatchOutput {
// The number of transactions filtered out by the cost model
@ -285,7 +286,7 @@ impl Consumer {
while chunk_start != transactions.len() {
let chunk_end = std::cmp::min(
transactions.len(),
chunk_start + MAX_NUM_TRANSACTIONS_PER_BATCH,
chunk_start + TARGET_NUM_TRANSACTIONS_PER_BATCH,
);
let process_transaction_batch_output = self.process_and_record_transactions(
bank,
@ -1349,7 +1350,7 @@ mod tests {
lamports + 1,
genesis_config.hash(),
);
MAX_NUM_TRANSACTIONS_PER_BATCH
TARGET_NUM_TRANSACTIONS_PER_BATCH
];
// Make one transaction that will succeed.
@ -1407,7 +1408,7 @@ mod tests {
1,
genesis_config.hash()
);
MAX_NUM_TRANSACTIONS_PER_BATCH
TARGET_NUM_TRANSACTIONS_PER_BATCH
];
// Make one more in separate batch that also conflicts, but because it's in a separate batch, it